[x265] [PATCH] bug fix: allow split in frame boundary for scaled encodes

bhavna at multicorewareinc.com bhavna at multicorewareinc.com
Tue May 29 15:53:20 CEST 2018


# HG changeset patch
# User Bhavna Hariharan <bhavna at multicorewareinc.com>
# Date 1527578404 -19800
#      Tue May 29 12:50:04 2018 +0530
# Node ID 9db5be89d74cc55cd6aff30c2a576119ca09d8a1
# Parent  9389296cd844bf14850b98ee181772be94d209b9
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.

diff -r 9389296cd844 -r 9db5be89d74c source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Mon May 28 14:55:57 2018 +0530
+++ b/source/encoder/analysis.cpp	Tue May 29 12:50:04 2018 +0530
@@ -523,14 +523,15 @@
     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 @@
         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);
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x265-clone.patch
Type: text/x-patch
Size: 1994 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20180529/fb7919d9/attachment-0001.bin>


More information about the x265-devel mailing list