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


# HG changeset patch
# User Ashok Kumar Mishra<ashok at multicorewareinc.com>
# Date 1431935682 -19800
#      Mon May 18 13:24:42 2015 +0530
# Node ID 5bc61c2bc0cec50dc33eda9638f215de21fb4bcf
# Parent  ade6bee4010cbdb9434c60a9c0d9c4df660952c4
stats: RD 0/4 profile effectiveness of avoiding intra if split CUs did not select it

diff -r ade6bee4010c -r 5bc61c2bc0ce source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Mon May 18 13:22:19 2015 +0530
+++ b/source/encoder/analysis.cpp	Mon May 18 13:24:42 2015 +0530
@@ -944,13 +944,21 @@
                     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, qp);
-                    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, qp);
+                        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
@@ -963,12 +971,20 @@
                     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, qp);
-                    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, qp);
+                        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 ade6bee4010c -r 5bc61c2bc0ce source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Mon May 18 13:22:19 2015 +0530
+++ b/source/encoder/encoder.cpp	Mon May 18 13:24:42 2015 +0530
@@ -959,6 +959,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 ade6bee4010c -r 5bc61c2bc0ce source/encoder/search.h
--- a/source/encoder/search.h	Mon May 18 13:22:19 2015 +0530
+++ b/source/encoder/search.h	Mon May 18 13:24:42 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