[x265-commits] [x265] fix bug in copying vbv information when scalefactor is 0

Kavitha Sampath kavitha at multicorewareinc.com
Wed May 30 01:03:03 CEST 2018


details:   http://hg.videolan.org/x265/rev/9389296cd844
branches:  
changeset: 12352:9389296cd844
user:      Kavitha Sampath <kavitha at multicorewareinc.com>
date:      Mon May 28 14:55:57 2018 +0530
description:
fix bug in copying vbv information when scalefactor is 0
Subject: [x265] bug fix: allow split in frame boundary for scaled encodes.

details:   http://hg.videolan.org/x265/rev/9db5be89d74c
branches:  
changeset: 12353:9db5be89d74c
user:      Bhavna Hariharan <bhavna at multicorewareinc.com>
date:      Tue May 29 12:50:04 2018 +0530
description:
bug fix: allow split in frame boundary for scaled encodes.

For cases where the entire CTU is not within the frame boundary, the CU must be
allowed to split when the depth from the save encode is not applicable.
Subject: [x265] fix build warnings in Linux

details:   http://hg.videolan.org/x265/rev/8abec7fc29d6
branches:  
changeset: 12354:8abec7fc29d6
user:      Bhavna Hariharan <bhavna at multicorewareinc.com>
date:      Tue May 29 19:13:16 2018 +0530
description:
fix build warnings in Linux
Subject: [x265] Merge with default

details:   http://hg.videolan.org/x265/rev/e3ff1e578df3
branches:  stable
changeset: 12355:e3ff1e578df3
user:      Ashok Kumar Mishra <ashok at multicorewareinc.com>
date:      Tue May 29 19:43:53 2018 +0530
description:
Merge with default
Subject: [x265] Merge with stable

details:   http://hg.videolan.org/x265/rev/a7bd0622ece5
branches:  
changeset: 12356:a7bd0622ece5
user:      Ashok Kumar Mishra <ashok at multicorewareinc.com>
date:      Tue May 29 19:49:13 2018 +0530
description:
Merge with stable

diffstat:

 source/encoder/analysis.cpp |  10 ++++++----
 source/encoder/encoder.cpp  |  30 +++++++++++++++++-------------
 2 files changed, 23 insertions(+), 17 deletions(-)

diffs (80 lines):

diff -r 885d11038797 -r a7bd0622ece5 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Tue May 22 10:18:23 2018 +0530
+++ b/source/encoder/analysis.cpp	Tue May 29 19:49:13 2018 +0530
@@ -523,14 +523,15 @@ uint64_t Analysis::compressIntraCU(const
     int split = 0;
     if (m_param->intraRefine && m_param->intraRefine != 4)
     {
-        split = m_param->scaleFactor && ((cuGeom.log2CUSize == (uint32_t)(g_log2Size[m_param->minCUSize] + 1)) && bDecidedDepth);
+        split = m_param->scaleFactor && bDecidedDepth && (!mightNotSplit || 
+            ((cuGeom.log2CUSize == (uint32_t)(g_log2Size[m_param->minCUSize] + 1))));
         if (cuGeom.log2CUSize == (uint32_t)(g_log2Size[m_param->minCUSize]) && !bDecidedDepth)
             bAlreadyDecided = false;
     }
 
     if (bAlreadyDecided)
     {
-        if (bDecidedDepth)
+        if (bDecidedDepth && mightNotSplit)
         {
             Mode& mode = md.pred[0];
             md.bestMode = &mode;
@@ -2420,10 +2421,11 @@ void Analysis::recodeCU(const CUData& pa
         m_refineLevel = m_param->interRefine;
     else
         m_refineLevel = m_frame->m_classifyFrame ? 1 : 3;
-    int split = (m_param->scaleFactor && m_refineLevel && cuGeom.log2CUSize == (uint32_t)(g_log2Size[m_param->minCUSize] + 1) && bDecidedDepth);
+    int split = (m_param->scaleFactor && bDecidedDepth && (!mightNotSplit || 
+        (m_refineLevel && cuGeom.log2CUSize == (uint32_t)(g_log2Size[m_param->minCUSize] + 1))));
     td.split = split;
 
-    if (bDecidedDepth)
+    if (bDecidedDepth && mightNotSplit)
     {
         setLambdaFromQP(parentCTU, qp, lqp);
 
diff -r 885d11038797 -r a7bd0622ece5 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Tue May 22 10:18:23 2018 +0530
+++ b/source/encoder/encoder.cpp	Tue May 29 19:49:13 2018 +0530
@@ -3408,24 +3408,28 @@ void Encoder::readAnalysisFile(x265_anal
     allocAnalysis(analysis);
     if (m_param->bDisableLookahead && m_rateControl->m_isVbv)
     {
+        uint64_t vbvCount = m_param->lookaheadDepth + m_param->bframes + 2;
         X265_FREAD(analysis->lookahead.intraVbvCost, sizeof(uint32_t), analysis->numCUsInFrame, m_analysisFileIn, picData->lookahead.intraVbvCost);
         X265_FREAD(analysis->lookahead.vbvCost, sizeof(uint32_t), analysis->numCUsInFrame, m_analysisFileIn, picData->lookahead.vbvCost);
         X265_FREAD(analysis->lookahead.satdForVbv, sizeof(uint32_t), analysis->numCuInHeight, m_analysisFileIn, picData->lookahead.satdForVbv);
         X265_FREAD(analysis->lookahead.intraSatdForVbv, sizeof(uint32_t), analysis->numCuInHeight, m_analysisFileIn, picData->lookahead.intraSatdForVbv);
-
-        int vbvCount = m_param->lookaheadDepth + m_param->bframes + 2;
-        for (int index = 0; index < vbvCount; index++)
-            analysis->lookahead.plannedSatd[index] = picData->lookahead.plannedSatd[index] * (2 * m_param->scaleFactor);
-
-        for (uint32_t i = 0; i < analysis->numCuInHeight; i++)
+        X265_FREAD(analysis->lookahead.plannedSatd, sizeof(uint64_t), vbvCount, m_analysisFileIn, picData->lookahead.plannedSatd);
+
+        if (m_param->scaleFactor)
         {
-            analysis->lookahead.satdForVbv[i] = analysis->lookahead.satdForVbv[i] * (2* m_param->scaleFactor);
-            analysis->lookahead.intraSatdForVbv[i] = analysis->lookahead.intraSatdForVbv[i] * (2 * m_param->scaleFactor);
-        }
-        for (uint32_t i = 0; i < analysis->numCUsInFrame; i++)
-        {
-            analysis->lookahead.vbvCost[i] = analysis->lookahead.vbvCost[i] * (2 * m_param->scaleFactor);
-            analysis->lookahead.intraVbvCost[i] = analysis->lookahead.intraVbvCost[i] * (2 * m_param->scaleFactor);
+            for (uint64_t index = 0; index < vbvCount; index++)
+                analysis->lookahead.plannedSatd[index] *= factor;
+
+            for (uint32_t i = 0; i < analysis->numCuInHeight; i++)
+            {
+                analysis->lookahead.satdForVbv[i] *= factor;
+                analysis->lookahead.intraSatdForVbv[i] *= factor;
+            }
+            for (uint32_t i = 0; i < analysis->numCUsInFrame; i++)
+            {
+                analysis->lookahead.vbvCost[i] *= factor;
+                analysis->lookahead.intraVbvCost[i] *= factor;
+            }
         }
     }
     if (analysis->sliceType == X265_TYPE_IDR || analysis->sliceType == X265_TYPE_I)


More information about the x265-commits mailing list