<div dir="ltr"><br><div id="__tbSetup"></div><div class="gmail_extra">Looks good, except....<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 25, 2013 at 10:21 AM,  <span dir="ltr"><<a href="mailto:kavitha@multicorewareinc.com" target="_blank">kavitha@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Kavitha Sampath <<a href="mailto:kavitha@multicorewareinc.com">kavitha@multicorewareinc.com</a>><br>
# Date 1385354868 -19800<br>
#      Mon Nov 25 10:17:48 2013 +0530<br>
# Node ID 1cd255c10fff69dbbb42042a09fa56d1fbeb1367<br>
# Parent  10f605bd053009c8c981c7529322fecd1e54af7b<br>
Statistics logging refinement: represent 4x4 statistics for I frame, combine I frame log in single line, preserve space in log<br>
<br>
diff -r 10f605bd0530 -r 1cd255c10fff source/Lib/TLibEncoder/TEncCu.cpp<br>
--- a/source/Lib/TLibEncoder/TEncCu.cpp Fri Nov 22 14:59:34 2013 -0600<br>
+++ b/source/Lib/TLibEncoder/TEncCu.cpp Mon Nov 25 10:17:48 2013 +0530<br>
@@ -636,14 +636,26 @@<br>
         if (outBestCU->m_totalCost < outTempCU->m_totalCost)<br>
         {<br>
             m_log->cntIntra[depth]++;<br>
-            m_log->cntIntra[depth + 1] = m_log->cntIntra[depth + 1] - 4 + boundaryCu;<br>
+            for (int i = 0; i < 4; i++)<br>
+            {<br>
+                if (outTempCU->getPartitionSize(i) != SIZE_NxN)<br>
+                    m_log->cntIntra[depth + 1]--;<br>
+                else<br>
+                    m_log->cntIntraNxN--;<br>
+            }<br>
+            m_log->cntIntra[depth + 1] += boundaryCu;<br>
         }<br>
         xCheckBestMode(outBestCU, outTempCU, depth); // RD compare current prediction with split prediction.<br>
     }<br>
<br>
     if (depth == g_maxCUDepth - 1 && bSubBranch)<br>
     {<br>
-        m_log->cntIntra[depth]++;<br>
+        if (outBestCU->getPartitionSize(0) == SIZE_NxN)<br>
+        {<br>
+            m_log->cntIntraNxN++;<br>
+        }<br>
+        else<br>
+            m_log->cntIntra[depth]++;<br>
     }<br>
     outBestCU->copyToPic(depth); // Copy Best data to Picture for next partition prediction.<br>
