[x265] [PATCH 2 of 6] rc: define default setting and validations for 2 pass states

Aarthi Priya Thirumalai aarthi at multicorewareinc.com
Mon Jun 16 10:09:22 CEST 2014


On Mon, Jun 16, 2014 at 9:37 AM, Steve Borho <steve at borho.org> wrote:

> On Sun, Jun 15, 2014 at 1:50 PM,  <aarthi at multicorewareinc.com> wrote:
> > # HG changeset patch
> > # User Aarthi Thirumalai<aarthi at multicorewareinc.com>
> > # Date 1402857077 -19800
> > #      Mon Jun 16 00:01:17 2014 +0530
> > # Node ID d1f636a6dc0a11657bb25be650de60345c2952c8
> > # Parent  438a03ff94830fbc17457b6f324397e643c17cba
> > rc: define default setting and validations for 2 pass states
> >
> > diff -r 438a03ff9483 -r d1f636a6dc0a source/common/param.cpp
> > --- a/source/common/param.cpp   Sun Jun 15 23:59:14 2014 +0530
> > +++ b/source/common/param.cpp   Mon Jun 16 00:01:17 2014 +0530
> > @@ -180,7 +180,12 @@
> >      param->rc.cuTree = 1;
> >      param->rc.rfConstantMax = 0;
> >      param->rc.rfConstantMin = 0;
> > -
> > +    param->rc.pszStatIn = "x265_2pass.log";
>
> default filenames are a no-no
>
> > +    param->rc.pszStatOut = "x264_2pass.log";
>
> oops
>
> > +    param->rc.complexityBlur = 20;
> > +    param->rc.qblur = 0.5;
> > +    param->rc.statRead = false;
> > +    param->rc.statWrite = false;
> >      /* Quality Measurement Metrics */
> >      param->bEnablePsnr = 0;
> >      param->bEnableSsim = 0;
> > @@ -414,6 +419,18 @@
> >
> >      return 0;
> >  }
> > +extern "C"
> > +void x265_param_apply_fastfirstpass(x265_param *param)
> > +{
> > +    /* Set faster options in case of turbo firstpass. */
> > +    if( param->rc.statWrite && !param->rc.statRead )
> > +    {
> > +        param->maxNumReferences = 1;
> > +        param->searchMethod = X265_DIA_SEARCH;
> > +        param->bEnableEarlySkip = 1;
> > +    }
> > +}
>
> white-space
>
> > +
> >
> >  static int x265_atobool(const char *str, bool& bError)
> >  {
> > @@ -911,6 +928,8 @@
> >          if (s)
> >              x265_log(param, X265_LOG_WARNING, "--tune %s should be used
> if attempting to benchmark %s!\n", s, s);
> >      }
> > +    if (param->bOpenGOP && param->rc.statRead)
> > +        param->lookaheadDepth = 0;
>
> is clearing lookaheadDepth enough?  I imagine scene-cuts must also be
> disabled

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.

> >
> >      CHECK(param->rc.qp < -6 * (param->internalBitDepth - 8) ||
> param->rc.qp > 51,
> >            "QP exceeds supported range (-QpBDOffsety to 51)");
> > @@ -966,7 +985,7 @@
> >            "Rate control mode is out of range");
> >      CHECK(param->rdLevel < 0 || param->rdLevel > 6,
> >            "RD Level is out of range");
> > -    CHECK(param->bframes > param->lookaheadDepth,
> > +    CHECK(param->bframes > param->lookaheadDepth && !param->rc.statRead,
> >            "Lookahead depth must be greater than the max consecutive
> bframe count");
> >      CHECK(param->bframes < 0,
> >            "bframe count should be greater than zero");
> > @@ -1045,6 +1064,9 @@
> >            "Target bitrate can not be less than zero");
> >      if (param->noiseReduction)
> >          CHECK(100 > param->noiseReduction || param->noiseReduction >
> 1000, "Valid noise reduction range 100 - 1000");
> > +    CHECK(param->rc.rateControlMode == X265_RC_CRF &&
> param->rc.statRead,
> > +          "Constant rate-factor is incompatible with 2pass");
> > +
> >      return check_failed;
> >  }
> >
> > diff -r 438a03ff9483 -r d1f636a6dc0a source/x265.cpp
> > --- a/source/x265.cpp   Sun Jun 15 23:59:14 2014 +0530
> > +++ b/source/x265.cpp   Mon Jun 16 00:01:17 2014 +0530
> > @@ -591,6 +591,7 @@
> >      }
> >  #endif // if HIGH_BIT_DEPTH
> >
> > +    x265_param_apply_fastfirstpass(param);
>
> I should have mentioned this in the first patch, but new public APIs
> need to be added to the DLL exports file; and additions to x265_param
> require a bump to X265_BUILD
>
>
> >      InputFileInfo info;
> >      info.filename = inputfn;
> >      info.depth = inputBitDepth;
> > _______________________________________________
> > x265-devel mailing list
> > x265-devel at videolan.org
> > https://mailman.videolan.org/listinfo/x265-devel
>
>
>
> --
> Steve Borho
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20140616/04d3c194/attachment-0001.html>


More information about the x265-devel mailing list