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

Aruna Matheswaran aruna at multicorewareinc.com
Thu Feb 9 06:40:51 CET 2017


On Thu, Feb 2, 2017 at 1:48 PM, Jean Cruypenynck <filaton at me.com> wrote:

> Hello,
>
> Thank you for your answer!
> You mention that “the strict-cbr option today works only for CBR encodes
> that use the --bitrate option”.
> However, when I use "--bitrate <somevalue> --strict-cbr”, I get the error
> "Strict-cbr cannot be applied without specifying target bitrate or vbv
> bufsize”.
>
> From your comment, I understand that this is not the intended behaviour?
> Or should “bitrate” *and* “vbv-bufsize” be specified for “strict-cbr” to
> work?
>
Both "bitrate" and "vbv-bufsize" have to be specified for "strict-cbr" to
work.


>
> Many thanks,
> Jean.
>
> *Steps to reproduce:*
>
>    - *git clone https://github.com/videolan/x265.git
>    <https://github.com/videolan/x265.git>*
>    - build the CLI target for your platform
>    - *ffmpeg -i <input.avi> -f yuv4mpegpipe -pix_fmt yuv420p - | x265
>    --y4m --bitrate 1000 --strict-cbr -o encoded.265 -*
>
>
> On 1 Feb 2017, 12:16 +0100, Pradeep Ramachandran <
> pradeep at multicorewareinc.com>, wrote:
>
> 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
>>
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
>
> _______________________________________________
> 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/20170209/76a37254/attachment-0001.html>


More information about the x265-devel mailing list