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

Timo Rothenpieler timo at rothenpieler.org
Sat Jan 24 12:37:50 CET 2015


> Signed-off-by: Philip Langdale <philipl at overt.org>
> ---
>  libavcodec/nvenc.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
> index c52beb7..e68bbe9 100644
> --- a/libavcodec/nvenc.c
> +++ b/libavcodec/nvenc.c
> @@ -614,6 +614,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;
> +    }
> +
>      /* 0 is intra-only, 1 is I/P only, 2 is one B Frame, 3 two B frames, and so on. */
>      ctx->encode_config.frameIntervalP = avctx->max_b_frames + 1;
>  
> 

Looks good to merge.
The question if the ffmpeg default is good is a diffrent issue.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150124/dfe48f9e/attachment.asc>


More information about the ffmpeg-devel mailing list