<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 16, 2014 at 12:20 AM, <span dir="ltr"><<a href="mailto:aarthi@multicorewareinc.com" target="_blank">aarthi@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 Aarthi Thirumalai<<a href="mailto:aarthi@multicorewareinc.com">aarthi@multicorewareinc.com</a>><br>
# Date 1402857077 -19800<br>
# Mon Jun 16 00:01:17 2014 +0530<br>
# Node ID d1f636a6dc0a11657bb25be650de60345c2952c8<br>
# Parent 438a03ff94830fbc17457b6f324397e643c17cba<br>
rc: define default setting and validations for 2 pass states<br>
<br>
diff -r 438a03ff9483 -r d1f636a6dc0a source/common/param.cpp<br>
--- a/source/common/param.cpp Sun Jun 15 23:59:14 2014 +0530<br>
+++ b/source/common/param.cpp Mon Jun 16 00:01:17 2014 +0530<br>
@@ -180,7 +180,12 @@<br>
param->rc.cuTree = 1;<br>
param->rc.rfConstantMax = 0;<br>
param->rc.rfConstantMin = 0;<br>
-<br>
+ param->rc.pszStatIn = "x265_2pass.log";<br>
+ param->rc.pszStatOut = "x264_2pass.log";<br>
+ param->rc.complexityBlur = 20;<br>
+ param->rc.qblur = 0.5;<br>
+ param->rc.statRead = false;<br>
+ param->rc.statWrite = false;<br>
/* Quality Measurement Metrics */<br>
param->bEnablePsnr = 0;<br>
param->bEnableSsim = 0;<br>
@@ -414,6 +419,18 @@<br>
<br>
return 0;<br>
}<br>
+extern "C"<br>
+void x265_param_apply_fastfirstpass(x265_param *param)<br>
+{<br>
+ /* Set faster options in case of turbo firstpass. */<br>
+ if( param->rc.statWrite && !param->rc.statRead )<br>
+ {<br>
+ param->maxNumReferences = 1;<br>
+ param->searchMethod = X265_DIA_SEARCH;<br>
+ param->bEnableEarlySkip = 1;<br>
+ }<br></blockquote><div>/<br></div><div>Hmm, making 2-pass work correctly is priority. We can focus on these turbo first-pass enhancements later? This could affect bitrate predictions.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+}<br>
+<br>
<br>
static int x265_atobool(const char *str, bool& bError)<br>
{<br>
@@ -911,6 +928,8 @@<br>
if (s)<br>
x265_log(param, X265_LOG_WARNING, "--tune %s should be used if attempting to benchmark %s!\n", s, s);<br>
}<br>
+ if (param->bOpenGOP && param->rc.statRead)<br>
+ param->lookaheadDepth = 0;<br>
<br>
CHECK(param->rc.qp < -6 * (param->internalBitDepth - 8) || param->rc.qp > 51,<br>
"QP exceeds supported range (-QpBDOffsety to 51)");<br>
@@ -966,7 +985,7 @@<br>
"Rate control mode is out of range");<br>
CHECK(param->rdLevel < 0 || param->rdLevel > 6,<br>
"RD Level is out of range");<br>
- CHECK(param->bframes > param->lookaheadDepth,<br>
+ CHECK(param->bframes > param->lookaheadDepth && !param->rc.statRead,<br>
"Lookahead depth must be greater than the max consecutive bframe count");<br>
CHECK(param->bframes < 0,<br>
"bframe count should be greater than zero");<br>
@@ -1045,6 +1064,9 @@<br>
"Target bitrate can not be less than zero");<br>
if (param->noiseReduction)<br>
CHECK(100 > param->noiseReduction || param->noiseReduction > 1000, "Valid noise reduction range 100 - 1000");<br>
+ CHECK(param->rc.rateControlMode == X265_RC_CRF && param->rc.statRead,<br>
+ "Constant rate-factor is incompatible with 2pass");<br>
+<br></blockquote><div><br>And CQP also? <br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> return check_failed;<br>
}<br>
<br>
diff -r 438a03ff9483 -r d1f636a6dc0a source/x265.cpp<br>
--- a/source/x265.cpp Sun Jun 15 23:59:14 2014 +0530<br>
+++ b/source/x265.cpp Mon Jun 16 00:01:17 2014 +0530<br>
@@ -591,6 +591,7 @@<br>
}<br>
#endif // if HIGH_BIT_DEPTH<br>
<br>
+ x265_param_apply_fastfirstpass(param);<br>
InputFileInfo info;<br>
info.filename = inputfn;<br>
info.depth = inputBitDepth;<br>
_______________________________________________<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" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br></div></div>