<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 2, 2017 at 11:33 PM, <span dir="ltr"><<a href="mailto:bhavna@multicorewareinc.com" target="_blank">bhavna@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 Bhavna Hariharan <<a href="mailto:bhavna@multicorewareinc.com">bhavna@multicorewareinc.com</a>><br>
# Date 1496236943 -19800<br>
# Wed May 31 18:52:23 2017 +0530<br>
# Node ID d103464b81751a917ec20a02c412f9<wbr>2d0846692a<br>
# Parent d0884f53441b5e567dd8938ca78217<wbr>bc43b2d799<br>
cli: add support for inter and intra refinement in analysis load<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 d0884f53441b -r d103464b8175 doc/reST/cli.rst<br>
--- a/doc/reST/cli.rst Fri Apr 07 13:53:42 2017 +0530<br>
+++ b/doc/reST/cli.rst Wed May 31 18:52:23 2017 +0530<br>
@@ -862,6 +862,18 @@<br>
This option should be coupled with analysis-mode option, --refine-level 10.<br>
Default 0.<br>
<br>
+.. option:: --refine-intra<br>
+<br>
+ Enables refinement of intra blocks in current encode. Evaluates all<br>
+ intra modes for blocks of size one smaller than the min-cu-size of the<br>
+ incoming analysis data from the previous encode. Default disabled.<br>
+<br>
+.. option:: --refine-inter-depth<br>
+<br>
+ Enables refinement of inter blocks in current encode. Evaluates all<br>
+ inter modes for blocks of size one smaller than the min-cu-size of the<br>
+ incoming analysis data from the previous encode. Default disabled.<br>
+<br>
Options which affect the transform unit quad-tree, sometimes referred to<br>
as the residual quad-tree (RQT).<br>
<br>
diff -r d0884f53441b -r d103464b8175 source/CMakeLists.txt<br>
--- a/source/CMakeLists.txt Fri Apr 07 13:53:42 2017 +0530<br>
+++ b/source/CMakeLists.txt Wed May 31 18:52:23 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 119)<br>
+set(X265_BUILD 120)<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 d0884f53441b -r d103464b8175 source/common/param.cpp<br>
--- a/source/common/param.cpp Fri Apr 07 13:53:42 2017 +0530<br>
+++ b/source/common/param.cpp Wed May 31 18:52:23 2017 +0530<br>
@@ -278,6 +278,8 @@<br>
param->bCTUInfo = 0;<br>
param->bUseRcStats = 0;<br>
param->scaleFactor = 0;<br>
+ param->intraRefine = 0;<br>
+ param->interRefine = 0;<br>
}<br>
<br>
int x265_param_default_preset(<wbr>x265_param* param, const char* preset, const char* tune)<br>
@@ -959,6 +961,8 @@<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>
+ OPT("refine-intra")p-><wbr>intraRefine = atobool(value);<br>
+ OPT("refine-inter")p-><wbr>interRefine = atobool(value);<br>
else<br>
return X265_PARAM_BAD_NAME;<br>
}<br>
@@ -1678,7 +1682,9 @@<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>
+ s += sprintf(s, " scale-factor=%d", p->scaleFactor);<br>
+ s += sprintf(s, " refine-intra=%d", p->intraRefine);<br>
+ s += sprintf(s, " refine-inter=%d", p->interRefine);<br>
BOOL(p->bLimitSAO, "limit-sao");<br>
s += sprintf(s, " ctu-info=%d", p->bCTUInfo);<br>
#undef BOOL<br>
diff -r d0884f53441b -r d103464b8175 source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Fri Apr 07 13:53:42 2017 +0530<br>
+++ b/source/encoder/encoder.cpp Wed May 31 18:52:23 2017 +0530<br>
@@ -2287,6 +2287,30 @@<br>
}<br>
}<br>
<br>
+ if (p->intraRefine)<br>
+ {<br>
+ if (p->analysisMode!= X265_ANALYSIS_LOAD || p->analysisRefineLevel < 10 || !p->scaleFactor)<br>
+ {<br>
+ x265_log(p, X265_LOG_WARNING, "Intra refinement requires analysis load, refine-level 10, scale factor. Disabling intra refine.\n");<br>
+ p->intraRefine = 0;<br>
+ }<br>
+ }<br>
+<br>
+ if (p->interRefine)<br>
+ {<br>
+ if (p->analysisMode != X265_ANALYSIS_LOAD || p->analysisRefineLevel < 10 || !p->scaleFactor)<br>
+ {<br>
+ x265_log(p, X265_LOG_WARNING, "Inter refinement requires analysis load, refine-level 10, scale factor. Disabling inter refine.\n");<br>
+ p->interRefine = 0;<br>
+ }<br>
+ }<br>
+<br>
+ if (p->limitTU && p->interRefine)<br>
+ {<br>
+ x265_log(p, X265_LOG_WARNING, "Inter refinement does not support limitTU. Disabling limitTU.\n");<br>
+ p->limitTU = 0;<br>
+ }<br>
+<br>
if ((p->analysisMultiPassRefine || p-><wbr>analysisMultiPassDistortion) && (p->bDistributeModeAnalysis || p-><wbr>bDistributeMotionEstimation))<br>
{<br>
x265_log(p, X265_LOG_WARNING, "multi-pass-opt-analysis/<wbr>multi-pass-opt-distortion incompatible with pmode/pme, Disabling pmode/pme\n");<br>
diff -r d0884f53441b -r d103464b8175 source/x265.h<br>
--- a/source/x265.h Fri Apr 07 13:53:42 2017 +0530<br>
+++ b/source/x265.h Wed May 31 18:52:23 2017 +0530<br>
@@ -1441,7 +1441,15 @@<br>
<br>
/* Factor by which input video is scaled down for analysis save mode. Default is 0 */<br>
int scaleFactor;<br>
+<br>
+ /* Enable intra refinement in load mode*/<br>
+ int intraRefine;<br>
+<br>
+ /* Enable inter refinement in load mode*/<br>
+ int interRefine;<br>
+<br>
} x265_param;<br>
+<br>
/* x265_param_alloc:<br>
* Allocates an x265_param instance. The returned param structure is not<br>
* special in any way, but using this method together with x265_param_free()<br>
diff -r d0884f53441b -r d103464b8175 source/x265cli.h<br>
--- a/source/x265cli.h Fri Apr 07 13:53:42 2017 +0530<br>
+++ b/source/x265cli.h Wed May 31 18:52:23 2017 +0530<br>
@@ -252,6 +252,10 @@<br>
{ "analysis-file", required_argument, NULL, 0 },<br>
{ "refine-level", required_argument, NULL, 0 },<br>
{ "scale-factor", required_argument, NULL, 0 },<br>
+ { "refine-intra", no_argument, NULL, 0 },<br>
+ { "no-refine-intra",no_argument, NULL, 0 },<br>
+ { "refine-inter", no_argument, NULL, 0 },<br>
+ { "no-refine-inter",no_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>
@@ -442,6 +446,8 @@<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(" --[no-]refine-intra Enable intra refinement for load mode. Default %s\n", OPT(param->intraRefine));<br>
+ H0(" --[no-]refine-inter Enable inter refinement for load mode. Default %s\n", OPT(param->interRefine));<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>