[x265] [PATCH] CLI: Fix wrong condition for "--strict-cbr" option

Pradeep Ramachandran pradeep at multicorewareinc.com
Wed Feb 1 12:15:42 CET 2017


On Tue, Jan 31, 2017 at 5:10 PM, Jean CRUYPENYNCK <filaton at me.com> wrote:

> # HG changeset patch
> # User Jean Cruypenynck <filaton at me.com>
> # Date 1485860877 -3600
> #      Tue Jan 31 12:07:57 2017 +0100
> # Node ID 93d09ad23a514172f0d143b0a194c607963db57b
> # Parent  fa52b516f5ff122c4486ed840c5bf1de3c06e974
> [CLI] Fix wrong condition for "--strict-cbr" option
>
> Checking for "--strict-cbr" should succeed if either "--bitrate" or
> "--vbv-bufsize" is specified.
>
> It means that an error should be thrown if:
>     param-rc->bStrictCbr && NOT (param->rc.bitrate > 0 ||
> param->rc.vbvBufferSize > 0)
> evaluates to true.
>
> According to De Morgan's laws, it is equivalent to:
>     param-rc->bStrictCbr && (NOT param->rc.bitrate > 0 && NOT
> param->rc.vbvBufferSize > 0)
> which is in turn equivalent to:
>     param-rc->bStrictCbr && (param->rc.bitrate <= 0 &&
> param->rc.vbvBufferSize <= 0)
>
> Currently, one must set both "--bitrate" AND "--vbv-bufsize" to use
> "--strict-cbr".
>

The strict-cbr option today works only for CBR encodes that use the
--bitrate option. If you want to enable CBR via CRF + VBV, this option
doesn't work.
Maybe the check error message is confusing in its construction and
therefore leads to misunderstandings.


> diff -r fa52b516f5ff -r 93d09ad23a51 source/common/param.cpp
> --- a/source/common/param.cpp   Mon Jan 30 10:35:00 2017 +0530
> +++ b/source/common/param.cpp   Tue Jan 31 12:07:57 2017 +0100
> @@ -1269,7 +1269,7 @@
>          CHECK(0 > param->noiseReductionInter ||
> param->noiseReductionInter > 2000, "Valid noise reduction range 0 - 2000");
>      CHECK(param->rc.rateControlMode == X265_RC_CQP &&
> param->rc.bStatRead,
>            "Constant QP is incompatible with 2pass");
> -    CHECK(param->rc.bStrictCbr && (param->rc.bitrate <= 0 ||
> param->rc.vbvBufferSize <=0),
> +    CHECK(param->rc.bStrictCbr && (param->rc.bitrate <= 0 &&
> param->rc.vbvBufferSize <=0),
>            "Strict-cbr cannot be applied without specifying target bitrate
> or vbv bufsize");
>      CHECK(param->analysisMode && (param->analysisMode < X265_ANALYSIS_OFF
> || param->analysisMode > X265_ANALYSIS_LOAD),
>          "Invalid analysis mode. Analysis mode 0: OFF 1: SAVE : 2 LOAD");
> _______________________________________________
> 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/20170201/d59f33a8/attachment.html>


More information about the x265-devel mailing list