[x265] [PATCH] analysis: share the depth, best modes and partitions based on cuAddr - bug fix

gopu at multicorewareinc.com gopu at multicorewareinc.com
Mon Oct 20 09:53:37 CEST 2014


# HG changeset patch
# User Gopu Govindaswamy <gopu at multicorewareinc.com>
# Date 1413791603 -19800
#      Mon Oct 20 13:23:23 2014 +0530
# Node ID d04a014dffcc84caa22fbd3d6062b4b94790dcaa
# Parent  c15bb6a0d01fd16c663b64787b6432d7d465d4cb
analysis: share the depth, best modes and partitions based on cuAddr - bug fix

diff -r c15bb6a0d01f -r d04a014dffcc source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Mon Oct 20 00:20:13 2014 -0500
+++ b/source/encoder/analysis.cpp	Mon Oct 20 13:23:23 2014 +0530
@@ -188,20 +188,24 @@
 
     if (shared)
     {
-        if (mightNotSplit && depth == shared->depth[zOrder] && zOrder == cuData.encodeIdx)
+        uint8_t* sharedDepth = &shared->depth[parentCTU.m_cuAddr * parentCTU.m_numPartitions];
+        char* sharedPartSizes = &shared->partSizes[parentCTU.m_cuAddr * parentCTU.m_numPartitions];
+        uint8_t* sharedModes = &shared->modes[parentCTU.m_cuAddr * parentCTU.m_numPartitions];
+
+        if (mightNotSplit && depth == sharedDepth[zOrder] && zOrder == cuData.encodeIdx)
         {
             m_quant.setQPforQuant(parentCTU);
 
-            PartSize size = (PartSize)shared->partSizes[zOrder];
+            PartSize size = (PartSize)sharedPartSizes[zOrder];
             Mode& mode = size == SIZE_2Nx2N ? md.pred[PRED_INTRA] : md.pred[PRED_INTRA_NxN];
             mode.cu.initSubCU(parentCTU, cuData);
-            checkIntra(mode, cuData, size, shared->modes);
+            checkIntra(mode, cuData, size, sharedModes);
 
             if (mightSplit)
                 addSplitFlagCost(*md.bestMode, cuData.depth);
 
             // increment zOrder offset to point to next best depth in sharedDepth buffer
-            zOrder += g_depthInc[g_maxCUDepth - 1][depth];
+            zOrder += g_depthInc[g_maxCUDepth - 1][sharedDepth[zOrder]];
             mightSplit = false;
         }
     }


More information about the x265-devel mailing list