diff options
author | Philip Langdale <philipl@overt.org> | 2015-01-24 12:52:58 -0800 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-01-24 22:59:54 +0100 |
commit | ff0c559329bd3fc8c63215b835ba65791e85a0da (patch) | |
tree | 25788413c2c9447a9ee3b917f0f7507ea931a7e1 /libavcodec | |
parent | 15848c623d18fee1775b866b87eda22c38e710de (diff) | |
download | ffmpeg-ff0c559329bd3fc8c63215b835ba65791e85a0da.tar.gz |
nvenc: Propagate desired number of reference frames.
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/nvenc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index 7d82d58c3c..16ef93ff82 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -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; |