[x265] [PATCH 4 of 8] multi-level refinement: level 2 support
kavitha at multicorewareinc.com
kavitha at multicorewareinc.com
Mon Feb 27 15:05:20 CET 2017
# HG changeset patch
# User Kavitha Sampath <kavitha at multicorewareinc.com>
# Date 1486116100 -19800
# Fri Feb 03 15:31:40 2017 +0530
# Node ID 4f5f769eea67353167b14de8d8013505ceaa82d6
# Parent 4e18273a7e0318e6a8a46d3f6450d5d451d160d7
multi-level refinement: level 2 support
Level 2 stores/reuses lookahead info along with basic CU analysis info such
as CU depth, CU mode.
diff -r 4e18273a7e03 -r 4f5f769eea67 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp Thu Feb 02 19:14:32 2017 +0530
+++ b/source/encoder/analysis.cpp Fri Feb 03 15:31:40 2017 +0530
@@ -167,7 +167,7 @@
}
}
- if (m_param->analysisMode && m_slice->m_sliceType != I_SLICE)
+ if (m_param->analysisMode && m_slice->m_sliceType != I_SLICE && m_param->analysisRefineLevel > 1)
{
int numPredDir = m_slice->isInterP() ? 1 : 2;
m_reuseInterDataCTU = (analysis_inter_data*)m_frame->m_analysisData.interData;
@@ -188,7 +188,7 @@
if (m_slice->m_sliceType == I_SLICE)
{
analysis_intra_data* intraDataCTU = (analysis_intra_data*)m_frame->m_analysisData.intraData;
- if (m_param->analysisMode == X265_ANALYSIS_LOAD)
+ if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_param->analysisRefineLevel > 1)
{
memcpy(ctu.m_cuDepth, &intraDataCTU->depth[ctu.m_cuAddr * numPartition], sizeof(uint8_t) * numPartition);
memcpy(ctu.m_lumaIntraDir, &intraDataCTU->modes[ctu.m_cuAddr * numPartition], sizeof(uint8_t) * numPartition);
@@ -1018,7 +1018,7 @@
md.pred[PRED_2Nx2N].sa8dCost = 0;
}
- if (m_param->analysisMode == X265_ANALYSIS_LOAD)
+ if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_param->analysisRefineLevel > 1)
{
if (mightNotSplit && depth == m_reuseDepth[cuGeom.absPartIdx])
{
@@ -1585,7 +1585,7 @@
splitData[3].initSplitCUData();
uint32_t allSplitRefs = splitData[0].splitRefs | splitData[1].splitRefs | splitData[2].splitRefs | splitData[3].splitRefs;
uint32_t refMasks[2];
- if (m_param->analysisMode == X265_ANALYSIS_LOAD)
+ if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_param->analysisRefineLevel > 1)
{
if (mightNotSplit && depth == m_reuseDepth[cuGeom.absPartIdx])
{
@@ -2365,7 +2365,7 @@
interMode.cu.setPredModeSubParts(MODE_INTER);
int numPredDir = m_slice->isInterP() ? 1 : 2;
- if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_reuseInterDataCTU)
+ if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_reuseInterDataCTU && m_param->analysisRefineLevel > 1)
{
int refOffset = cuGeom.geomRecurId * 16 * numPredDir + partSize * numPredDir * 2;
int index = 0;
@@ -2407,7 +2407,7 @@
}
interMode.sa8dCost = m_rdCost.calcRdSADCost((uint32_t)interMode.distortion, interMode.sa8dBits);
- if (m_param->analysisMode == X265_ANALYSIS_SAVE && m_reuseInterDataCTU)
+ if (m_param->analysisMode == X265_ANALYSIS_SAVE && m_reuseInterDataCTU && m_param->analysisRefineLevel > 1)
{
int refOffset = cuGeom.geomRecurId * 16 * numPredDir + partSize * numPredDir * 2;
int index = 0;
@@ -2429,7 +2429,7 @@
interMode.cu.setPredModeSubParts(MODE_INTER);
int numPredDir = m_slice->isInterP() ? 1 : 2;
- if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_reuseInterDataCTU)
+ if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_reuseInterDataCTU && m_param->analysisRefineLevel > 1)
{
int refOffset = cuGeom.geomRecurId * 16 * numPredDir + partSize * numPredDir * 2;
int index = 0;
@@ -2463,7 +2463,7 @@
/* predInterSearch sets interMode.sa8dBits, but this is ignored */
encodeResAndCalcRdInterCU(interMode, cuGeom);
- if (m_param->analysisMode == X265_ANALYSIS_SAVE && m_reuseInterDataCTU)
+ if (m_param->analysisMode == X265_ANALYSIS_SAVE && m_reuseInterDataCTU && m_param->analysisRefineLevel > 1)
{
int refOffset = cuGeom.geomRecurId * 16 * numPredDir + partSize * numPredDir * 2;
int index = 0;
diff -r 4e18273a7e03 -r 4f5f769eea67 source/encoder/search.cpp
--- a/source/encoder/search.cpp Thu Feb 02 19:14:32 2017 +0530
+++ b/source/encoder/search.cpp Fri Feb 03 15:31:40 2017 +0530
@@ -2150,7 +2150,8 @@
cu.getNeighbourMV(puIdx, pu.puAbsPartIdx, interMode.interNeighbours);
/* Uni-directional prediction */
- if (m_param->analysisMode == X265_ANALYSIS_LOAD || (m_param->analysisMultiPassRefine && m_param->rc.bStatRead))
+ if ((m_param->analysisMode == X265_ANALYSIS_LOAD && m_param->analysisRefineLevel > 1)
+ || (m_param->analysisMultiPassRefine && m_param->rc.bStatRead))
{
for (int list = 0; list < numPredDir; list++)
{
More information about the x265-devel
mailing list