[x265] [PATCH] stats: remove per frame console logging from log-level 4

Divya Manivannan divya at multicorewareinc.com
Wed May 27 14:53:00 CEST 2015


# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1432721237 -19800
#      Wed May 27 15:37:17 2015 +0530
# Node ID c33107628ce48eb4df9039b3620e00ed4bfb36cc
# Parent  018b54d14c0bb3a1244286d4c4489ff1e31320fa
stats: remove per frame console logging from log-level 4.

Since per frame csv logging is performed in log-level 3, console logging is removed.

diff -r 018b54d14c0b -r c33107628ce4 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Wed May 27 14:38:05 2015 +0530
+++ b/source/encoder/encoder.cpp	Wed May 27 15:37:17 2015 +0530
@@ -246,7 +246,20 @@
                         fprintf(m_csvfpt, "RateFactor, ");
                     fprintf(m_csvfpt, "Y PSNR, U PSNR, V PSNR, YUV PSNR, SSIM, SSIM (dB),  List 0, List 1");
                     /* detailed performance statistics */
-                    fprintf(m_csvfpt, ", DecideWait (ms), Row0Wait (ms), Wall time (ms), Ref Wait Wall (ms), Total CTU time (ms), Stall Time (ms), Avg WPP, Row Blocks\n");
+                    fprintf(m_csvfpt, ", DecideWait (ms), Row0Wait (ms), Wall time (ms), Ref Wait Wall (ms), Total CTU time (ms), Stall Time (ms), Avg WPP, Row Blocks");
+                    if (m_param->logLevel >= X265_LOG_DEBUG)
+                    {
+                        if (m_param->decodedPictureHashSEI && m_param->logLevel >= X265_LOG_FULL)
+                        {
+                            if (m_param->decodedPictureHashSEI == 1)
+                                fprintf(m_csvfpt, ", MD5");
+                            else if (m_param->decodedPictureHashSEI == 2)
+                                fprintf(m_csvfpt, ", CRC");
+                            else if (m_param->decodedPictureHashSEI == 3)
+                                fprintf(m_csvfpt, ", Checksum");
+                        }
+                    }
+                    fprintf(m_csvfpt, "\n");
                 }
                 else
                     fputs(summaryCSVHeader, m_csvfpt);
@@ -1230,62 +1243,10 @@
     if (!IS_REFERENCED(curFrame))
         c += 32; // lower case if unreferenced
 
-    // if debug log level is enabled, per frame console logging is performed
-    if (m_param->logLevel >= X265_LOG_DEBUG)
-    {
-        char buf[1024];
-        int p;
-        p = sprintf(buf, "POC:%d %c QP %2.2lf(%d) %10d bits", poc, c, curEncData.m_avgQpAq, slice->m_sliceQp, (int)bits);
-        if (m_param->rc.rateControlMode == X265_RC_CRF)
-            p += sprintf(buf + p, " RF:%.3lf", curEncData.m_rateFactor);
-        if (m_param->bEnablePsnr)
-            p += sprintf(buf + p, " [Y:%6.2lf U:%6.2lf V:%6.2lf]", psnrY, psnrU, psnrV);
-        if (m_param->bEnableSsim)
-            p += sprintf(buf + p, " [SSIM: %.3lfdB]", x265_ssim2dB(ssim));
-
-        if (!slice->isIntra())
-        {
-            int numLists = slice->isInterP() ? 1 : 2;
-            for (int list = 0; list < numLists; list++)
-            {
-                p += sprintf(buf + p, " [L%d ", list);
-                for (int ref = 0; ref < slice->m_numRefIdx[list]; ref++)
-                {
-                    int k = slice->m_refPOCList[list][ref] - slice->m_lastIDR;
-                    p += sprintf(buf + p, "%d ", k);
-                }
-
-                p += sprintf(buf + p, "]");
-            }
-        }
-
-        if (m_param->decodedPictureHashSEI && m_param->logLevel >= X265_LOG_FULL)
-        {
-            const char* digestStr = NULL;
-            if (m_param->decodedPictureHashSEI == 1)
-            {
-                digestStr = digestToString(curEncoder->m_seiReconPictureDigest.m_digest, 16);
-                p += sprintf(buf + p, " [MD5:%s]", digestStr);
-            }
-            else if (m_param->decodedPictureHashSEI == 2)
-            {
-                digestStr = digestToString(curEncoder->m_seiReconPictureDigest.m_digest, 2);
-                p += sprintf(buf + p, " [CRC:%s]", digestStr);
-            }
-            else if (m_param->decodedPictureHashSEI == 3)
-            {
-                digestStr = digestToString(curEncoder->m_seiReconPictureDigest.m_digest, 4);
-                p += sprintf(buf + p, " [Checksum:%s]", digestStr);
-            }
-        }
-
-        x265_log(m_param, X265_LOG_DEBUG, "%s\n", buf);
-    }
-
     if (m_param->logLevel >= X265_LOG_FRAME && m_csvfpt)
     {
         // per frame CSV logging if the file handle is valid
-        fprintf(m_csvfpt, "%d, %c-SLICE, %4d, %2.2lf, %10d,", m_outputCount++, c, poc, curEncData.m_avgQpAq, (int)bits);
+        fprintf(m_csvfpt, "%d, %c-SLICE, %4d, %2.2lf(%d), %10d,", m_outputCount++, c, poc, curEncData.m_avgQpAq, slice->m_sliceQp, (int)bits);
         if (m_param->rc.rateControlMode == X265_RC_CRF)
             fprintf(m_csvfpt, "%.3lf,", curEncData.m_rateFactor);
         double psnr = (psnrY * 6 + psnrU + psnrV) / 8;
@@ -1331,6 +1292,30 @@
         else
             fputs(", 1", m_csvfpt);
         fprintf(m_csvfpt, ", %d", curEncoder->m_countRowBlocks);
+
+        if (m_param->logLevel >= X265_LOG_DEBUG)
+        {
+            if (m_param->decodedPictureHashSEI && m_param->logLevel >= X265_LOG_FULL)
+            {
+                const char* digestStr = NULL;
+                if (m_param->decodedPictureHashSEI == 1)
+                {
+                    digestStr = digestToString(curEncoder->m_seiReconPictureDigest.m_digest, 16);
+                    fprintf(m_csvfpt, ", %s", digestStr);
+                }
+                else if (m_param->decodedPictureHashSEI == 2)
+                {
+                    digestStr = digestToString(curEncoder->m_seiReconPictureDigest.m_digest, 2);
+                    fprintf(m_csvfpt, ", %s", digestStr);
+                }
+                else if (m_param->decodedPictureHashSEI == 3)
+                {
+                    digestStr = digestToString(curEncoder->m_seiReconPictureDigest.m_digest, 4);
+                    fprintf(m_csvfpt, ", %s", digestStr);
+                }
+            }
+        }
+
         fprintf(m_csvfpt, "\n");
         fflush(stderr);
     }


More information about the x265-devel mailing list