[FFmpeg-devel] [PATCH v1 03/11] avcodec: enable cbs for H266/VVC
thomas.ff at spin-digital.com
thomas.ff at spin-digital.com
Wed Oct 19 10:25:00 EEST 2022
From: Thomas Siedel <thomas.ff at 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 at 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
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;
--
2.25.1
More information about the ffmpeg-devel
mailing list