Commit ff0c5593 authored by Philip Langdale's avatar Philip Langdale Committed by Michael Niedermayer

nvenc: Propagate desired number of reference frames.

Reviewed-by: 's avatarTimo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 15848c62
......@@ -590,6 +590,11 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
memcpy(&ctx->encode_config, &preset_config.presetCfg, sizeof(ctx->encode_config));
ctx->encode_config.version = NV_ENC_CONFIG_VER;
if (avctx->refs >= 0) {
/* 0 means "let the hardware decide" */
ctx->encode_config.encodeCodecConfig.h264Config.maxNumRefFrames = avctx->refs;
}
if (avctx->gop_size >= 0) {
ctx->encode_config.gopLength = avctx->gop_size;
ctx->encode_config.encodeCodecConfig.h264Config.idrPeriod = avctx->gop_size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment