[x265] [PATCH] Fix source width and height in info

Divya Manivannan divya at multicorewareinc.com
Fri Nov 25 09:52:20 CET 2016


# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1480058872 -19800
#      Fri Nov 25 12:57:52 2016 +0530
# Node ID 12f67c53a3f97fcb8cff12542d1716872d89309e
# Parent  df25adaa30f60eaed6e2780b3297f84c423e58df
Fix source width and height in info

diff -r df25adaa30f6 -r 12f67c53a3f9 source/common/param.cpp
--- a/source/common/param.cpp	Wed Nov 23 12:10:04 2016 -0600
+++ b/source/common/param.cpp	Fri Nov 25 12:57:52 2016 +0530
@@ -1428,7 +1428,7 @@
     fflush(stderr);
 }
 
-char *x265_param2string(x265_param* p)
+char *x265_param2string(x265_param* p, int padx, int pady)
 {
     char *buf, *s;
 
@@ -1452,7 +1452,7 @@
     s += sprintf(s, " bitdepth=%d", p->internalBitDepth);
     s += sprintf(s, " input-csp=%d", p->internalCsp);
     s += sprintf(s, " fps=%u/%u", p->fpsNum, p->fpsDenom);
-    s += sprintf(s, " input-res=%dx%d", p->sourceWidth, p->sourceHeight);
+    s += sprintf(s, " input-res=%dx%d", p->sourceWidth - padx, p->sourceHeight - pady);
     s += sprintf(s, " interlace=%d", p->interlaceMode);
     s += sprintf(s, " total-frames=%d", p->totalFrames);
     s += sprintf(s, " level-idc=%d", p->levelIdc);
diff -r df25adaa30f6 -r 12f67c53a3f9 source/common/param.h
--- a/source/common/param.h	Wed Nov 23 12:10:04 2016 -0600
+++ b/source/common/param.h	Fri Nov 25 12:57:52 2016 +0530
@@ -31,7 +31,7 @@
 int   x265_set_globals(x265_param *param);
 void  x265_print_params(x265_param *param);
 void  x265_param_apply_fastfirstpass(x265_param *p);
-char* x265_param2string(x265_param *param);
+char* x265_param2string(x265_param *param, int padx, int pady);
 int   x265_atoi(const char *str, bool& bError);
 double x265_atof(const char *str, bool& bError);
 int   parseCpuName(const char *value, bool& bError);
diff -r df25adaa30f6 -r 12f67c53a3f9 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Wed Nov 23 12:10:04 2016 -0600
+++ b/source/encoder/encoder.cpp	Fri Nov 25 12:57:52 2016 +0530
@@ -1561,7 +1561,7 @@
 
     if (m_param->bEmitInfoSEI)
     {
-        char *opts = x265_param2string(m_param);
+        char *opts = x265_param2string(m_param, m_sps.conformanceWindow.rightOffset, m_sps.conformanceWindow.bottomOffset);
         if (opts)
         {
             char *buffer = X265_MALLOC(char, strlen(opts) + strlen(PFX(version_str)) +
diff -r df25adaa30f6 -r 12f67c53a3f9 source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp	Wed Nov 23 12:10:04 2016 -0600
+++ b/source/encoder/ratecontrol.cpp	Fri Nov 25 12:57:52 2016 +0530
@@ -623,7 +623,7 @@
                 x265_log_file(m_param, X265_LOG_ERROR, "can't open stats file %s.temp\n", fileName);
                 return false;
             }
-            p = x265_param2string(m_param);
+            p = x265_param2string(m_param, sps.conformanceWindow.rightOffset, sps.conformanceWindow.bottomOffset);
             if (p)
                 fprintf(m_statFileOut, "#options: %s\n", p);
             X265_FREE(p);


More information about the x265-devel mailing list