diff options
author | Roman Arzumanyan <rarzumanyan@nvidia.com> | 2020-06-03 16:12:12 +0300 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2020-06-04 19:02:25 +0200 |
commit | 221e490d42bc1c20c61aee385d5bfe003a1a8c87 (patch) | |
tree | ee36dd78a6557873960c84820175f490d92989c8 | |
parent | e3883657540d4e99f0f77a3337aa37db4464eda3 (diff) | |
download | ffmpeg-221e490d42bc1c20c61aee385d5bfe003a1a8c87.tar.gz |
avcodec/nvenc: honor max bitrate in CQ mode
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
-rw-r--r-- | libavcodec/nvenc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index 8298aec671..0b0b5d79bb 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -920,9 +920,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 max & avg bitrate; - avctx->bit_rate = ctx->encode_config.rcParams.averageBitRate = 0; - avctx->rc_max_rate = ctx->encode_config.rcParams.maxBitRate = 0; + //CQ mode shall discard avg bitrate & honor max bitrate; + ctx->encode_config.rcParams.averageBitRate = avctx->bit_rate = 0; + ctx->encode_config.rcParams.maxBitRate = avctx->rc_max_rate; } } |