[x265] [PATCH 1 of 4] rc: log warnings if rfConstantMin is greater than rcConstant

Steve Borho steve at borho.org
Thu May 8 20:52:10 CEST 2014


On Thu, May 8, 2014 at 1:28 PM,  <aarthi at multicorewareinc.com> wrote:
> # HG changeset patch
> # User Aarthi Thirumalai
> # Date 1399572839 -19800
> #      Thu May 08 23:43:59 2014 +0530
> # Node ID 06c641032ed727f7160c3c6e412576b2f8935a19
> # Parent  8e64aa56d6352a1a8cfb6fb57cb547607bcec9b1
> rc: log warnings if rfConstantMin is greater than rcConstant.
>
> diff -r 8e64aa56d635 -r 06c641032ed7 source/encoder/ratecontrol.cpp
> --- a/source/encoder/ratecontrol.cpp    Thu May 08 11:01:04 2014 +0530
> +++ b/source/encoder/ratecontrol.cpp    Thu May 08 23:43:59 2014 +0530
> @@ -218,6 +218,7 @@
>          double mbtree_offset = param->rc.cuTree ? (1.0 - param->rc.qCompress) * 13.5 : 0;
>          rateFactorConstant = pow(baseCplx, 1 - qCompress) /
>              x265_qp2qScale(param->rc.rfConstant + mbtree_offset);
> +
>          if (param->rc.rfConstantMax)
>          {
>              rateFactorMaxIncrement = param->rc.rfConstantMax - param->rc.rfConstant;
> @@ -228,7 +229,14 @@
>              }
>          }
>          if (param->rc.rfConstantMin)
> +        {
>              rateFactorMaxDecrement = param->rc.rfConstant - param->rc.rfConstantMin;
> +            if (rateFactorMaxDecrement <= 0)
> +            {
> +                x265_log(param, X265_LOG_WARNING, "CRF min must be lesser than CRF\n");
> +                rateFactorMaxDecrement = 0;
> +            }
> +        }

these params are fixed user inputs, so validation should be done in
param.cpp.  Gopu moved the crf-min validations there at my request.  I
just notice crf-max above is validated here; it should also be moved
to param.cpp

>      }
>
>      isAbr = param->rc.rateControlMode != X265_RC_CQP; // later add 2pass option
> @@ -304,7 +312,7 @@
>              param->rc.vbvBufferInit = Clip3(0.0, 1.0, param->rc.vbvBufferInit / param->rc.vbvBufferSize);
>          param->rc.vbvBufferInit = Clip3(0.0, 1.0, X265_MAX(param->rc.vbvBufferInit, bufferRate / bufferSize));
>          bufferFillFinal = bufferSize * param->rc.vbvBufferInit;
> -        vbvMinRate = /*!rc->b_2pass && */ param->rc.rateControlMode == X265_RC_ABR
> +        vbvMinRate = param->rc.rateControlMode == X265_RC_ABR

this should be a separate nit patch

>              && param->rc.vbvMaxBitrate <= param->rc.bitrate;
>      }
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel



-- 
Steve Borho


More information about the x265-devel mailing list