[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
Tue May 19 15:16:18 CEST 2015


# HG changeset patch
# User Ashok Kumar Mishra<ashok at multicorewareinc.com>
# Date 1431935539 -19800
#      Mon May 18 13:22:19 2015 +0530
# Node ID ade6bee4010cbdb9434c60a9c0d9c4df660952c4
# Parent  778e738401f622f0d59f345bcf817bc992f595fd
analysis: skip intra in RD 0/4 if split was analyzed and no split CUs used intra

diff -r 778e738401f6 -r ade6bee4010c source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Mon May 18 13:20:54 2015 +0530
+++ b/source/encoder/analysis.cpp	Mon May 18 13:22:19 2015 +0530
@@ -759,6 +759,7 @@
     bool mightNotSplit = !(cuGeom.flags & CUGeom::SPLIT_MANDATORY);
     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)
@@ -792,6 +793,7 @@
         invalidateContexts(nextDepth);
         Entropy* nextContext = &m_rqt[depth].cur;
         int nextQP = qp;
+        splitIntra = false;
 
         for (uint32_t subPartIdx = 0; subPartIdx < 4; subPartIdx++)
         {
@@ -807,6 +809,7 @@
                 splitRefs[subPartIdx] = compressInterCU_rd0_4(parentCTU, childGeom, 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);
 
@@ -941,8 +944,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, qp);
                     checkIntraInInter(md.pred[PRED_INTRA], cuGeom);
@@ -960,7 +963,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, qp);
                     checkIntraInInter(md.pred[PRED_INTRA], cuGeom);


More information about the x265-devel mailing list