[FFmpeg-devel] libdav1d: use film grain export flag to export AVFilmGrainParams side data

Lynne dev at lynne.ee
Thu Nov 12 16:34:06 EET 2020


Nov 12, 2020, 14:49 by jamrial at gmail.com:

> On 11/12/2020 8:59 AM, Lynne wrote:
>
>> +    if (dav1d->apply_grain < 0 &&
>> +        c->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN)
>> +        dav1d->apply_grain = 0;
>>
>
> Don't overwrite a Libdav1dContext field that was set by an AVOption. Instead, just change the check below and set s.apply_grain directly based on both user options (film_grain and export_side_data).
>
>> if (dav1d->apply_grain >= 0)
>>  s.apply_grain = dav1d->apply_grain;
>>  @@ -395,6 +401,64 @@ FF_ENABLE_DEPRECATION_WARNINGS
>>  break;
>>  }
>>  }
>> +    if ((!dav1d->apply_grain || (c->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN)) &&
>>
>
> With the above you should in theory be able to just check for the export_side_data flag and frame_hdr->film_grain.present here.
>

Changed to:
>      if (dav1d->apply_grain >= 0) 
>          s.apply_grain = dav1d->apply_grain;
> +    else if (c->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN)
> +        s.apply_grain = 0;

> +    if (p->frame_hdr->film_grain.present && (!dav1d->apply_grain || 
> +        (c->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN)) {

New version attached.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libdav1d-use-film-grain-export-flag-to-export-AVFilm.patch
Type: text/x-patch
Size: 6284 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20201112/ca21b9fc/attachment.bin>


More information about the ffmpeg-devel mailing list