diff mbox

[FFmpeg-devel,v2] librav1e: Don't make users explicitly set -qp -1 to use bit rate mode

Message ID 20191113152922.9143-1-derek.buitenhuis@gmail.com
State New
Headers show

Commit Message

Derek Buitenhuis Nov. 13, 2019, 3:29 p.m. UTC
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
---
 libavcodec/librav1e.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Almer Nov. 13, 2019, 5:17 p.m. UTC | #1
On 11/13/2019 12:29 PM, Derek Buitenhuis wrote:
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
> ---
>  libavcodec/librav1e.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/librav1e.c b/libavcodec/librav1e.c
> index 5052cac896..a5835ee6be 100644
> --- a/libavcodec/librav1e.c
> +++ b/libavcodec/librav1e.c
> @@ -533,7 +533,7 @@ retry:
>  #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
>  
>  static const AVOption options[] = {
> -    { "qp", "use constant quantizer mode", OFFSET(quantizer), AV_OPT_TYPE_INT, { .i64 = 100 }, -1, 255, VE },
> +    { "qp", "use constant quantizer mode (defaults to 100 if no bit rate is set)", OFFSET(quantizer), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE },
>      { "speed", "what speed preset to use", OFFSET(speed), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 10, VE },
>      { "tiles", "number of tiles encode with", OFFSET(tiles), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE },
>      { "tile-rows", "number of tiles rows to encode with", OFFSET(tile_rows), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE },

LGTM
James Almer Nov. 13, 2019, 5:21 p.m. UTC | #2
On 11/13/2019 2:17 PM, James Almer wrote:
> On 11/13/2019 12:29 PM, Derek Buitenhuis wrote:
>> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
>> ---
>>  libavcodec/librav1e.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/librav1e.c b/libavcodec/librav1e.c
>> index 5052cac896..a5835ee6be 100644
>> --- a/libavcodec/librav1e.c
>> +++ b/libavcodec/librav1e.c
>> @@ -533,7 +533,7 @@ retry:
>>  #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
>>  
>>  static const AVOption options[] = {
>> -    { "qp", "use constant quantizer mode", OFFSET(quantizer), AV_OPT_TYPE_INT, { .i64 = 100 }, -1, 255, VE },
>> +    { "qp", "use constant quantizer mode (defaults to 100 if no bit rate is set)", OFFSET(quantizer), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE },
>>      { "speed", "what speed preset to use", OFFSET(speed), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 10, VE },
>>      { "tiles", "number of tiles encode with", OFFSET(tiles), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE },
>>      { "tile-rows", "number of tiles rows to encode with", OFFSET(tile_rows), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE },
> 
> LGTM

Actually, remove the comment about what it defaults to. That's out of
our control and may very well change in a future version of librav1e.
libx264 doesn't say anything like that, it just sets qp and crf to -1
and bitrate to 0, and lets the library do its thing, as as we're doing
here after this patch.
Derek Buitenhuis Nov. 13, 2019, 5:55 p.m. UTC | #3
On 13/11/2019 17:21, James Almer wrote:
> Actually, remove the comment about what it defaults to. That's out of
> our control and may very well change in a future version of librav1e.
> libx264 doesn't say anything like that, it just sets qp and crf to -1
> and bitrate to 0, and lets the library do its thing, as as we're doing
> here after this patch.

Removed locally.

- Derek
diff mbox

Patch

diff --git a/libavcodec/librav1e.c b/libavcodec/librav1e.c
index 5052cac896..a5835ee6be 100644
--- a/libavcodec/librav1e.c
+++ b/libavcodec/librav1e.c
@@ -533,7 +533,7 @@  retry:
 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 
 static const AVOption options[] = {
-    { "qp", "use constant quantizer mode", OFFSET(quantizer), AV_OPT_TYPE_INT, { .i64 = 100 }, -1, 255, VE },
+    { "qp", "use constant quantizer mode (defaults to 100 if no bit rate is set)", OFFSET(quantizer), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE },
     { "speed", "what speed preset to use", OFFSET(speed), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 10, VE },
     { "tiles", "number of tiles encode with", OFFSET(tiles), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE },
     { "tile-rows", "number of tiles rows to encode with", OFFSET(tile_rows), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE },