[FFmpeg-devel] [PATCH 3/3] avcodec/nvdec_av1: fix setting film grain parameters for frames with update_grain == 0

Timo Rothenpieler timo at rothenpieler.org
Thu Nov 12 23:38:48 EET 2020


On 12.11.2020 22:23, James Almer wrote:
> On 11/12/2020 6:19 PM, Timo Rothenpieler wrote:
>> Are you sure this is necessary at all?
>> If apply_grain is 0, the value of those should be entirely irrelevant.
> 
> This is not about apply_grain == 0, but about apply_grain == 1 && 
> update_grain == 0.
> In those cases, the parser only reads a frame index from the bitstream 
> (film_grain_params_ref_idx), and you're supposed to get the FG values 
> from said referenced frame.
> 
> As is, nvdec_av1 is filling all CUVIDAV1PICPARAMS FG fields except 
> apply_grain and random_seed with zeroes on such frames.

Yes, but you still could just define the fg_header at the top of the 
function, and just fill the fields from it unconditionally.
It will contain garbage on frames with !apply_grain, but it shouldn't 
matter.

It's purely a nit about the style, since I'm trying to keep as much 
stuff in the struct initialization.


More information about the ffmpeg-devel mailing list