[x265] [PATCH] analysis: skip intra in RD 5/6 if split was analyzed and no split CUs used intra

ashok at multicorewareinc.com ashok at multicorewareinc.com
Tue Jun 23 17:16:13 CEST 2015


# HG changeset patch
# User Ashok Kumar Mishra<ashok at multicorewareinc.com>
# Date 1435071910 -19800
#      Tue Jun 23 20:35:10 2015 +0530
# Node ID ea3ee8fdaf5d6972ed620c1ef8381c45453dcc3d
# Parent  229d13cf751172571c5ca00c45394f3816fc1547
analysis: skip intra in RD 5/6 if split was analyzed and no split CUs used intra

diff -r 229d13cf7511 -r ea3ee8fdaf5d source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Tue Jun 23 20:35:07 2015 +0530
+++ b/source/encoder/analysis.cpp	Tue Jun 23 20:35:10 2015 +0530
@@ -1171,6 +1171,7 @@
     }
 
     bool foundSkip = false;
+    bool splitIntra = true;
     uint32_t splitRefs[4] = { 0, 0, 0, 0 };
     /* Step 1. Evaluate Merge/Skip candidates for likely early-outs */
     if (mightNotSplit)
@@ -1198,6 +1199,7 @@
         invalidateContexts(nextDepth);
         Entropy* nextContext = &m_rqt[depth].cur;
         int nextQP = qp;
+        splitIntra = false;
 
         for (uint32_t subPartIdx = 0; subPartIdx < 4; subPartIdx++)
         {
@@ -1213,6 +1215,7 @@
                 splitRefs[subPartIdx] = compressInterCU_rd5_6(parentCTU, childGeom, zOrder, nextQP);
 
                 // Save best CU and pred data for this sub CU
+                splitIntra |= nd.bestMode->cu.isIntra(0);
                 splitCU->copyPartFrom(nd.bestMode->cu, childGeom, subPartIdx);
                 splitPred->addSubCosts(*nd.bestMode);
                 nd.bestMode->reconYuv.copyToPartYuv(splitPred->reconYuv, childGeom.numPartitions * subPartIdx);
@@ -1323,15 +1326,18 @@
 
             if (m_slice->m_sliceType != B_SLICE || m_param->bIntraInBFrames)
             {
-                md.pred[PRED_INTRA].cu.initSubCU(parentCTU, cuGeom, qp);
-                checkIntra(md.pred[PRED_INTRA], cuGeom, SIZE_2Nx2N, NULL, NULL);
-                checkBestMode(md.pred[PRED_INTRA], depth);
+                if (!m_param->limitReferences || splitIntra)
+                {
+                    md.pred[PRED_INTRA].cu.initSubCU(parentCTU, cuGeom, qp);
+                    checkIntra(md.pred[PRED_INTRA], cuGeom, SIZE_2Nx2N, NULL, NULL);
+                    checkBestMode(md.pred[PRED_INTRA], depth);
 
-                if (cuGeom.log2CUSize == 3 && m_slice->m_sps->quadtreeTULog2MinSize < 3)
-                {
-                    md.pred[PRED_INTRA_NxN].cu.initSubCU(parentCTU, cuGeom, qp);
-                    checkIntra(md.pred[PRED_INTRA_NxN], cuGeom, SIZE_NxN, NULL, NULL);
-                    checkBestMode(md.pred[PRED_INTRA_NxN], depth);
+                    if (cuGeom.log2CUSize == 3 && m_slice->m_sps->quadtreeTULog2MinSize < 3)
+                    {
+                        md.pred[PRED_INTRA_NxN].cu.initSubCU(parentCTU, cuGeom, qp);
+                        checkIntra(md.pred[PRED_INTRA_NxN], cuGeom, SIZE_NxN, NULL, NULL);
+                        checkBestMode(md.pred[PRED_INTRA_NxN], depth);
+                    }
                 }
             }
         }


More information about the x265-devel mailing list