diff mbox series

[FFmpeg-devel,v4,8/9] avcodec/cbs_h2645: vvc, do not skip nals for nuh_layer_id > 0

Message ID 20210125141507.11012-9-nuomi2021@gmail.com
State Superseded
Headers show
Series add vvc raw demuxer, muxer, parser, metadata bsf
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Nuo Mi Jan. 25, 2021, 2:15 p.m. UTC
---
 libavcodec/cbs_h2645.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Nuo Mi Jan. 25, 2021, 2:21 p.m. UTC | #1
On Mon, Jan 25, 2021 at 10:17 PM Nuo Mi <nuomi2021@gmail.com> wrote:

> ---
>  libavcodec/cbs_h2645.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
> index 6f3abf6b0b..da541407cf 100644
> --- a/libavcodec/cbs_h2645.c
> +++ b/libavcodec/cbs_h2645.c
> @@ -494,8 +494,9 @@ static int
> cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx,
>          const H2645NAL *nal = &packet->nals[i];
>          AVBufferRef *ref;
>          size_t size = nal->size;
> +        enum AVCodecID codec_id = ctx->codec->codec_id;
>
> -        if (nal->nuh_layer_id > 0)
> +        if (codec_id != AV_CODEC_ID_VVC && nal->nuh_layer_id > 0)
>
Hi Mark,
Could you explain why we need this for other codecs?
thanks

>              continue;
>
>          // Remove trailing zeroes.
> --
> 2.25.1
>
>
Nuo Mi Feb. 6, 2021, 3:30 a.m. UTC | #2
On Mon, Jan 25, 2021 at 10:21 PM Nuo Mi <nuomi2021@gmail.com> wrote:

>
> On Mon, Jan 25, 2021 at 10:17 PM Nuo Mi <nuomi2021@gmail.com> wrote:
>
>> ---
>>  libavcodec/cbs_h2645.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
>> index 6f3abf6b0b..da541407cf 100644
>> --- a/libavcodec/cbs_h2645.c
>> +++ b/libavcodec/cbs_h2645.c
>> @@ -494,8 +494,9 @@ static int
>> cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx,
>>          const H2645NAL *nal = &packet->nals[i];
>>          AVBufferRef *ref;
>>          size_t size = nal->size;
>> +        enum AVCodecID codec_id = ctx->codec->codec_id;
>>
>> -        if (nal->nuh_layer_id > 0)
>> +        if (codec_id != AV_CODEC_ID_VVC && nal->nuh_layer_id > 0)
>>
> Hi Mark,
> Could you explain why we need this for other codecs?
> thanks
>

Hi Mark,
Any insight on this?
 Thanks

             continue;
>>
>>          // Remove trailing zeroes.
>> --
>> 2.25.1
>>
>>
Andriy Gelman Feb. 6, 2021, 7:40 a.m. UTC | #3
On Sat, 06. Feb 11:30, Nuo Mi wrote:
> On Mon, Jan 25, 2021 at 10:21 PM Nuo Mi <nuomi2021@gmail.com> wrote:
> 
> >
> > On Mon, Jan 25, 2021 at 10:17 PM Nuo Mi <nuomi2021@gmail.com> wrote:
> >
> >> ---
> >>  libavcodec/cbs_h2645.c | 3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
> >> index 6f3abf6b0b..da541407cf 100644
> >> --- a/libavcodec/cbs_h2645.c
> >> +++ b/libavcodec/cbs_h2645.c
> >> @@ -494,8 +494,9 @@ static int
> >> cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx,
> >>          const H2645NAL *nal = &packet->nals[i];
> >>          AVBufferRef *ref;
> >>          size_t size = nal->size;
> >> +        enum AVCodecID codec_id = ctx->codec->codec_id;
> >>
> >> -        if (nal->nuh_layer_id > 0)
> >> +        if (codec_id != AV_CODEC_ID_VVC && nal->nuh_layer_id > 0)
> >>
> > Hi Mark,
> > Could you explain why we need this for other codecs?
> > thanks
> >
> 
> Hi Mark,
> Any insight on this?

If I remember correctly some of the parameter sets are parsed differently for
nuh_layer_id > 0 layers, which was not supported by cbs.

Just tried it again on a multi-layers stream and cbs errors out. I can forward
you the file if you want.

