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

santhoshini at multicorewareinc.com santhoshini at multicorewareinc.com
Wed Nov 20 11:39:48 CET 2013


# HG changeset patch
# User Santhoshini Sekar <santhoshini at multicorewareinc.com>
# Date 1384943798 -19800
#      Wed Nov 20 16:06:38 2013 +0530
# Node ID 2dec17a0b506c99a1ee8ecb23a582cb308de7724
# Parent  108ddc9e5c6b15e758ccbf08a0e923cbb7b28b5e
bug fix: print Mean psnr Y,U,V properly

diff -r 108ddc9e5c6b -r 2dec17a0b506 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Tue Nov 19 23:45:52 2013 -0600
+++ b/source/encoder/encoder.cpp	Wed Nov 20 16:06:38 2013 +0530
@@ -336,20 +336,18 @@
 {
     double fps = (double)param.frameRate;
     double scale = fps / 1000 / (double)stat.m_numPics;
-    int len = sprintf(buffer, "%-6d ", stat.m_numPics);
-
-    sprintf(buffer + len, "kb/s: %-8.2lf", stat.m_accBits * scale);
-
+    sprintf(buffer, "%-6d ", stat.m_numPics);
+    sprintf(buffer + strlen(buffer), "kb/s: %-8.2lf", stat.m_accBits * scale);
     if (param.bEnablePsnr)
     {
-        len = sprintf(buffer + len, " PSNR Mean: Y:%.3lf U:%.3lf V:%.3lf",
+        sprintf(buffer + strlen(buffer), " 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 + len, " SSIM Mean: %.3lf",
+        sprintf(buffer + strlen(buffer), " SSIM Mean: %.3lf",
                 stat.m_globalSsim / (double)stat.m_numPics);
     }
     return buffer;


More information about the x265-devel mailing list