aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Degawa <ccom@randomderp.com>2022-11-20 13:07:36 -0600
committerTimo Rothenpieler <timo@rothenpieler.org>2023-06-06 23:50:18 +0200
commit8fe2fec45321d1b82f98f9725ad9118cefcfa58d (patch)
tree31ec200b3339a279301a2805bc243f6b3cd95f36
parent3344d47a88506aba060b5fd2a214cf7785b11483 (diff)
downloadffmpeg-8fe2fec45321d1b82f98f9725ad9118cefcfa58d.tar.gz
avcodec/libsvtav1: only set max_buf_sz if both bitrate and rc_buf_sz is set
maximum_buffer_size_ms should only be set if both are specified or if the user sets it through -svtav1-params buf-sz=val Signed-off-by: Christopher Degawa <ccom@randomderp.com>
-rw-r--r--libavcodec/libsvtav1.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index 90f7c4236c..d41bed480b 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -179,7 +179,8 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
param->min_qp_allowed = avctx->qmin;
}
param->max_bit_rate = avctx->rc_max_rate;
- param->maximum_buffer_size_ms = avctx->rc_buffer_size * 1000LL / avctx->bit_rate;
+ if (avctx->bit_rate && avctx->rc_buffer_size)
+ param->maximum_buffer_size_ms = avctx->rc_buffer_size * 1000LL / avctx->bit_rate;
if (svt_enc->crf > 0) {
param->qp = svt_enc->crf;