diff mbox series

[FFmpeg-devel,1/8] cbs_h266: fix inference for sh_lmcs_used_flag and sh_explicit_scaling_list_used_flag

Message ID TYSPR06MB6433FB4501A2C1FCB41204B8AA0CA@TYSPR06MB6433.apcprd06.prod.outlook.com
State New
Headers show
Series [FFmpeg-devel,1/8] cbs_h266: fix inference for sh_lmcs_used_flag and sh_explicit_scaling_list_used_flag | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Nuo Mi Aug. 7, 2023, 2:55 p.m. UTC
if sh_picture_header_in_slice_header_flag is true
sh_lmcs_used_flag and sh_explicit_scaling_list_used_flag are infered from ph
---
 libavcodec/cbs_h266_syntax_template.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

Comments

James Almer Aug. 7, 2023, 3:17 p.m. UTC | #1
On 8/7/2023 11:55 AM, Nuo Mi wrote:
> if sh_picture_header_in_slice_header_flag is true
> sh_lmcs_used_flag and sh_explicit_scaling_list_used_flag are infered from ph
> ---
>   libavcodec/cbs_h266_syntax_template.c | 24 ++++++++++++++----------
>   1 file changed, 14 insertions(+), 10 deletions(-)
> 
> diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c
> index 98a8e033bf..857882655b 100644
> --- a/libavcodec/cbs_h266_syntax_template.c
> +++ b/libavcodec/cbs_h266_syntax_template.c
> @@ -3151,17 +3151,21 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
>           infer(sh_alf_enabled_flag, 0);
>       }
>   
> -    if (ph->ph_lmcs_enabled_flag &&
> -        !current->sh_picture_header_in_slice_header_flag)
> -        flag(sh_lmcs_used_flag);
> -    else
> -        infer(sh_lmcs_used_flag, 0);
> +    if (current->sh_picture_header_in_slice_header_flag) {
> +        infer(sh_lmcs_used_flag, ph->ph_lmcs_enabled_flag);
> +        infer(sh_explicit_scaling_list_used_flag,
> +            ph->ph_explicit_scaling_list_enabled_flag);
> +    } else {
> +        if (ph->ph_lmcs_enabled_flag)
> +            flag(sh_lmcs_used_flag);
> +        else
> +            infer(sh_lmcs_used_flag, 0);
>   
> -    if (ph->ph_explicit_scaling_list_enabled_flag &&
> -        !current->sh_picture_header_in_slice_header_flag)
> -        flag(sh_explicit_scaling_list_used_flag);
> -    else
> -        infer(sh_explicit_scaling_list_used_flag, 0);
> +        if (ph->ph_explicit_scaling_list_enabled_flag)
> +            flag(sh_explicit_scaling_list_used_flag);
> +        else
> +            infer(sh_explicit_scaling_list_used_flag, 0);
> +    }
>   
>       if (!pps->pps_rpl_info_in_ph_flag &&
>           ((nal_unit_type != VVC_IDR_W_RADL &&

Do you know which samples from the conformance suite exercise this, and 
patches 2 and 3?
Nuo Mi Aug. 7, 2023, 3:47 p.m. UTC | #2
On Mon, Aug 7, 2023 at 11:17 PM James Almer <jamrial@gmail.com> wrote:

> On 8/7/2023 11:55 AM, Nuo Mi wrote:
> > if sh_picture_header_in_slice_header_flag is true
> > sh_lmcs_used_flag and sh_explicit_scaling_list_used_flag are infered
> from ph
> > ---
> >   libavcodec/cbs_h266_syntax_template.c | 24 ++++++++++++++----------
> >   1 file changed, 14 insertions(+), 10 deletions(-)
> >
> > diff --git a/libavcodec/cbs_h266_syntax_template.c
> b/libavcodec/cbs_h266_syntax_template.c
> > index 98a8e033bf..857882655b 100644
> > --- a/libavcodec/cbs_h266_syntax_template.c
> > +++ b/libavcodec/cbs_h266_syntax_template.c
> > @@ -3151,17 +3151,21 @@ static int FUNC(slice_header)
> (CodedBitstreamContext *ctx, RWContext *rw,
> >           infer(sh_alf_enabled_flag, 0);
> >       }
> >
> > -    if (ph->ph_lmcs_enabled_flag &&
> > -        !current->sh_picture_header_in_slice_header_flag)
> > -        flag(sh_lmcs_used_flag);
> > -    else
> > -        infer(sh_lmcs_used_flag, 0);
> > +    if (current->sh_picture_header_in_slice_header_flag) {
> > +        infer(sh_lmcs_used_flag, ph->ph_lmcs_enabled_flag);
> > +        infer(sh_explicit_scaling_list_used_flag,
> > +            ph->ph_explicit_scaling_list_enabled_flag);
> > +    } else {
> > +        if (ph->ph_lmcs_enabled_flag)
> > +            flag(sh_lmcs_used_flag);
> > +        else
> > +            infer(sh_lmcs_used_flag, 0);
> >
> > -    if (ph->ph_explicit_scaling_list_enabled_flag &&
> > -        !current->sh_picture_header_in_slice_header_flag)
> > -        flag(sh_explicit_scaling_list_used_flag);
> > -    else
> > -        infer(sh_explicit_scaling_list_used_flag, 0);
> > +        if (ph->ph_explicit_scaling_list_enabled_flag)
> > +            flag(sh_explicit_scaling_list_used_flag);
> > +        else
> > +            infer(sh_explicit_scaling_list_used_flag, 0);
> > +    }
> >
> >       if (!pps->pps_rpl_info_in_ph_flag &&
> >           ((nal_unit_type != VVC_IDR_W_RADL &&
>
> Do you know which samples from the conformance suite exercise this, and
> patches 2 and 3?
>
Thank you for the review
Good idea. will send out v2 and add a clips list

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
diff mbox series

Patch

diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c
index 98a8e033bf..857882655b 100644
--- a/libavcodec/cbs_h266_syntax_template.c
+++ b/libavcodec/cbs_h266_syntax_template.c
@@ -3151,17 +3151,21 @@  static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
         infer(sh_alf_enabled_flag, 0);
     }
 
-    if (ph->ph_lmcs_enabled_flag &&
-        !current->sh_picture_header_in_slice_header_flag)
-        flag(sh_lmcs_used_flag);
-    else
-        infer(sh_lmcs_used_flag, 0);
+    if (current->sh_picture_header_in_slice_header_flag) {
+        infer(sh_lmcs_used_flag, ph->ph_lmcs_enabled_flag);
+        infer(sh_explicit_scaling_list_used_flag,
+            ph->ph_explicit_scaling_list_enabled_flag);
+    } else {
+        if (ph->ph_lmcs_enabled_flag)
+            flag(sh_lmcs_used_flag);
+        else
+            infer(sh_lmcs_used_flag, 0);
 
-    if (ph->ph_explicit_scaling_list_enabled_flag &&
-        !current->sh_picture_header_in_slice_header_flag)
-        flag(sh_explicit_scaling_list_used_flag);
-    else
-        infer(sh_explicit_scaling_list_used_flag, 0);
+        if (ph->ph_explicit_scaling_list_enabled_flag)
+            flag(sh_explicit_scaling_list_used_flag);
+        else
+            infer(sh_explicit_scaling_list_used_flag, 0);
+    }
 
     if (!pps->pps_rpl_info_in_ph_flag &&
         ((nal_unit_type != VVC_IDR_W_RADL &&