Message ID | 20221019072508.23460-4-thomas.ff@spin-digital.com |
---|---|
State | New |
Headers | show |
Series | Add support for H266/VVC | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
yinshiyou/make_loongarch64 | warning | New warnings during build |
andriy/make_fate_x86 | success | Make fate finished |
andriy/make_x86 | warning | New warnings during build |
On 10/19/2022 4:25 AM, thomas.ff@spin-digital.com wrote: > From: Thomas Siedel <thomas.ff@spin-digital.com> > > Add ff_cbs_type_h266 to cbs types tables and AV_CODEC_ID_H266 to cbs codec ids. > Change CBS_MAX_UNIT_TYPES to 8 as VVC implements 8 different slice types > > Signed-off-by: Thomas Siedel <thomas.ff@spin-digital.com> > --- > libavcodec/Makefile | 1 + > libavcodec/cbs.c | 6 ++++++ > libavcodec/cbs_internal.h | 3 ++- > 3 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/Makefile b/libavcodec/Makefile > index c7dc5da0f9..b3fcf173e9 100644 > --- a/libavcodec/Makefile > +++ b/libavcodec/Makefile > @@ -76,6 +76,7 @@ OBJS-$(CONFIG_CBS) += cbs.o cbs_bsf.o > OBJS-$(CONFIG_CBS_AV1) += cbs_av1.o > OBJS-$(CONFIG_CBS_H264) += cbs_h2645.o cbs_sei.o h2645_parse.o > OBJS-$(CONFIG_CBS_H265) += cbs_h2645.o cbs_sei.o h2645_parse.o > +OBJS-$(CONFIG_CBS_H266) += cbs_h2645.o cbs_sei.o h2645_parse.o CONFIG_CBS_H266 is undefined. You need to add cbs_h266 to configure here instead of in patch 4/11, even if no module selects it just yet. Also, this patch should be squashed with patch 2/11. > OBJS-$(CONFIG_CBS_JPEG) += cbs_jpeg.o > OBJS-$(CONFIG_CBS_MPEG2) += cbs_mpeg2.o > OBJS-$(CONFIG_CBS_VP9) += cbs_vp9.o > diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c > index 8d6e3c3442..f01726aa37 100644 > --- a/libavcodec/cbs.c > +++ b/libavcodec/cbs.c > @@ -40,6 +40,9 @@ static const CodedBitstreamType *const cbs_type_table[] = { > #if CONFIG_CBS_H265 > &ff_cbs_type_h265, > #endif > +#if CONFIG_CBS_H266 > + &ff_cbs_type_h266, > +#endif > #if CONFIG_CBS_JPEG > &ff_cbs_type_jpeg, > #endif > @@ -61,6 +64,9 @@ const enum AVCodecID ff_cbs_all_codec_ids[] = { > #if CONFIG_CBS_H265 > AV_CODEC_ID_H265, > #endif > +#if CONFIG_CBS_H266 > + AV_CODEC_ID_H266, > +#endif > #if CONFIG_CBS_JPEG > AV_CODEC_ID_MJPEG, > #endif > diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h > index 5ccba3c901..b741030da4 100644 > --- a/libavcodec/cbs_internal.h > +++ b/libavcodec/cbs_internal.h > @@ -45,7 +45,7 @@ enum CBSContentType { > enum { > // Maximum number of unit types described by the same unit type > // descriptor. > - CBS_MAX_UNIT_TYPES = 3, > + CBS_MAX_UNIT_TYPES = 8, > // Maximum number of reference buffer offsets in any one unit. > CBS_MAX_REF_OFFSETS = 2, > // Special value used in a unit type descriptor to indicate that it > @@ -242,6 +242,7 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, > extern const CodedBitstreamType ff_cbs_type_av1; > extern const CodedBitstreamType ff_cbs_type_h264; > extern const CodedBitstreamType ff_cbs_type_h265; > +extern const CodedBitstreamType ff_cbs_type_h266; > extern const CodedBitstreamType ff_cbs_type_jpeg; > extern const CodedBitstreamType ff_cbs_type_mpeg2; > extern const CodedBitstreamType ff_cbs_type_vp9;
On Thu, 20 Oct 2022 at 01:07, James Almer <jamrial@gmail.com> wrote: > On 10/19/2022 4:25 AM, thomas.ff@spin-digital.com wrote: > > From: Thomas Siedel <thomas.ff@spin-digital.com> > > > > Add ff_cbs_type_h266 to cbs types tables and AV_CODEC_ID_H266 to cbs > codec ids. > > Change CBS_MAX_UNIT_TYPES to 8 as VVC implements 8 different slice types > > > > Signed-off-by: Thomas Siedel <thomas.ff@spin-digital.com> > > --- > > libavcodec/Makefile | 1 + > > libavcodec/cbs.c | 6 ++++++ > > libavcodec/cbs_internal.h | 3 ++- > > 3 files changed, 9 insertions(+), 1 deletion(-) > > > > diff --git a/libavcodec/Makefile b/libavcodec/Makefile > > index c7dc5da0f9..b3fcf173e9 100644 > > --- a/libavcodec/Makefile > > +++ b/libavcodec/Makefile > > @@ -76,6 +76,7 @@ OBJS-$(CONFIG_CBS) += cbs.o > cbs_bsf.o > > OBJS-$(CONFIG_CBS_AV1) += cbs_av1.o > > OBJS-$(CONFIG_CBS_H264) += cbs_h2645.o cbs_sei.o > h2645_parse.o > > OBJS-$(CONFIG_CBS_H265) += cbs_h2645.o cbs_sei.o > h2645_parse.o > > +OBJS-$(CONFIG_CBS_H266) += cbs_h2645.o cbs_sei.o > h2645_parse.o > > CONFIG_CBS_H266 is undefined. You need to add cbs_h266 to configure here > instead of in patch 4/11, even if no module selects it just yet. > > Also, this patch should be squashed with patch 2/11. > Thank you for your feedback, I did not notice this before. I now changed it as you suggested and also combined patches 2 and 3. The changes are included in the new version of the patch set that I just submitted.
diff --git a/libavcodec/Makefile b/libavcodec/Makefile index c7dc5da0f9..b3fcf173e9 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -76,6 +76,7 @@ OBJS-$(CONFIG_CBS) += cbs.o cbs_bsf.o OBJS-$(CONFIG_CBS_AV1) += cbs_av1.o OBJS-$(CONFIG_CBS_H264) += cbs_h2645.o cbs_sei.o h2645_parse.o OBJS-$(CONFIG_CBS_H265) += cbs_h2645.o cbs_sei.o h2645_parse.o +OBJS-$(CONFIG_CBS_H266) += cbs_h2645.o cbs_sei.o h2645_parse.o OBJS-$(CONFIG_CBS_JPEG) += cbs_jpeg.o OBJS-$(CONFIG_CBS_MPEG2) += cbs_mpeg2.o OBJS-$(CONFIG_CBS_VP9) += cbs_vp9.o diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c index 8d6e3c3442..f01726aa37 100644 --- a/libavcodec/cbs.c +++ b/libavcodec/cbs.c @@ -40,6 +40,9 @@ static const CodedBitstreamType *const cbs_type_table[] = { #if CONFIG_CBS_H265 &ff_cbs_type_h265, #endif +#if CONFIG_CBS_H266 + &ff_cbs_type_h266, +#endif #if CONFIG_CBS_JPEG &ff_cbs_type_jpeg, #endif @@ -61,6 +64,9 @@ const enum AVCodecID ff_cbs_all_codec_ids[] = { #if CONFIG_CBS_H265 AV_CODEC_ID_H265, #endif +#if CONFIG_CBS_H266 + AV_CODEC_ID_H266, +#endif #if CONFIG_CBS_JPEG AV_CODEC_ID_MJPEG, #endif diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h index 5ccba3c901..b741030da4 100644 --- a/libavcodec/cbs_internal.h +++ b/libavcodec/cbs_internal.h @@ -45,7 +45,7 @@ enum CBSContentType { enum { // Maximum number of unit types described by the same unit type // descriptor. - CBS_MAX_UNIT_TYPES = 3, + CBS_MAX_UNIT_TYPES = 8, // Maximum number of reference buffer offsets in any one unit. CBS_MAX_REF_OFFSETS = 2, // Special value used in a unit type descriptor to indicate that it @@ -242,6 +242,7 @@ int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, extern const CodedBitstreamType ff_cbs_type_av1; extern const CodedBitstreamType ff_cbs_type_h264; extern const CodedBitstreamType ff_cbs_type_h265; +extern const CodedBitstreamType ff_cbs_type_h266; extern const CodedBitstreamType ff_cbs_type_jpeg; extern const CodedBitstreamType ff_cbs_type_mpeg2; extern const CodedBitstreamType ff_cbs_type_vp9;