1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +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); av_log(avctx, AV_LOG_VERBOSE, "CQ(%d) mode enabled.\n", tmp_quality);
//CQ mode shall discard max & avg bitrate; //CQ mode shall discard avg bitrate & honor max bitrate;
avctx->bit_rate = ctx->encode_config.rcParams.averageBitRate = 0; ctx->encode_config.rcParams.averageBitRate = avctx->bit_rate = 0;
avctx->rc_max_rate = ctx->encode_config.rcParams.maxBitRate = 0; ctx->encode_config.rcParams.maxBitRate = avctx->rc_max_rate;
} }
} }