[x265-commits] [x265] common: remove mostly unused cycle count macros

Steve Borho steve at borho.org
Wed Mar 12 09:15:54 CET 2014


details:   http://hg.videolan.org/x265/rev/e4cf59adfb84
branches:  
changeset: 6469:e4cf59adfb84
user:      Steve Borho <steve at borho.org>
date:      Tue Mar 11 22:10:57 2014 -0500
description:
common: remove mostly unused cycle count macros
Subject: [x265] TEncSearch: initialize MotionEstimate function pointers before merge estimation

details:   http://hg.videolan.org/x265/rev/8a69cfea0304
branches:  
changeset: 6470:8a69cfea0304
user:      Steve Borho <steve at borho.org>
date:      Wed Mar 12 03:15:35 2014 -0500
description:
TEncSearch: initialize MotionEstimate function pointers before merge estimation

diffstat:

 source/Lib/TLibEncoder/TEncSearch.cpp |   7 +++++--
 source/common/common.h                |  17 -----------------
 source/encoder/api.cpp                |   4 ----
 3 files changed, 5 insertions(+), 23 deletions(-)

diffs (72 lines):

diff -r c24eda418b5c -r 8a69cfea0304 source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp	Tue Mar 11 18:27:26 2014 -0500
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Wed Mar 12 03:15:35 2014 -0500
@@ -47,8 +47,6 @@
 
 using namespace x265;
 
-DECLARE_CYCLE_COUNTER(ME);
-
 //! \ingroup TLibEncoder
 //! \{
 
@@ -2232,6 +2230,11 @@ bool TEncSearch::predInterSearch(TComDat
             int roiWidth, roiHeight;
             cu->getPartIndexAndSize(partIdx, partAddr, roiWidth, roiHeight);
 
+            /* xMergeEstimation calls xGetInterPredictionError(), which uses
+             * m_me.bufSAD(), which requires the PB size to be initialized */
+            Pel* pu = fenc->getLumaAddr(cu->getAddr(), cu->getZorderIdxInCU() + partAddr);
+            m_me.setSourcePU(pu - fenc->getLumaAddr(), roiWidth, roiHeight);
+
             assert(cu->getPartitionSize(partAddr) != SIZE_2Nx2N);
 
             // find merge cost
diff -r c24eda418b5c -r 8a69cfea0304 source/common/common.h
--- a/source/common/common.h	Tue Mar 11 18:27:26 2014 -0500
+++ b/source/common/common.h	Wed Mar 12 03:15:35 2014 -0500
@@ -119,23 +119,6 @@ typedef uint32_t pixel4;
         } \
     }
 
-#define ENABLE_CYCLE_COUNTERS 0
-#if ENABLE_CYCLE_COUNTERS
-#include <intrin.h>
-#define DECLARE_CYCLE_COUNTER(SUBSYSTEM_NAME) uint64_t SUBSYSTEM_NAME ## _cycle_count, SUBSYSTEM_NAME ## _num_calls
-#define CYCLE_COUNTER_START(SUBSYSTEM_NAME)   uint64_t start_time = __rdtsc(); SUBSYSTEM_NAME ## _num_calls++
-#define CYCLE_COUNTER_STOP(SUBSYSTEM_NAME)    SUBSYSTEM_NAME ## _cycle_count += __rdtsc() - start_time
-#define EXTERN_CYCLE_COUNTER(SUBSYSTEM_NAME)  extern DECLARE_CYCLE_COUNTER(SUBSYSTEM_NAME)
-#define REPORT_CYCLE_COUNTER(SUBSYSTEM_NAME)  printf("Subsystem: %s\tTotal Cycles: %lld Ave Cycles: %lf Num Calls: %ld\n", #SUBSYSTEM_NAME, \
-                                                     SUBSYSTEM_NAME ## _cycle_count, (double)SUBSYSTEM_NAME ## _cycle_count / SUBSYSTEM_NAME ## _num_calls, SUBSYSTEM_NAME ## _num_calls);
-#else
-#define DECLARE_CYCLE_COUNTER(SUBSYSTEM_NAME)
-#define CYCLE_COUNTER_START(SUBSYSTEM_NAME)
-#define CYCLE_COUNTER_STOP(SUBSYSTEM_NAME)
-#define EXTERN_CYCLE_COUNTER(SUBSYSTEM_NAME)
-#define REPORT_CYCLE_COUNTER(SUBSYSTEM_NAME)
-#endif // if ENABLE_CYCLE_COUNTERS
-
 #if defined(_MSC_VER)
 #define X265_LOG2F(x) (logf((float)(x)) * 1.44269504088896405f)
 #define X265_LOG2(x) (log((double)(x)) * 1.4426950408889640513713538072172)
diff -r c24eda418b5c -r 8a69cfea0304 source/encoder/api.cpp
--- a/source/encoder/api.cpp	Tue Mar 11 18:27:26 2014 -0500
+++ b/source/encoder/api.cpp	Wed Mar 12 03:15:35 2014 -0500
@@ -122,8 +122,6 @@ int x265_encoder_encode(x265_encoder *en
     return numEncoded;
 }
 
-EXTERN_CYCLE_COUNTER(ME);
-
 extern "C"
 void x265_encoder_get_stats(x265_encoder *enc, x265_stats *outputStats, uint32_t statsSizeBytes)
 {
@@ -151,8 +149,6 @@ void x265_encoder_close(x265_encoder *en
     {
         Encoder *encoder = static_cast<Encoder*>(enc);
 
-        REPORT_CYCLE_COUNTER(ME);
-
         encoder->printSummary();
         encoder->destroy();
         delete encoder;


More information about the x265-commits mailing list