[x265-commits] [x265] encoder: account for worker time spent in loop filters
Steve Borho
steve at borho.org
Tue Feb 3 00:11:06 CET 2015
details: http://hg.videolan.org/x265/rev/4707cd450fe8
branches:
changeset: 9270:4707cd450fe8
user: Steve Borho <steve at borho.org>
date: Mon Feb 02 16:52:35 2015 -0600
description:
encoder: account for worker time spent in loop filters
Subject: [x265] encoder: remove redundant 'worker', fit within 80 chars
details: http://hg.videolan.org/x265/rev/f189b9328d93
branches:
changeset: 9271:f189b9328d93
user: Steve Borho <steve at borho.org>
date: Mon Feb 02 17:08:08 2015 -0600
description:
encoder: remove redundant 'worker', fit within 80 chars
diffstat:
source/encoder/encoder.cpp | 9 ++++++---
source/encoder/framefilter.cpp | 5 +++++
source/encoder/search.h | 4 ++++
3 files changed, 15 insertions(+), 3 deletions(-)
diffs (90 lines):
diff -r 704aa7690e3d -r f189b9328d93 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp Mon Feb 02 16:07:44 2015 -0600
+++ b/source/encoder/encoder.cpp Mon Feb 02 17:08:08 2015 -0600
@@ -824,7 +824,7 @@ void Encoder::printSummary()
#define ELAPSED_SEC(val) ((double)(val) / 1000000)
#define ELAPSED_MSEC(val) ((double)(val) / 1000)
- int64_t totalWorkerTime = cuStats.totalCTUTime;
+ int64_t totalWorkerTime = cuStats.totalCTUTime + cuStats.loopFilterElapsedTime;
if (m_param->bDistributeModeAnalysis && cuStats.countPModeMasters)
totalWorkerTime += cuStats.pmodeTime;
if (m_param->bDistributeMotionEstimation && cuStats.countPMEMasters)
@@ -857,6 +857,9 @@ void Encoder::printSummary()
x265_log(m_param, X265_LOG_INFO, "CU: %%%05.2lf time spent in intra RDO, measuring %.3lf intra predictions per CTU\n",
100.0 * cuStats.intraRDOElapsedTime / totalWorkerTime,
(double)cuStats.countIntraRDO / cuStats.totalCTUs);
+ x265_log(m_param, X265_LOG_INFO, "CU: %%%05.2lf time spent in loop filters, average %.3lf ms per call\n",
+ 100.0 * cuStats.loopFilterElapsedTime / totalWorkerTime,
+ ELAPSED_MSEC(cuStats.loopFilterElapsedTime) / cuStats.countLoopFilter);
if (m_param->bDistributeModeAnalysis && cuStats.countPModeMasters)
{
x265_log(m_param, X265_LOG_INFO, "CU: %.3lf PMODE masters per CTU, each blocked an average of %.3lf ns\n",
@@ -868,7 +871,7 @@ void Encoder::printSummary()
}
int64_t elapsedEncodeTime = x265_mdate() - m_encodeStartTime;
- int64_t unaccounted = totalWorkerTime -
+ int64_t unaccounted = totalWorkerTime - cuStats.loopFilterElapsedTime -
cuStats.intraAnalysisElapsedTime - cuStats.motionEstimationElapsedTime -
cuStats.interRDOElapsedTime - cuStats.intraRDOElapsedTime -
cuStats.pmeTime - cuStats.pmodeTime;
@@ -876,7 +879,7 @@ void Encoder::printSummary()
x265_log(m_param, X265_LOG_INFO, "CU: %%%05.2lf time spent in other tasks\n",
100.0 * unaccounted / totalWorkerTime);
- x265_log(m_param, X265_LOG_INFO, "CU: " X265_LL " %dX%d CTUs compressed in %.3lf worker seconds, %.3lf CTUs per worker-second\n",
+ x265_log(m_param, X265_LOG_INFO, "CU: " X265_LL " %dX%d CTUs compressed in %.3lf seconds, %.3lf CTUs per worker-second\n",
cuStats.totalCTUs, g_maxCUSize, g_maxCUSize,
ELAPSED_SEC(totalWorkerTime),
cuStats.totalCTUs / ELAPSED_SEC(totalWorkerTime));
diff -r 704aa7690e3d -r f189b9328d93 source/encoder/framefilter.cpp
--- a/source/encoder/framefilter.cpp Mon Feb 02 16:07:44 2015 -0600
+++ b/source/encoder/framefilter.cpp Mon Feb 02 17:08:08 2015 -0600
@@ -83,6 +83,11 @@ void FrameFilter::processRow(int row)
{
ProfileScopeEvent(filterCTURow);
+#if DETAILED_CU_STATS
+ ScopedElapsedTime filterPerfScope(m_frameEncoder->m_cuStats.loopFilterElapsedTime);
+ m_frameEncoder->m_cuStats.countLoopFilter++;
+#endif
+
if (!m_param->bEnableLoopFilter && !m_param->bEnableSAO)
{
processRowPost(row);
diff -r 704aa7690e3d -r f189b9328d93 source/encoder/search.h
--- a/source/encoder/search.h Mon Feb 02 16:07:44 2015 -0600
+++ b/source/encoder/search.h Mon Feb 02 17:08:08 2015 -0600
@@ -145,6 +145,7 @@ struct CUStats
int64_t interRDOElapsedTime;
int64_t intraAnalysisElapsedTime; /* in RD > 4, includes RDO cost */
int64_t motionEstimationElapsedTime;
+ int64_t loopFilterElapsedTime;
int64_t pmeTime;
int64_t pmeBlockTime;
int64_t pmodeTime;
@@ -155,6 +156,7 @@ struct CUStats
uint64_t countInterRDO;
uint64_t countIntraAnalysis;
uint64_t countMotionEstimate;
+ uint64_t countLoopFilter;
uint64_t countPMETasks;
uint64_t countPMEMasters;
uint64_t countPModeTasks;
@@ -174,6 +176,7 @@ struct CUStats
interRDOElapsedTime += other.interRDOElapsedTime;
intraAnalysisElapsedTime += other.intraAnalysisElapsedTime;
motionEstimationElapsedTime += other.motionEstimationElapsedTime;
+ loopFilterElapsedTime += other.loopFilterElapsedTime;
pmeTime += other.pmeTime;
pmeBlockTime += other.pmeBlockTime;
pmodeTime += other.pmodeTime;
@@ -184,6 +187,7 @@ struct CUStats
countInterRDO += other.countInterRDO;
countIntraAnalysis += other.countIntraAnalysis;
countMotionEstimate += other.countMotionEstimate;
+ countLoopFilter += other.countLoopFilter;
countPMETasks += other.countPMETasks;
countPMEMasters += other.countPMEMasters;
countPModeTasks += other.countPModeTasks;
More information about the x265-commits
mailing list