You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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.
This commit is contained in:
@@ -1114,8 +1114,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 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.averageBitRate = avctx->bit_rate = 0;
|
||||||
|
ctx->encode_config.rcParams.vbvBufferSize = avctx->rc_buffer_size = 0;
|
||||||
ctx->encode_config.rcParams.maxBitRate = avctx->rc_max_rate;
|
ctx->encode_config.rcParams.maxBitRate = avctx->rc_max_rate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user