[FFmpeg-devel] [PATCH] avcodec/nvenc: multiple reference frames support

Roman Arzumanyan rarzumanyan at nvidia.com
Fri Sep 27 13:28:41 EEST 2019


> First, this needs SDK Version Guards
Thanks, I've missed that. Added to patch.

> Second, in what way is this different from the existing global option(avctx->refs), which nvenc.c already uses to set
It's slightly different from existing global option (gives more fine-grain control):
"nb_ref_frames" effectively specifies maximum allowed number of reference frames in L0 and L1 reference lists for every P & B frame;
"avctx->refs" effectively specifies DPB size;

-----Original Message-----
From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Timo Rothenpieler
Sent: Friday, September 27, 2019 12:56 PM
To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>; Roman Arzumanyan <rarzumanyan at nvidia.com>
Cc: Yogender Gupta <ygupta at nvidia.com>
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/nvenc: multiple reference frames support

On 27/09/2019 11:04, Roman Arzumanyan wrote:
> Hello,
> 
> This patch adds multiple reference frames support (part of Video Codec SDK 9.1).
> It adds "nb_ref_frames" CLI option to set number of reference frames. Possible values:
> 
>    *   auto - let encoder decide (default value).
>    *   [0;7] - set value by hand. 0 is equal to auto.
> 
> Usage example:
> ffmpeg -i big_buck_bunny_1080p_h264.mov -c:v hevc_nvenc -frames:v 128 -nb_ref_frames auto -bf 2 -y big_buck_bunny_1080p_nb_auto.h265
> ffmpeg -i big_buck_bunny_1080p_h264.mov -c:v h264_nvenc -frames:v 128 -nb_ref_frames 1          -y big_buck_bunny_1080p_nb_1.h264
> 
> Actual number of reference frames will be determined by encoder, but it will not exceed value of "nb_ref_frames" option.

Thanks!

Two things:

First, this needs SDK Version Guards, since we want to keep supporting building against older SDKs and thus Driver-Versions.
There are a few examples in nvenc.h already, like NVENC_HAVE_HEVC_BFRAME_REF_MODE.
It should be done in the same fashion for this feature.

Second, in what way is this different from the existing global option(avctx->refs), which nvenc.c already uses to set 
h264->maxNumRefFrames and hevc->maxNumRefFramesInDPB?
The refs option is documented as "number of reference frames", which seems fitting for this. Can that option just be re-used to also set this new parameter, if it's available, or are they doing different things?

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel at ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avcodec-nvenc-adding-multiple-reference-frames.patch
Type: application/octet-stream
Size: 6372 bytes
Desc: 0001-avcodec-nvenc-adding-multiple-reference-frames.patch
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190927/24b2fd0f/attachment.obj>


More information about the ffmpeg-devel mailing list