[x265] [PATCH 05 of 10 RFC] stats: profile effectiveness of avoiding intra if split CUs did not select it

Steve Borho steve at borho.org
Tue Mar 31 03:29:41 CEST 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1426555173 18000
#      Mon Mar 16 20:19:33 2015 -0500
# Node ID 23723c32cda19378c81a31e93433f0e1130fa7c3
# Parent  a4ef8ae018761c9bf11472b2e3112a2acdd8d972
stats: profile effectiveness of avoiding intra if split CUs did not select it

diff -r a4ef8ae01876 -r 23723c32cda1 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Mon Mar 16 20:19:33 2015 -0500
+++ b/source/encoder/analysis.cpp	Mon Mar 16 20:19:33 2015 -0500
@@ -1208,6 +1208,7 @@
 
         if (m_slice->m_sliceType != B_SLICE || m_param->bIntraInBFrames)
         {
+            ProfileCounter(parentCTU, totalIntraCU[cuGeom.depth]);
             if (splitIntra)
             {
                 md.pred[PRED_INTRA].cu.initSubCU(parentCTU, cuGeom);
@@ -1221,6 +1222,8 @@
                     checkBestMode(md.pred[PRED_INTRA_NxN], depth);
                 }
             }
+            else
+                ProfileCounter(parentCTU, skippedIntraCU[cuGeom.depth]);
         }
 
         if (m_bTryLossless)
diff -r a4ef8ae01876 -r 23723c32cda1 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Mon Mar 16 20:19:33 2015 -0500
+++ b/source/encoder/encoder.cpp	Mon Mar 16 20:19:33 2015 -0500
@@ -911,6 +911,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 a4ef8ae01876 -r 23723c32cda1 source/encoder/search.h
--- a/source/encoder/search.h	Mon Mar 16 20:19:33 2015 -0500
+++ b/source/encoder/search.h	Mon Mar 16 20:19:33 2015 -0500
@@ -43,9 +43,9 @@
 #define ProfileCUScope(cu, acc, count) ProfileCUScopeNamed(timedScope, cu, acc, count)
 #define ProfileCounter(cu, count) m_stats[cu.m_encData->m_frameEncoderID].count++;
 #else
-#define ProfileCUScopeNamed(name, cu, acc, count)
-#define ProfileCUScope(cu, acc, count)
-#define ProfileCounter(cu, count)
+#define ProfileCUScopeNamed(name, cu, acc, count) {}
+#define ProfileCUScope(cu, acc, count)            {}
+#define ProfileCounter(cu, count)                 {}
 #endif
 
 namespace x265 {
@@ -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