[FFmpeg-cvslog] nvenc: Propagate desired number of reference frames.

Philip Langdale git at videolan.org
Sat Jan 24 23:10:40 CET 2015


ffmpeg | branch: master | Philip Langdale <philipl at overt.org> | Sat Jan 24 12:52:58 2015 -0800| [ff0c559329bd3fc8c63215b835ba65791e85a0da] | committer: Michael Niedermayer

nvenc: Propagate desired number of reference frames.

Reviewed-by: Timo Rothenpieler <timo at rothenpieler.org>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ff0c559329bd3fc8c63215b835ba65791e85a0da
---

 libavcodec/nvenc.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 7d82d58..16ef93f 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;



More information about the ffmpeg-cvslog mailing list