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

Jan Ekström jeebjp at gmail.com
Tue Apr 12 23:43:13 EEST 2022


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 --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;
-- 
2.35.1



More information about the ffmpeg-devel mailing list