aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2022-12-08 12:31:00 +0100
committerTimo Rothenpieler <timo@rothenpieler.org>2022-12-08 12:39:18 +0100
commitdf2e08e4526a0c87d33cdc1fbddcc878857bf8af (patch)
treeab248324ae6e1042de4de23ade983331868ff36e
parentc77210491a2427495b86979bac968f75d2641934 (diff)
downloadffmpeg-df2e08e4526a0c87d33cdc1fbddcc878857bf8af.tar.gz
avcodec/nvenc: fix vbv buffer size in cq mode
The CQ calculation gets thrown off and behaves very nonsensical if it isn't set to 0.
-rw-r--r--libavcodec/nvenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 850c46022b..9386aadae2 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1078,8 +1078,9 @@ static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx)
av_log(avctx, AV_LOG_VERBOSE, "CQ(%d) mode enabled.\n", tmp_quality);
- //CQ mode shall discard avg bitrate & honor max bitrate;
+ // CQ mode shall discard avg bitrate/vbv buffer size and honor only max bitrate
ctx->encode_config.rcParams.averageBitRate = avctx->bit_rate = 0;
+ ctx->encode_config.rcParams.vbvBufferSize = avctx->rc_buffer_size = 0;
ctx->encode_config.rcParams.maxBitRate = avctx->rc_max_rate;
}
}