[x265] [PATCH] stats: RD 0/4 profile effectiveness of avoiding intra if split CUs did not select it

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


# HG changeset patch
# User Ashok Kumar Mishra<ashok at multicorewareinc.com>
# Date 1428931471 -19800
#      Mon Apr 13 18:54:31 2015 +0530
# Node ID edd2fb8a28825e856bd614e2d9089473d86f9159
# Parent  1e610ec97fb6a01c282b748b41239508669a7667
stats: RD 0/4 profile effectiveness of avoiding intra if split CUs did not select it

diff -r 1e610ec97fb6 -r edd2fb8a2882 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:54:31 2015 +0530
@@ -934,13 +934,19 @@
                     checkBestMode(md.pred[PRED_BIDIR], depth);
                 }
 
-                if (((bTryIntra && md.bestMode->cu.getQtRootCbf(0)) ||
-                    md.bestMode->sa8dCost == MAX_INT64) && splitIntra)
+                if ((bTryIntra && md.bestMode->cu.getQtRootCbf(0)) ||
+                    md.bestMode->sa8dCost == MAX_INT64)
                 {
-                    md.pred[PRED_INTRA].cu.initSubCU(parentCTU, cuGeom);
-                    checkIntraInInter(md.pred[PRED_INTRA], cuGeom);
-                    encodeIntraInInter(md.pred[PRED_INTRA], cuGeom);
-                    checkBestMode(md.pred[PRED_INTRA], depth);
+                    if (splitIntra)
+                    {
+                        ProfileCounter(parentCTU, totalIntraCU[cuGeom.depth]);
+                        md.pred[PRED_INTRA].cu.initSubCU(parentCTU, cuGeom);
+                        checkIntraInInter(md.pred[PRED_INTRA], cuGeom);
+                        encodeIntraInInter(md.pred[PRED_INTRA], cuGeom);
+                        checkBestMode(md.pred[PRED_INTRA], depth);
+                    }
+                    else
+                        ProfileCounter(parentCTU, skippedIntraCU[cuGeom.depth]);
                 }
             }
             else
@@ -953,12 +959,18 @@
                     md.pred[PRED_BIDIR].sa8dCost < md.bestMode->sa8dCost)
                     md.bestMode = &md.pred[PRED_BIDIR];
 
-                if ((bTryIntra || md.bestMode->sa8dCost == MAX_INT64) && splitIntra)
+                if (bTryIntra || md.bestMode->sa8dCost == MAX_INT64)
                 {
-                    md.pred[PRED_INTRA].cu.initSubCU(parentCTU, cuGeom);
-                    checkIntraInInter(md.pred[PRED_INTRA], cuGeom);
-                    if (md.pred[PRED_INTRA].sa8dCost < md.bestMode->sa8dCost)
-                        md.bestMode = &md.pred[PRED_INTRA];
+                    if (splitIntra)
+                    {
+                        ProfileCounter(parentCTU, totalIntraCU[cuGeom.depth]);
+                        md.pred[PRED_INTRA].cu.initSubCU(parentCTU, cuGeom);
+                        checkIntraInInter(md.pred[PRED_INTRA], cuGeom);
+                        if (md.pred[PRED_INTRA].sa8dCost < md.bestMode->sa8dCost)
+                            md.bestMode = &md.pred[PRED_INTRA];
+                    }
+                    else
+                        ProfileCounter(parentCTU, skippedIntraCU[cuGeom.depth]);
                 }
 
                 /* finally code the best mode selected by SA8D costs:
diff -r 1e610ec97fb6 -r edd2fb8a2882 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Mon Apr 13 18:52:28 2015 +0530
+++ b/source/encoder/encoder.cpp	Mon Apr 13 18:54:31 2015 +0530
@@ -922,6 +922,11 @@
     x265_log(m_param, X265_LOG_INFO, "CU: %%%05.2lf time spent in intra analysis, averaging %.3lf Intra PUs per CTU\n",
              100.0 * cuStats.intraAnalysisElapsedTime / totalWorkerTime,
              (double)cuStats.countIntraAnalysis / cuStats.totalCTUs);
+    if (cuStats.skippedIntraCU[0] || cuStats.skippedIntraCU[1] || cuStats.skippedIntraCU[2])
+        x265_log(m_param, X265_LOG_INFO, "CU: Skipped intra CUs at depth %%%.2lf %%%.2lf %%%.2lf\n",
+                 100.0 * cuStats.skippedIntraCU[0] / cuStats.totalIntraCU[0],
+                 100.0 * cuStats.skippedIntraCU[1] / cuStats.totalIntraCU[1],
+                 100.0 * cuStats.skippedIntraCU[2] / cuStats.totalIntraCU[2]);
     x265_log(m_param, X265_LOG_INFO, "CU: %%%05.2lf time spent in inter RDO, measuring %.3lf inter/merge predictions per CTU\n",
              100.0 * interRDOTotalTime / totalWorkerTime,
              (double)interRDOTotalCount / cuStats.totalCTUs);
diff -r 1e610ec97fb6 -r edd2fb8a2882 source/encoder/search.h
--- a/source/encoder/search.h	Mon Apr 13 18:52:28 2015 +0530
+++ b/source/encoder/search.h	Mon Apr 13 18:54:31 2015 +0530
@@ -188,6 +188,8 @@
 
     uint32_t skippedMotionReferences[NUM_CU_DEPTH];
     uint32_t totalMotionReferences[NUM_CU_DEPTH];
+    uint32_t skippedIntraCU[NUM_CU_DEPTH];
+    uint32_t totalIntraCU[NUM_CU_DEPTH];
 
     uint64_t countIntraRDO[NUM_CU_DEPTH];
     uint64_t countInterRDO[NUM_CU_DEPTH];
@@ -218,6 +220,8 @@
             countInterRDO[i] += other.countInterRDO[i];
             skippedMotionReferences[i] += other.skippedMotionReferences[i];
             totalMotionReferences[i] += other.totalMotionReferences[i];
+            skippedIntraCU[i] += other.skippedIntraCU[i];
+            totalIntraCU[i] += other.totalIntraCU[i];
         }
 
         intraAnalysisElapsedTime += other.intraAnalysisElapsedTime;


More information about the x265-devel mailing list