<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 16, 2014 at 9:37 AM, Steve Borho <span dir="ltr"><<a href="mailto:steve@borho.org" target="_blank">steve@borho.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Sun, Jun 15, 2014 at 1:50 PM,  <<a href="mailto:aarthi@multicorewareinc.com">aarthi@multicorewareinc.com</a>> wrote:<br>

> # 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>
<br>
</div>default filenames are a no-no<br>
<div class=""><br>
> +    param->rc.pszStatOut = "x264_2pass.log";<br>
<br>
</div>oops<br>
<div class=""><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>
> +}<br>
<br>
</div>white-space<br>
<div class=""><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>
</div>is clearing lookaheadDepth enough?  I imagine scene-cuts must also be disabled</blockquote><div>sliceTypeAnalyse won't run if statRead is on, it picks up the slice type decisions from the output stat file from previous pass. so, i guess, it wouldn't matter much. </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
><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>
>      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>
<br>
</div></div>I should have mentioned this in the first patch, but new public APIs<br>
need to be added to the DLL exports file; and additions to x265_param<br>
require a bump to X265_BUILD<br>
<div class=""><br>
<br>
>      InputFileInfo info;<br>
>      info.filename = inputfn;<br>
>      info.depth = inputBitDepth;<br>
</div>> _______________________________________________<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>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Steve Borho<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>
</font></span></blockquote></div><br></div></div>