[FFmpeg-devel] [PATCH] avcodec/vvc decode: ALF filtering without CC-ALF

Frank Plowman post at frankplowman.com
Thu Jan 2 20:18:13 EET 2025


Sorry, #11325 is the original issue.  #11367 is the duplicate.

On 02/01/2025 17:56, Frank Plowman wrote:
> Hi both,
> 
> Can we push either of these?  Someone else has reported the same issue
> on Trac (#11325).  The difference between the two proposed
> implementations seems rather superficial to me.
> 
> Thanks and happy new year,
> Frank
> 
> On 03/12/2024 02:17, Nuo Mi wrote:
>> Hi Chris and Frank,
>> Thank you for the patch and review.
>>
>> On Mon, Dec 2, 2024 at 10:27 PM Chris Warrington via ffmpeg-devel <
>> ffmpeg-devel at ffmpeg.org> wrote:
>>
>>> When a stream has ALF filtering enabled but not CC-ALF, the CC-ALF set
>>> indexes alf->ctb_cc_idc are being read uninitialized during ALF filtering.
>>>
>>> This change initializes alf->ctb_cc_idc whenever ALF is enabled.
>>>
>>> Ref. https://trac.ffmpeg.org/ticket/11325
>>>
>>> ---
>>>  libavcodec/vvc/ctu.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c
>>> index a32abdeb62..c972dcc33e 100644
>>> --- a/libavcodec/vvc/ctu.c
>>> +++ b/libavcodec/vvc/ctu.c
>>> @@ -2288,6 +2288,7 @@ static void alf_params(VVCLocalContext *lc, const
>>> int rx, const int ry)
>>>      ALFParams *alf                = &CTB(fc->tab.alf, rx, ry);
>>>
>>>      alf->ctb_flag[LUMA] = alf->ctb_flag[CB] = alf->ctb_flag[CR] = 0;
>>> +    alf->ctb_cc_idc[0] = alf->ctb_cc_idc[1] = 0;
>>>
>> This will introduce two writes for all blocks, even if there is no CC ALF.
>> How about checking the sps_ccalf_enabled_flag in ff_vvc_alf_filter?
>>
>>>      if (sh->sh_alf_enabled_flag) {
>>>          alf->ctb_flag[LUMA] = ff_vvc_alf_ctb_flag(lc, rx, ry, LUMA);
>>>          if (alf->ctb_flag[LUMA]) {
>>> @@ -2318,7 +2319,6 @@ static void alf_params(VVCLocalContext *lc, const
>>> int rx, const int ry)
>>>          const uint8_t cc_enabled[] = { sh->sh_alf_cc_cb_enabled_flag,
>>> sh->sh_alf_cc_cr_enabled_flag };
>>>          const uint8_t cc_aps_id[]  = { sh->sh_alf_cc_cb_aps_id,
>>> sh->sh_alf_cc_cr_aps_id };
>>>          for (int i = 0; i < 2; i++) {
>>> -            alf->ctb_cc_idc[i] = 0;
>>>              if (cc_enabled[i]) {
>>>                  const VVCALF *aps = fc->ps.alf_list[cc_aps_id[i]];
>>>                  alf->ctb_cc_idc[i] = ff_vvc_alf_ctb_cc_idc(lc, rx, ry, i,
>>> aps->num_cc_filters[i]);
>>> --
> _______________________________________________
> 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".

-- 
Frank



More information about the ffmpeg-devel mailing list