1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-03 01:39:58 +02:00

avcodec/nvenc: honor max bitrate in CQ mode

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This commit is contained in:
Roman Arzumanyan 2020-06-03 16:12:12 +03:00 committed by Timo Rothenpieler
parent 0c79b73164
commit 470bbf60d4

View File

@ -956,9 +956,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;
}
}