[x265] [PATCH] bug fix: print Mean psnr Y,U,V properly

santhoshini at multicorewareinc.com santhoshini at multicorewareinc.com
Thu Nov 21 04:19:59 CET 2013


# HG changeset patch
# User Santhoshini Sekar <santhoshini at multicorewareinc.com>
# Date 1385003814 -19800
#      Thu Nov 21 08:46:54 2013 +0530
# Node ID 10c2351cdb9b39c45fb040f90eaf448129532ad5
# Parent  2dec17a0b506c99a1ee8ecb23a582cb308de7724
bug fix: print Mean psnr Y,U,V properly

diff -r 2dec17a0b506 -r 10c2351cdb9b source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Wed Nov 20 16:06:38 2013 +0530
+++ b/source/encoder/encoder.cpp	Thu Nov 21 08:46:54 2013 +0530
@@ -336,18 +336,18 @@
 {
     double fps = (double)param.frameRate;
     double scale = fps / 1000 / (double)stat.m_numPics;
-    sprintf(buffer, "%-6d ", stat.m_numPics);
-    sprintf(buffer + strlen(buffer), "kb/s: %-8.2lf", stat.m_accBits * scale);
+    int len = sprintf(buffer, "%-6d ", stat.m_numPics);
+    len += sprintf(buffer + len, "kb/s: %-8.2lf", stat.m_accBits * scale);
     if (param.bEnablePsnr)
     {
-        sprintf(buffer + strlen(buffer), " PSNR Mean: Y:%.3lf U:%.3lf V:%.3lf",
+        len += sprintf(buffer + len, " PSNR Mean: Y:%.3lf U:%.3lf V:%.3lf",
                       stat.m_psnrSumY / (double)stat.m_numPics,
                       stat.m_psnrSumU / (double)stat.m_numPics,
                       stat.m_psnrSumV / (double)stat.m_numPics);
     }
     if (param.bEnableSsim)
     {
-        sprintf(buffer + strlen(buffer), " SSIM Mean: %.3lf",
+        len += sprintf(buffer + len, " SSIM Mean: %.3lf",
                 stat.m_globalSsim / (double)stat.m_numPics);
     }
     return buffer;


More information about the x265-devel mailing list