[trace_headers @ 0x56094c620440] Sequence Parameter Set
[trace_headers @ 0x555557c34440] 0           forbidden_zero_bit                                          0 = 0
[trace_headers @ 0x555557c34440] 1           nal_unit_type                                          100001 = 33
[trace_headers @ 0x555557c34440] 7           nuh_layer_id                                           000001 = 1
[trace_headers @ 0x555557c34440] 13          nuh_temporal_id_plus1                                     001 = 1
[trace_headers @ 0x555557c34440] 16          sps_video_parameter_set_id                               0000 = 0
[trace_headers @ 0x555557c34440] 20          sps_max_sub_layers_minus1                                 111 = 7
[trace_headers @ 0x555557c34440] sps_max_sub_layers_minus1 out of range: 7, but must be in [0,6].
[trace_headers @ 0x555557c34440] Failed to read unit 2 (type 33).
Error initializing bitstream filter: trace_headers
Error initializing output stream 0:0 --
Nuo Mi Feb. 6, 2021, 2:49 p.m. UTC | #4
On Sat, Feb 6, 2021 at 3:49 PM Andriy Gelman <andriy.gelman@gmail.com>
wrote:

> On Sat, 06. Feb 11:30, Nuo Mi wrote:
> > On Mon, Jan 25, 2021 at 10:21 PM Nuo Mi <nuomi2021@gmail.com> wrote:
> >
> > >
> > > On Mon, Jan 25, 2021 at 10:17 PM Nuo Mi <nuomi2021@gmail.com> wrote:
> > >
> > >> ---
> > >>  libavcodec/cbs_h2645.c | 3 ++-
> > >>  1 file changed, 2 insertions(+), 1 deletion(-)
> > >>
> > >> diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
> > >> index 6f3abf6b0b..da541407cf 100644
> > >> --- a/libavcodec/cbs_h2645.c
> > >> +++ b/libavcodec/cbs_h2645.c
> > >> @@ -494,8 +494,9 @@ static int
> > >> cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx,
> > >>          const H2645NAL *nal = &packet->nals[i];
> > >>          AVBufferRef *ref;
> > >>          size_t size = nal->size;
> > >> +        enum AVCodecID codec_id = ctx->codec->codec_id;
> > >>
> > >> -        if (nal->nuh_layer_id > 0)
> > >> +        if (codec_id != AV_CODEC_ID_VVC && nal->nuh_layer_id > 0)
> > >>
> > > Hi Mark,
> > > Could you explain why we need this for other codecs?
> > > thanks
> > >
> >
> > Hi Mark,
> > Any insight on this?
>
> If I remember correctly some of the parameter sets are parsed differently
> for
> nuh_layer_id > 0 layers, which was not supported by cbs.
>
> Just tried it again on a multi-layers stream and cbs errors out. I can
> forward
> you the file if you want.
>
Thanks, Andriy, Please send the file to me.
I do not have time to cover hevc part imediately. I will check it after the
vcc tasks are done.

>
> [trace_headers @ 0x56094c620440] Sequence Parameter Set
> [trace_headers @ 0x555557c34440] 0           forbidden_zero_bit
>                               0 = 0
> [trace_headers @ 0x555557c34440] 1           nal_unit_type
>                           100001 = 33
> [trace_headers @ 0x555557c34440] 7           nuh_layer_id
>                          000001 = 1
> [trace_headers @ 0x555557c34440] 13          nuh_temporal_id_plus1
>                              001 = 1
> [trace_headers @ 0x555557c34440] 16          sps_video_parameter_set_id
>                            0000 = 0
> [trace_headers @ 0x555557c34440] 20          sps_max_sub_layers_minus1
>                              111 = 7
> [trace_headers @ 0x555557c34440] sps_max_sub_layers_minus1 out of range:
> 7, but must be in [0,6].
> [trace_headers @ 0x555557c34440] Failed to read unit 2 (type 33).
> Error initializing bitstream filter: trace_headers
> Error initializing output stream 0:0 --
>
> --
> Andriy
> _______________________________________________
> 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_h2645.c b/libavcodec/cbs_h2645.c
index 6f3abf6b0b..da541407cf 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -494,8 +494,9 @@  static int cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx,
         const H2645NAL *nal = &packet->nals[i];
         AVBufferRef *ref;
         size_t size = nal->size;
+        enum AVCodecID codec_id = ctx->codec->codec_id;
 
-        if (nal->nuh_layer_id > 0)
+        if (codec_id != AV_CODEC_ID_VVC && nal->nuh_layer_id > 0)
             continue;
 
         // Remove trailing zeroes.