[FFmpeg-devel] [PATCH] avcodec/dxva2_av1: use correct grain parameters with update_grain = 0

James Almer jamrial at gmail.com
Thu Nov 26 15:05:02 EET 2020


On 11/26/2020 2:34 AM, Guangxin Xu wrote:
> spec did not forbid this.
> Here is da1vd code:
> https://code.videolan.org/videolan/dav1d/-/blob/master/src/obu.c#L1057
> If  update_grain  == 0, it will copy film grain data from the reference
> frame to the current frame.
> Maybe we can do the same thing on CBS, Other acceleration like vaapi,
> will get benefit from this.

Yes, I sent a patchset to properly copy film grain params from reference 
frames yesterday that should cover all possible scenarios.

Regarding Vaapi, its film grain implementation is incomplete, on top of 
also being affected by this issue. It doesn't look like it's filling all 
the VAFilmGrainStructAV1 fields it should.

> 
> 
> On Thu, Nov 26, 2020 at 3:05 AM James Almer <jamrial at gmail.com> wrote:
> 
>> On 11/24/2020 5:59 AM, Guangxin Xu wrote:
>>> Hi   Hendrik,
>>> two related questions:
>>> 1. Seems it's a generic code. Could we handle this in the av1dec.c?
>>> 2. For the current code, what's happened if frame A ref to B, B ref to C.
>>> and both A, B has update_grain == 0.
>>
>> Is that considered a valid bitstream? If so, then value inferring should
>> be done in either CBS (like it's done for segmentation and loop filter),
>> or in av1dec.c. Otherwise all the fields will be zero, same as is the
>> case right now.
>>
>>> thanks
>>>
>>>
>>> On Tue, Nov 24, 2020 at 4:42 AM James Almer <jamrial at gmail.com> wrote:
>>>
>>>> On 11/23/2020 8:38 AM, Hendrik Leppkes wrote:
>>>>> When update_grain is zero, the parameters should be taken from a
>>>>> reference frame instead.
>>>>> ---
>>>>>     libavcodec/dxva2_av1.c | 59
>> +++++++++++++++++++++---------------------
>>>>>     1 file changed, 30 insertions(+), 29 deletions(-)
>>>>
>>>> LGTM
>>>> _______________________________________________
>>>> 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".
>>> _______________________________________________
>>> 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".
>>>
>>
>> _______________________________________________
>> 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".
> _______________________________________________
> 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".
> 



More information about the ffmpeg-devel mailing list