[x265] [PATCH 03 of 10 RFC] stats: profile effectiveness of reference limit masks

Steve Borho steve at borho.org
Tue Mar 31 03:29:39 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 a1df19ea80eb72a444f4fd8071d0aa513cd4d8d7
# Parent  7e7bb565c9776e5c46dcbcd25df27e0e0dbfe071
stats: profile effectiveness of reference limit masks

diff -r 7e7bb565c977 -r a1df19ea80eb 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
@@ -903,6 +903,11 @@
                  100.0 * cuStats.motionEstimationElapsedTime / totalWorkerTime,
                  (double)cuStats.countMotionEstimate / cuStats.totalCTUs);
     }
+    if (cuStats.skippedMotionReferences[0] || cuStats.skippedMotionReferences[1] || cuStats.skippedMotionReferences[2])
+        x265_log(m_param, X265_LOG_INFO, "CU: Skipped motion searches per depth %%%.2lf %%%.2lf %%%.2lf\n",
+                 100.0 * cuStats.skippedMotionReferences[0] / cuStats.totalMotionReferences[0],
+                 100.0 * cuStats.skippedMotionReferences[1] / cuStats.totalMotionReferences[1],
+                 100.0 * cuStats.skippedMotionReferences[2] / cuStats.totalMotionReferences[2]);
     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);
diff -r 7e7bb565c977 -r a1df19ea80eb source/encoder/search.cpp
--- a/source/encoder/search.cpp	Mon Mar 16 20:19:33 2015 -0500
+++ b/source/encoder/search.cpp	Mon Mar 16 20:19:33 2015 -0500
@@ -2130,8 +2130,13 @@
             {
                 for (int ref = 0; ref < numRefIdx[list]; ref++)
                 {
+                    ProfileCounter(interMode.cu, totalMotionReferences[cuGeom.depth]);
+
                     if (!(refMask & (1 << ref)))
+                    {
+                        ProfileCounter(interMode.cu, skippedMotionReferences[cuGeom.depth]);
                         continue;
+                    }
 
                     uint32_t bits = m_listSelBits[list] + MVP_IDX_BITS;
                     bits += getTUBits(ref, numRefIdx[list]);
diff -r 7e7bb565c977 -r a1df19ea80eb 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
@@ -186,6 +186,9 @@
     int64_t  weightAnalyzeTime;                 // elapsed worker time analyzing reference weights
     int64_t  totalCTUTime;                      // elapsed worker time in compressCTU (includes pmode master)
 
+    uint32_t skippedMotionReferences[NUM_CU_DEPTH];
+    uint32_t totalMotionReferences[NUM_CU_DEPTH];
+
     uint64_t countIntraRDO[NUM_CU_DEPTH];
     uint64_t countInterRDO[NUM_CU_DEPTH];
     uint64_t countIntraAnalysis;
@@ -213,6 +216,8 @@
             interRDOElapsedTime[i] += other.interRDOElapsedTime[i];
             countIntraRDO[i] += other.countIntraRDO[i];
             countInterRDO[i] += other.countInterRDO[i];
+            skippedMotionReferences[i] += other.skippedMotionReferences[i];
+            totalMotionReferences[i] += other.totalMotionReferences[i];
         }
 
         intraAnalysisElapsedTime += other.intraAnalysisElapsedTime;


More information about the x265-devel mailing list