On Mon, Jun 16, 2014 at 12:20 AM, <aar...@multicorewareinc.com> wrote:
> # HG changeset patch > # User Aarthi Thirumalai<aar...@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"; > + param->rc.pszStatOut = "x264_2pass.log"; > + 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; > + } > / Hmm, making 2-pass work correctly is priority. We can focus on these turbo first-pass enhancements later? This could affect bitrate predictions. > +} > + > > 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; > > 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"); > + > And CQP also? > 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); > InputFileInfo info; > info.filename = inputfn; > info.depth = inputBitDepth; > _______________________________________________ > x265-devel mailing list > x265-devel@videolan.org > https://mailman.videolan.org/listinfo/x265-devel >
_______________________________________________ x265-devel mailing list x265-devel@videolan.org https://mailman.videolan.org/listinfo/x265-devel