<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 2, 2017 at 10:58 PM, <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<br>
# Date 1495595385 -19800<br>
# Wed May 24 08:39:45 2017 +0530<br>
# Node ID 404253434d33e99955aac29480ee16<wbr>b8e939a64c<br>
# Parent f850cdbe381c196758fd445a367487<wbr>416fef62f9<br>
cli: add option to specify scale-factor<br></blockquote><div><br></div><div>Pushed full set to default branch</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff -r f850cdbe381c -r 404253434d33 doc/reST/cli.rst<br>
--- a/doc/reST/cli.rst Tue May 23 12:42:54 2017 +0530<br>
+++ b/doc/reST/cli.rst Wed May 24 08:39:45 2017 +0530<br>
@@ -855,6 +855,11 @@<br>
+--------+--------------------<wbr>---------------------+<br>
| 10 | Level 5 + Full CU analysis-info |<br>
+--------+--------------------<wbr>---------------------+<br>
+.. option:: --scale-factor<br>
+<br>
+ Factor by which input video is scaled down for analysis save mode.<br>
+ This option should be coupled with analysis-mode option, --refine-level 10.<br>
+ The ctu size of load should be double the size of save. Default 0.<br>
<br>
Options which affect the transform unit quad-tree, sometimes referred to<br>
as the residual quad-tree (RQT).<br>
diff -r f850cdbe381c -r 404253434d33 source/CMakeLists.txt<br>
--- a/source/CMakeLists.txt Tue May 23 12:42:54 2017 +0530<br>
+++ b/source/CMakeLists.txt Wed May 24 08:39:45 2017 +0530<br>
@@ -29,7 +29,7 @@<br>
option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)<br>
mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)<br>
# X265_BUILD must be incremented each time the public API is changed<br>
-set(X265_BUILD 118)<br>
+set(X265_BUILD 119)<br>
configure_file("${PROJECT_<wbr>SOURCE_DIR}/<a href="http://x265.def.in" rel="noreferrer" target="_blank">x265.def.in</a>"<br>
"${PROJECT_BINARY_DIR}/x265.<wbr>def")<br>
configure_file("${PROJECT_<wbr>SOURCE_DIR}/<a href="http://x265_config.h.in" rel="noreferrer" target="_blank">x265_config.h.in</a>"<br>
diff -r f850cdbe381c -r 404253434d33 source/common/param.cpp<br>
--- a/source/common/param.cpp Tue May 23 12:42:54 2017 +0530<br>
+++ b/source/common/param.cpp Wed May 24 08:39:45 2017 +0530<br>
@@ -277,6 +277,7 @@<br>
param->bDhdr10opt = 0;<br>
param->bCTUInfo = 0;<br>
param->bUseRcStats = 0;<br>
+ param->scaleFactor = 0;<br>
}<br>
<br>
int x265_param_default_preset(<wbr>x265_param* param, const char* preset, const char* tune)<br>
@@ -957,6 +958,7 @@<br>
OPT("dhdr10-info") p->toneMapFile = strdup(value);<br>
OPT("dhdr10-opt") p->bDhdr10opt = atobool(value);<br>
OPT("ctu-info") p->bCTUInfo = atoi(value);<br>
+ OPT("scale-factor") p->scaleFactor = atoi(value);<br>
else<br>
return X265_PARAM_BAD_NAME;<br>
}<br>
@@ -1291,6 +1293,7 @@<br>
"Invalid analysis mode. Analysis mode 0: OFF 1: SAVE : 2 LOAD");<br>
CHECK(param->analysisMode && (param->analysisRefineLevel < 1 || param->analysisRefineLevel > 10),<br>
"Invalid analysis refine level. Value must be between 1 and 10 (inclusive)");<br>
+ CHECK(param->scaleFactor > 2, "Invalid scale-factor. Supports factor <= 2");<br>
CHECK(param->rc.qpMax < QP_MIN || param->rc.qpMax > QP_MAX_MAX,<br>
"qpmax exceeds supported range (0 to 69)");<br>
CHECK(param->rc.qpMin < QP_MIN || param->rc.qpMin > QP_MAX_MAX,<br>
@@ -1675,6 +1678,7 @@<br>
BOOL(p->bHDROpt, "hdr-opt");<br>
BOOL(p->bDhdr10opt, "dhdr10-opt");<br>
s += sprintf(s, " refine-level=%d", p->analysisRefineLevel);<br>
+ s += sprintf(s, " scale-factor=%d", p->scaleFactor);<br>
BOOL(p->bLimitSAO, "limit-sao");<br>
s += sprintf(s, " ctu-info=%d", p->bCTUInfo);<br>
#undef BOOL<br>
diff -r f850cdbe381c -r 404253434d33 source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Tue May 23 12:42:54 2017 +0530<br>
+++ b/source/encoder/encoder.cpp Wed May 24 08:39:45 2017 +0530<br>
@@ -2273,6 +2273,18 @@<br>
"Disabling Analysis load/save and multi-pass-opt-analysis/multi-<wbr>pass-opt-distortion\n");<br>
p->analysisMode = p->analysisMultiPassRefine = p->analysisMultiPassDistortion = 0;<br>
}<br>
+ if (p->scaleFactor)<br>
+ {<br>
+ if (p->scaleFactor == 1)<br>
+ {<br>
+ p->scaleFactor = 0;<br>
+ }<br>
+ else if (!p->analysisMode || p->analysisRefineLevel < 10)<br>
+ {<br>
+ x265_log(p, X265_LOG_WARNING, "Input scaling works with analysis-mode, refine-level 10. Disabling scale-factor.\n");<br>
+ p->scaleFactor = 0;<br>
+ }<br>
+ }<br>
<br>
if ((p->analysisMultiPassRefine || p-><wbr>analysisMultiPassDistortion) && (p->bDistributeModeAnalysis || p-><wbr>bDistributeMotionEstimation))<br>
{<br>
diff -r f850cdbe381c -r 404253434d33 source/x265.h<br>
--- a/source/x265.h Tue May 23 12:42:54 2017 +0530<br>
+++ b/source/x265.h Wed May 24 08:39:45 2017 +0530<br>
@@ -1438,6 +1438,9 @@<br>
<br>
/* Use ratecontrol statistics from pic_in, if available*/<br>
int bUseRcStats;<br>
+<br>
+ /* Factor by which input video is scaled down for analysis save mode. Default is 0 */<br>
+ int scaleFactor;<br>
} x265_param;<br>
/* x265_param_alloc:<br>
* Allocates an x265_param instance. The returned param structure is not<br>
diff -r f850cdbe381c -r 404253434d33 source/x265cli.h<br>
--- a/source/x265cli.h Tue May 23 12:42:54 2017 +0530<br>
+++ b/source/x265cli.h Wed May 24 08:39:45 2017 +0530<br>
@@ -251,6 +251,7 @@<br>
{ "analysis-mode", required_argument, NULL, 0 },<br>
{ "analysis-file", required_argument, NULL, 0 },<br>
{ "refine-level", required_argument, NULL, 0 },<br>
+ { "scale-factor", required_argument, NULL, 0 },<br>
{ "strict-cbr", no_argument, NULL, 0 },<br>
{ "temporal-layers", no_argument, NULL, 0 },<br>
{ "no-temporal-layers", no_argument, NULL, 0 },<br>
@@ -440,6 +441,7 @@<br>
H0(" --analysis-mode <string|int> save - Dump analysis info into file, load - Load analysis buffers from the file. Default %d\n", param->analysisMode);<br>
H0(" --analysis-file <filename> Specify file name used for either dumping or reading analysis data.\n");<br>
H0(" --refine-level <1..10> Level of analysis refinement indicates amount of info stored/reused in save/load mode, 1:least....10:most. Default %d\n", param->analysisRefineLevel);<br>
+ H0(" --scale-factor <int> Specify factor by which input video is scaled down for analysis save mode. Default %d\n", param->scaleFactor);<br>
H0(" --aq-mode <integer> Mode for Adaptive Quantization - 0:none 1:uniform AQ 2:auto variance 3:auto variance with bias to dark scenes. Default %d\n", param->rc.aqMode);<br>
H0(" --aq-strength <float> Reduces blocking and blurring in flat and textured areas (0 to 3.0). Default %.2f\n", param->rc.aqStrength);<br>
H0(" --[no-]aq-motion Adaptive Quantization based on the relative motion of each CU w.r.t., frame. Default %s\n", OPT(param->bOptCUDeltaQP));<br>
______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>