[FFmpeg-devel] [PATCH 2/3] avcodec: add vvc codec id and profiles

Nuo Mi nuomi2021 at gmail.com
Sat Nov 21 03:45:09 EET 2020


---
 libavcodec/avcodec.h    | 2 ++
 libavcodec/codec_desc.c | 8 ++++++++
 libavcodec/codec_id.h   | 1 +
 libavcodec/profiles.c   | 5 +++++
 libavcodec/profiles.h   | 1 +
 5 files changed, 17 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 20af3ef00d..c120295add 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1949,6 +1949,8 @@ typedef struct AVCodecContext {
 #define FF_PROFILE_HEVC_MAIN_STILL_PICTURE          3
 #define FF_PROFILE_HEVC_REXT                        4
 
+#define FF_PROFILE_VVC_MAIN_10                      1
+
 #define FF_PROFILE_AV1_MAIN                         0
 #define FF_PROFILE_AV1_HIGH                         1
 #define FF_PROFILE_AV1_PROFESSIONAL                 2
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 3b148883b8..f74ecb5c89 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1419,6 +1419,14 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .long_name = NULL_IF_CONFIG_SMALL("AVS3-P2/IEEE1857.10"),
         .props     = AV_CODEC_PROP_LOSSY,
     },
+    {
+        .id        = AV_CODEC_ID_VVC,
+        .type      = AVMEDIA_TYPE_VIDEO,
+        .name      = "vvc",
+        .long_name = NULL_IF_CONFIG_SMALL("H.266 / VVC (Versatile Video Coding)"),
+        .props     = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
+        .profiles  = NULL_IF_CONFIG_SMALL(ff_vvc_profiles),
+    },
     {
         .id        = AV_CODEC_ID_Y41P,
         .type      = AVMEDIA_TYPE_VIDEO,
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index 668c565788..467a74817f 100644
--- a/libavcodec/codec_id.h
+++ b/libavcodec/codec_id.h
@@ -243,6 +243,7 @@ enum AVCodecID {
     AV_CODEC_ID_AVS2,
     AV_CODEC_ID_PGX,
     AV_CODEC_ID_AVS3,
+    AV_CODEC_ID_VVC,
 
     AV_CODEC_ID_Y41P = 0x8000,
     AV_CODEC_ID_AVRP,
diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c
index e59a3a5c12..cd508022c3 100644
--- a/libavcodec/profiles.c
+++ b/libavcodec/profiles.c
@@ -138,6 +138,11 @@ const AVProfile ff_vp9_profiles[] = {
     { FF_PROFILE_UNKNOWN },
 };
 
+const AVProfile ff_vvc_profiles[] = {
+    { FF_PROFILE_VVC_MAIN_10, "Main 10" },
+    { FF_PROFILE_UNKNOWN },
+};
+
 const AVProfile ff_av1_profiles[] = {
     { FF_PROFILE_AV1_MAIN,         "Main" },
     { FF_PROFILE_AV1_HIGH,         "High" },
diff --git a/libavcodec/profiles.h b/libavcodec/profiles.h
index 6baaba5701..4c15d11e37 100644
--- a/libavcodec/profiles.h
+++ b/libavcodec/profiles.h
@@ -66,6 +66,7 @@ extern const AVProfile ff_mpeg2_video_profiles[];
 extern const AVProfile ff_mpeg4_video_profiles[];
 extern const AVProfile ff_vc1_profiles[];
 extern const AVProfile ff_vp9_profiles[];
+extern const AVProfile ff_vvc_profiles[];
 extern const AVProfile ff_av1_profiles[];
 extern const AVProfile ff_sbc_profiles[];
 extern const AVProfile ff_prores_profiles[];
-- 
2.25.1



More information about the ffmpeg-devel mailing list