<br>
diff -r 10f605bd0530 -r 1cd255c10fff source/encoder/compress.cpp<br>
--- a/source/encoder/compress.cpp       Fri Nov 22 14:59:34 2013 -0600<br>
+++ b/source/encoder/compress.cpp       Mon Nov 25 10:17:48 2013 +0530<br>
@@ -350,7 +350,6 @@<br>
<br>
 void TEncCu::xCompressInterCU(TComDataCU*& outBestCU, TComDataCU*& outTempCU, TComDataCU*& cu, uint32_t depth, uint32_t PartitionIndex, UChar minDepth)<br>
 {<br>
-    m_log->cntTotalCu[depth]++;<br>
     m_abortFlag = false;<br>
<br>
     TComPic* pic = outTempCU->getPic();<br>
@@ -424,6 +423,7 @@<br>
     if (!(depth < minDepth)) //topskip<br>
 #endif<br>
     {<br>
+        m_log->cntTotalCu[depth]++;<br>
         if (!bSliceEnd && bInsidePicture)<br>
         {<br>
             // variables for fast encoder decision<br>
diff -r 10f605bd0530 -r 1cd255c10fff source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp        Fri Nov 22 14:59:34 2013 -0600<br>
+++ b/source/encoder/encoder.cpp        Mon Nov 25 10:17:48 2013 +0530<br>
@@ -356,31 +356,14 @@<br>
<br>
 void Encoder::printSummary()<br>
 {<br>
-    if (param.logLevel >= X265_LOG_INFO)<br>
-    {<br>
-        char buffer[200];<br>
-        if (m_analyzeI.m_numPics)<br>
-            x265_log(&param, X265_LOG_INFO, "frame I: %s\n", statsString(m_analyzeI, buffer));<br>
-        if (m_analyzeP.m_numPics)<br>
-            x265_log(&param, X265_LOG_INFO, "frame P: %s\n", statsString(m_analyzeP, buffer));<br>
-        if (m_analyzeB.m_numPics)<br>
-            x265_log(&param, X265_LOG_INFO, "frame B: %s\n", statsString(m_analyzeB, buffer));<br>
-        if (m_analyzeAll.m_numPics)<br>
-            x265_log(&param, X265_LOG_INFO, "global : %s\n", statsString(m_analyzeAll, buffer));<br>
-        if (param.bEnableWeightedPred)<br>
-        {<br>
-            x265_log(&param, X265_LOG_INFO, "%d of %d (%.2f%%) P frames weighted\n",<br>
-                     m_numWPFrames, m_analyzeP.m_numPics, (float)100.0 * m_numWPFrames / m_analyzeP.m_numPics);<br>
-        }<br>
-    }<br>
     for (int sliceType = 2; sliceType >= 0; sliceType--)<br>
     {<br>
         StatisticLog finalLog;<br>
+        uint64_t cntIntraNxN = 0, cntIntra[4];<br>
         for (int depth = 0; depth < (int)g_maxCUDepth; depth++)<br>
         {<br>
-            double cntInter, cntIntra, cntSplit, cntSkipCu;<br>
-            double cuInterDistribution[INTER_MODES], cuIntraDistribution[INTRA_MODES];<br>
-            double cntIntraNxN = 0.0;<br>
+            uint64_t cntInter, cntSplit, cntSkipCu;<br>
+            uint64_t cuInterDistribution[INTER_MODES], cuIntraDistribution[INTRA_MODES];<br>
             for (int j = 0; j < param.frameNumThreads; j++)<br>
             {<br>
                 for (int row = 0; row < m_frameEncoder[0].m_numRows; row++)<br>
@@ -401,9 +384,9 @@<br>
                             }<br>
                             finalLog.cuInterDistribution[depth][m] += enclog.cuInterDistribution[depth][m];<br>
                         }<br>
-                        if (depth == (int)g_maxCUDepth - 1)<br>
-                            finalLog.cntIntraNxN += enclog.cntIntraNxN;<br>
                     }<br>
+                    if (depth == (int)g_maxCUDepth - 1)<br>
+                        finalLog.cntIntraNxN += enclog.cntIntraNxN;<br>
                 }<br>
             }<br>
             // check for 0/0, if true assign 0 else calculate percentage<br>
@@ -412,7 +395,7 @@<br>
                 if (finalLog.cntInter[depth] == 0)<br>
                     cuInterDistribution[n] = 0;<br>
                 else<br>
-                    cuInterDistribution[n] = (double)(finalLog.cuInterDistribution[depth][n] * 100) / (double)finalLog.cntInter[depth];<br>
+                    cuInterDistribution[n] = (finalLog.cuInterDistribution[depth][n] * 100) / finalLog.cntInter[depth];<br>
                 if (n < INTRA_MODES)<br>
                 {<br>
                     if (finalLog.cntIntra[depth] == 0)<br>
@@ -422,58 +405,89 @@<br>
                     }<br>
                     else<br>
                     {<br>
-                        cntIntraNxN = (double)(finalLog.cntIntraNxN * 100) / (double)finalLog.cntIntra[depth];<br>
-                        cuIntraDistribution[n] = (double)(finalLog.cuIntraDistribution[depth][n] * 100) / (double)finalLog.cntIntra[depth];<br>
+                        cntIntraNxN = (finalLog.cntIntraNxN * 100) / finalLog.cntIntra[depth];<br>
+                        cuIntraDistribution[n] = (finalLog.cuIntraDistribution[depth][n] * 100) / finalLog.cntIntra[depth];<br>
                     }<br>
                 }<br>
             }<br>
             if (finalLog.cntTotalCu[depth] == 0)<br>
             {<br>
                 cntInter = 0;<br>
-                cntIntra = 0;<br>
+                cntIntra[depth] = 0;<br>
                 cntSplit = 0;<br>
                 cntSkipCu = 0;<br>
             }<br>
             else<br>
             {<br>
-                cntInter = (double)(finalLog.cntInter[depth] * 100) / (double)finalLog.cntTotalCu[depth];<br>
-                cntIntra = (double)(finalLog.cntIntra[depth] * 100) / (double)finalLog.cntTotalCu[depth];<br>
-                cntSplit = (double)(finalLog.cntSplit[depth] * 100) / (double)finalLog.cntTotalCu[depth];<br>
-                cntSkipCu = (double)(finalLog.cntSkipCu[depth] * 100) / (double)finalLog.cntTotalCu[depth];<br>
+                cntInter = (finalLog.cntInter[depth] * 100) / finalLog.cntTotalCu[depth];<br>
+                cntIntra[depth] = (finalLog.cntIntra[depth] * 100) / finalLog.cntTotalCu[depth];<br>
+                cntSplit = (finalLog.cntSplit[depth] * 100) / finalLog.cntTotalCu[depth];<br>
+                cntSkipCu = (finalLog.cntSkipCu[depth] * 100) / finalLog.cntTotalCu[depth];<br>
+                if (sliceType == I_SLICE)<br>
+                    cntIntraNxN = (finalLog.cntIntraNxN * 100) / finalLog.cntTotalCu[depth];<br>
             }<br>
             // print statistics<br>
