diff mbox series

[FFmpeg-devel,v2,2/2] avcodec/libsvtav1: only pass bit rate back to avctx if it'll get used

Message ID 20220412204313.16672-2-jeebjp@gmail.com
State New
Headers show
Series [FFmpeg-devel,v2,1/2] avcodec/libsvtav1: signal CPB properties through side data | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

Jan Ekström April 12, 2022, 8:43 p.m. UTC
SVT-AV1 has bit rate based rate control modes as non-zero. This way
we can filter out the default value for this value - which is nonzero.
---
 libavcodec/libsvtav1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index 9271d3d9fe..dc82d94de8 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -273,7 +273,8 @@  static int config_enc_params(EbSvtAv1EncConfiguration *param,
         param->profile = FF_PROFILE_AV1_HIGH;
     }
 
-    avctx->bit_rate                 = param->target_bit_rate;
+    avctx->bit_rate = param->rate_control_mode > 0 ?
+                      param->target_bit_rate : 0;
 
     cpb_props->buffer_size = param->vbv_bufsize;
     cpb_props->max_bitrate = param->max_bit_rate;