[x265] [PATCH] modifications to log file(LOG_CU_COST) to print the best mode, cost chosen at each level

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Thu Jul 18 14:45:40 CEST 2013


# HG changeset patch
# User sumalatha
# Date 1374151526 -19800
# Node ID 9f5ad254bd9c2ecf755cd28f2866beb6a6264109
# Parent  f813f110d69a1a6650e813dd4e612216982a0264
modifications to log file(LOG_CU_COST) to print the best mode, cost chosen at each level.

diff -r f813f110d69a -r 9f5ad254bd9c source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp	Thu Jul 18 02:10:37 2013 -0500
+++ b/source/Lib/TLibEncoder/TEncCu.cpp	Thu Jul 18 18:15:26 2013 +0530
@@ -394,7 +394,7 @@
 #if CU_STAT_LOGFILE
     totalCU++;
     if (cu->getSlice()->getSliceType() != I_SLICE)
-        fprintf(fp1, "CU number : %d \n", totalCU);
+        fprintf(fp1, "\n CU number : %d ", totalCU);
 #endif
     //printf("compressCU[%2d]: Best=0x%08X, Temp=0x%08X\n", omp_get_thread_num(), m_ppcBestCU[0], m_ppcTempCU[0]);
 
@@ -1261,6 +1261,7 @@
 Int TEncCu::xComputeQP(TComDataCU* cu)
 {
     Int baseQP = cu->getSlice()->getSliceQp();
+
     return Clip3(-cu->getSlice()->getSPS()->getQpBDOffsetY(), MAX_QP, baseQP);
 }
 
diff -r f813f110d69a -r 9f5ad254bd9c source/encoder/compress.cpp
--- a/source/encoder/compress.cpp	Thu Jul 18 02:10:37 2013 -0500
+++ b/source/encoder/compress.cpp	Thu Jul 18 18:15:26 2013 +0530
@@ -218,8 +218,6 @@
  * \param outTempCU
  * \returns Void
  */
- 
-
 
 Void TEncCu::xComputeCostInter(TComDataCU* outTempCU, PartSize partSize, UInt index, Bool bUseMRG)
 {
@@ -347,6 +345,9 @@
             }
 
             m_search->encodeResAndCalcRdInterCU(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth], m_bestResiYuv[depth], m_bestRecoYuv[depth], false);
+#if CU_STAT_LOGFILE
+            fprintf(fp1, "\n N : %d ,  Best Inter : %d , ", outBestCU->getWidth(0) / 2, outBestCU->getTotalCost());
+#endif
 
             if (m_bestMergeCU[depth]->getTotalCost() < outBestCU->getTotalCost())
             {
@@ -420,7 +421,9 @@
 #if CU_STAT_LOGFILE
     if (outBestCU)
     {
-        fprintf(fp1, "\n Width : %d ,Inter 2Nx2N_Merge : %d , 2Nx2N : %d , 2NxN : %d, Nx2N : %d , intra : %d", outBestCU->getWidth(0), m_bestMergeCU[depth]->getTotalCost(), m_interCU_2Nx2N[depth]->getTotalCost(), m_interCU_2NxN[depth]->getTotalCost(), m_interCU_Nx2N[depth]->getTotalCost(), m_intraInInterCU[depth]->getTotalCost());
+        fprintf(fp1, "Inter 2Nx2N_Merge : %d , Intra : %d",  m_bestMergeCU[depth]->getTotalCost(), m_intraInInterCU[depth]->getTotalCost());
+        if (outBestCU != m_bestMergeCU[depth] && outBestCU != m_intraInInterCU[depth])
+            fprintf(fp1, " , Best  Part Mode chosen :%d, Pred Mode : %d",  outBestCU->getPartitionSize(0), outBestCU->getPredictionMode(0));
     }
 #endif
 
@@ -508,6 +511,7 @@
         {
             if (outBestCU->getTotalCost() < outTempCU->getTotalCost())
             {
+                fprintf(fp1, "\n%d vs %d  : selected mode :N : %d , cost : %d , Part mode : %d , Pred Mode : %d ", outBestCU->getWidth(0) / 2, outTempCU->getWidth(0) / 2, outBestCU->getWidth(0) / 2, outBestCU->getTotalCost(),  outTempCU->getPartitionSize(0), outTempCU->getPredictionMode(0));
                 if (outBestCU->getPredictionMode(0) == MODE_INTER)
                 {
                     cntInter[depth]++;
@@ -535,6 +539,7 @@
             }
             else
             {
+                fprintf(fp1, "\n  %d vs %d  : selected mode :N : %d , cost : %d  ", outBestCU->getWidth(0) / 2, outTempCU->getWidth(0) / 2, outTempCU->getWidth(0) / 2, outTempCU->getTotalCost());
                 cntSplit[depth]++;
             }
         }


More information about the x265-devel mailing list