-            if (sliceType == I_SLICE)<br>
-                x265_log(&param, X265_LOG_INFO, "Intra I%d   %.2f%%\n", g_maxCUWidth >> depth, cntIntra);<br>
-            else<br>
+            if (sliceType != I_SLICE)<br>
             {<br>
+                int cuSize = g_maxCUWidth >> depth;<br>
                 if (depth < (int)g_maxCUDepth - 1)<br>
                 {<br>
                     if (sliceType == P_SLICE)<br>
-                        x265_log(&param, X265_LOG_INFO, "Inter P%d   Inter %.2f%% (2Nx2N %.2f%%  Nx2N %.2f%%  2NxN %.2f%%  AMP %.2f%%)  "<br>
-                                "Intra %.2f%% (DC %.2f%%  Planar %.2f%%  Ang %.2f%% )  Split %.2f%%  Skipped %.2f%% \n", g_maxCUWidth >> depth,<br>
-                                cntInter, cuInterDistribution[0], cuInterDistribution[2], cuInterDistribution[1], cuInterDistribution[3],<br>
-                                cntIntra, cuIntraDistribution[0], cuIntraDistribution[1], cuIntraDistribution[2], cntSplit, cntSkipCu);<br>
+                        x265_log(&param, X265_LOG_INFO, "Inter P%d:Split %I64d%% Skip %I64d%% Inter %I64d%%(%dx%d %I64d%% %dx%d %I64d%%"<br>
+                                " %dx%d %I64d%% AMP %I64d%%) Intra %I64d%%(DC %I64d%% Planar %I64d%% Ang %I64d%%)\n", cuSize, cntSplit, cntSkipCu,<br>
+                                cntInter, cuSize, cuSize, cuInterDistribution[0], cuSize/2, cuSize, cuInterDistribution[2], cuSize, cuSize/2, cuInterDistribution[1],<br>
+                                cuInterDistribution[3], cntIntra[depth], cuIntraDistribution[0], cuIntraDistribution[1], cuIntraDistribution[2]);<br>
                     else<br>
-                        x265_log(&param, X265_LOG_INFO, "Inter B%d   Inter %.2f%% (2Nx2N %.2f%%  Nx2N %.2f%%  2NxN %.2f%%  AMP %.2f%%)  "<br>
-                                "Intra %.2f%% (DC %.2f%%  Planar %.2f%%  Ang %.2f%% )  Split %.2f%%  Skipped %.2f%% \n", g_maxCUWidth >> depth,<br>
-                                cntInter, cuInterDistribution[0], cuInterDistribution[2], cuInterDistribution[1], cuInterDistribution[3],<br>
-                                cntIntra, cuIntraDistribution[0], cuIntraDistribution[1], cuIntraDistribution[2], cntSplit, cntSkipCu);<br>
+                        x265_log(&param, X265_LOG_INFO, "Inter B%d:Split %I64d%% Skip %I64d%% Inter %I64d%%(%dx%d %I64d%% %dx%d %I64d%%"<br>
+                                " %dx%d %I64d%% AMP %I64d%%) Intra %I64d%%(DC %I64d%% Planar %I64d%% Ang %I64d%%)\n", cuSize, cntSplit, cntSkipCu,<br>
+                                cntInter, cuSize, cuSize, cuInterDistribution[0], cuSize/2, cuSize, cuInterDistribution[2], cuSize, cuSize/2, cuInterDistribution[1],<br>
+                                cuInterDistribution[3], cntIntra[depth], cuIntraDistribution[0], cuIntraDistribution[1], cuIntraDistribution[2]);<br>
                 }<br>
                 else<br>
                 {<br>
                     if (sliceType == P_SLICE)<br>
-                        x265_log(&param, X265_LOG_INFO, "Inter P%d    Inter %.2f%% (2Nx2N %.2f%%  Nx2N %.2f%%  2NxN %.2f%%  AMP %.2f%%)  "<br>
-                                "Intra %.2f%% (DC %.2f%%  Planar %.2f%%  Ang %.2f%%  NXN %.2f%%)  Skipped %.2f%% \n", g_maxCUWidth >> depth,<br>
-                                cntInter, cuInterDistribution[0], cuInterDistribution[2], cuInterDistribution[1], cuInterDistribution[3],<br>
-                                cntIntra, cuIntraDistribution[0], cuIntraDistribution[1], cuIntraDistribution[2], cntIntraNxN, cntSkipCu);<br>
+                        x265_log(&param, X265_LOG_INFO, "Inter P%-2d:          Skip %I64d%% Inter %I64d%%(%dx%d %I64d%% %dx%d %I64d%%"<br>
+                                " %dx%d %I64d%% AMP %I64d%%) Intra %I64d%%(DC %I64d%% Planar %I64d%% Ang %I64d%% %dx%d %I64d%%)\n", cuSize,<br>
+                                cntSkipCu, cntInter, cuSize, cuSize, cuInterDistribution[0], cuSize/2, cuSize, cuInterDistribution[2], cuSize,<br>
+                                cuSize/2, cuInterDistribution[1], cuInterDistribution[3], cntIntra[depth], cuIntraDistribution[0],<br>
+                                cuIntraDistribution[1], cuIntraDistribution[2], cuSize/2, cuSize/2, cntIntraNxN);<br>
                     else<br>
-                        x265_log(&param, X265_LOG_INFO, "Inter B%d    Inter %.2f%% (2Nx2N %.2f%%  Nx2N %.2f%%  2NxN %.2f%%  AMP %.2f%%)  "<br>
-                                "Intra %.2f%% (DC %.2f%%  Planar %.2f%%  Ang %.2f%%  NXN %.2f%%)  Skipped %.2f%% \n", g_maxCUWidth >> depth,<br>
-                                cntInter, cuInterDistribution[0], cuInterDistribution[2], cuInterDistribution[1], cuInterDistribution[3],<br>
-                                cntIntra, cuIntraDistribution[0], cuIntraDistribution[1], cuIntraDistribution[2], cntIntraNxN, cntSkipCu);<br>
+                        x265_log(&param, X265_LOG_INFO, "Inter B%-2d:          Skip %I64d%% Inter %I64d%%(%dx%d %I64d%% %dx%d %I64d%%"<br></blockquote><div><br></div><div>An extra tab here after InterP8 and InterB8, since split is not valid anymore. Looks unappealing. Can you correct this and send?<br>
 <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+                                " %dx%d %I64d%% AMP %I64d%%) Intra %I64d%%(DC %I64d%% Planar %I64d%% Ang %I64d%% %dx%d %I64d%%)\n", cuSize,<br>
+                                cntSkipCu, cntInter, cuSize, cuSize, cuInterDistribution[0], cuSize/2, cuSize, cuInterDistribution[2], cuSize,<br>
+                                cuSize/2, cuInterDistribution[1], cuInterDistribution[3], cntIntra[depth], cuIntraDistribution[0],<br>
+                                cuIntraDistribution[1], cuIntraDistribution[2], cuSize/2, cuSize/2, cntIntraNxN);<br>
                 }<br>
             }<br>
         }<br>
