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

ashok at multicorewareinc.com ashok at multicorewareinc.com
Mon Apr 13 15:32:20 CEST 2015


# HG changeset patch
# User Ashok Kumar Mishra<ashok at multicorewareinc.com>
# Date 1428931348 -19800
#      Mon Apr 13 18:52:28 2015 +0530
# Node ID 1e610ec97fb6a01c282b748b41239508669a7667
# Parent  42285010a541e67bdeb55deb2c2ce50f1ce90097
analysis: skip intra in RD 0/4 if split was analyzed and no split CUs used intra

diff -r 42285010a541 -r 1e610ec97fb6 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Mon Apr 13 18:52:28 2015 +0530
+++ b/source/encoder/analysis.cpp	Mon Apr 13 18:52:28 2015 +0530
@@ -755,6 +755,7 @@
     uint32_t minDepth = topSkipMinDepth(parentCTU, cuGeom);
 
     bool earlyskip = false;
+    bool splitIntra = true;
     uint32_t splitRefs[4] = { 0, 0, 0, 0 };
     /* Step 1. Evaluate Merge/Skip candidates for likely early-outs */
     if (mightNotSplit && depth >= minDepth)
@@ -787,6 +788,7 @@
         ModeDepth& nd = m_modeDepth[nextDepth];
         invalidateContexts(nextDepth);
         Entropy* nextContext = &m_rqt[depth].cur;
+        splitIntra = false;
 
         for (uint32_t subPartIdx = 0; subPartIdx < 4; subPartIdx++)
         {
@@ -798,6 +800,7 @@
                 splitRefs[subPartIdx] = compressInterCU_rd0_4(parentCTU, childGeom);
 
                 // 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);
 
@@ -931,8 +934,8 @@
                     checkBestMode(md.pred[PRED_BIDIR], depth);
                 }
 
-                if ((bTryIntra && md.bestMode->cu.getQtRootCbf(0)) ||
-                    md.bestMode->sa8dCost == MAX_INT64)
+                if (((bTryIntra && md.bestMode->cu.getQtRootCbf(0)) ||
+                    md.bestMode->sa8dCost == MAX_INT64) && splitIntra)
                 {
                     md.pred[PRED_INTRA].cu.initSubCU(parentCTU, cuGeom);
                     checkIntraInInter(md.pred[PRED_INTRA], cuGeom);
@@ -950,7 +953,7 @@
                     md.pred[PRED_BIDIR].sa8dCost < md.bestMode->sa8dCost)
                     md.bestMode = &md.pred[PRED_BIDIR];
 
-                if (bTryIntra || md.bestMode->sa8dCost == MAX_INT64)
+                if ((bTryIntra || md.bestMode->sa8dCost == MAX_INT64) && splitIntra)
                 {
                     md.pred[PRED_INTRA].cu.initSubCU(parentCTU, cuGeom);
                     checkIntraInInter(md.pred[PRED_INTRA], cuGeom);


More information about the x265-devel mailing list