+        if (sliceType == I_SLICE)<br>
+        {<br>
+            char stats[50];<br>
+            if (g_maxCUDepth == 4)<br>
+                sprintf(stats, "%I64d%%  %I64d%%  %I64d%%  %I64d%%  %I64d%%", cntIntra[0], cntIntra[1], cntIntra[2], cntIntra[3], cntIntraNxN);<br>
+            else if (g_maxCUDepth == 3)<br>
+                sprintf(stats, "%I64d%%  %I64d%%  %I64d%%  %I64d%%", cntIntra[0], cntIntra[1], cntIntra[2], cntIntraNxN);<br>
+            else<br>
+                sprintf(stats, "%I64d%%  %I64d%%  %I64d%%", cntIntra[0], cntIntra[1], cntIntraNxN);<br>
+            x265_log(&param, X265_LOG_INFO, "I-frame %d..4:  %s\n", g_maxCUWidth, stats);<br>
+        }<br>
+    }<br>
+    if (param.logLevel >= X265_LOG_INFO)<br>
+    {<br>
+        char buffer[200];<br>
+        if (m_analyzeI.m_numPics)<br>
+            x265_log(&param, X265_LOG_INFO, "frame I: %s\n", statsString(m_analyzeI, buffer));<br>
+        if (m_analyzeP.m_numPics)<br>
+            x265_log(&param, X265_LOG_INFO, "frame P: %s\n", statsString(m_analyzeP, buffer));<br>
+        if (m_analyzeB.m_numPics)<br>
+            x265_log(&param, X265_LOG_INFO, "frame B: %s\n", statsString(m_analyzeB, buffer));<br>
+        if (m_analyzeAll.m_numPics)<br>
+            x265_log(&param, X265_LOG_INFO, "global : %s\n", statsString(m_analyzeAll, buffer));<br>
+        if (param.bEnableWeightedPred)<br>
+        {<br>
+            x265_log(&param, X265_LOG_INFO, "%d of %d (%.2f%%) P frames weighted\n",<br>
+                     m_numWPFrames, m_analyzeP.m_numPics, (float)100.0 * m_numWPFrames / m_analyzeP.m_numPics);<br>
+        }<br>
     }<br>
 }<br>
<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>