[FFmpeg-devel] [PATCH v1] lavc/qsvdec: Add VVC decoder

fei.w.wang at intel.com fei.w.wang at intel.com
Wed Jun 12 03:58:32 EEST 2024


From: Fei Wang <fei.w.wang at intel.com>

Signed-off-by: Fei Wang <fei.w.wang at intel.com>
---
 Changelog              | 1 +
 configure              | 1 +
 doc/decoders.texi      | 2 +-
 libavcodec/allcodecs.c | 1 +
 libavcodec/qsv.c       | 4 ++++
 libavcodec/qsvdec.c    | 7 ++++++-
 libavcodec/version.h   | 2 +-
 7 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/Changelog b/Changelog
index 03d6b29ad8..a238a1c1f3 100644
--- a/Changelog
+++ b/Changelog
@@ -12,6 +12,7 @@ version <next>:
 - qsv_params option added for QSV encoders
 - VVC decoder compatible with DVB test content
 - xHE-AAC decoder
+- Intel QSV-accelerated VVC decoding
 
 
 version 7.0:
diff --git a/configure b/configure
index 6c5b8aab9a..b4cf12658d 100755
--- a/configure
+++ b/configure
@@ -3423,6 +3423,7 @@ av1_qsv_encoder_deps="libvpl"
 av1_amf_encoder_deps="amf"
 av1_vaapi_encoder_deps="VAEncPictureParameterBufferAV1"
 av1_vaapi_encoder_select="cbs_av1 vaapi_encode"
+vvc_qsv_decoder_select="qsvdec"
 
 # parsers
 aac_parser_select="adts_header mpeg4audio"
diff --git a/doc/decoders.texi b/doc/decoders.texi
index 293c82c2ba..2fcc761d2f 100644
--- a/doc/decoders.texi
+++ b/doc/decoders.texi
@@ -157,7 +157,7 @@ Force to use a specific number of threads
 @section QSV Decoders
 
 The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC,
-JPEG/MJPEG, VP8, VP9, AV1).
+JPEG/MJPEG, VP8, VP9, AV1, VVC).
 
 @subsection Common Options
 
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index b102a8069e..a73b4e1673 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -885,6 +885,7 @@ extern const FFCodec ff_vp9_mediacodec_encoder;
 extern const FFCodec ff_vp9_qsv_decoder;
 extern const FFCodec ff_vp9_vaapi_encoder;
 extern const FFCodec ff_vp9_qsv_encoder;
+extern const FFCodec ff_vvc_qsv_decoder;
 
 // null codecs
 extern const FFCodec ff_vnull_decoder;
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 0c6fbd0dc0..221c1b24e5 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -73,6 +73,10 @@ int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
     case AV_CODEC_ID_AV1:
         return MFX_CODEC_AV1;
 #endif
+#if QSV_VERSION_ATLEAST(2, 11)
+    case AV_CODEC_ID_VVC:
+        return MFX_CODEC_VVC;
+#endif
 
     default:
         break;
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index f2cd6ae05c..9ad3439991 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -933,7 +933,8 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q,
         frame->pict_type = ff_qsv_map_pictype(aframe.frame->dec_info.FrameType);
 
         if (avctx->codec_id == AV_CODEC_ID_H264 ||
-            avctx->codec_id == AV_CODEC_ID_HEVC) {
+            avctx->codec_id == AV_CODEC_ID_HEVC ||
+            avctx->codec_id == AV_CODEC_ID_VVC) {
             if (aframe.frame->dec_info.FrameType & MFX_FRAMETYPE_IDR)
                 frame->flags |= AV_FRAME_FLAG_KEY;
             else
@@ -1300,3 +1301,7 @@ DEFINE_QSV_DECODER(vp9, VP9, NULL)
 #if CONFIG_AV1_QSV_DECODER
 DEFINE_QSV_DECODER(av1, AV1, NULL)
 #endif
+
+#if CONFIG_VVC_QSV_DECODER
+DEFINE_QSV_DECODER(vvc, VVC, NULL)
+#endif
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 7acb261bb3..37c4c39451 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #include "version_major.h"
 
-#define LIBAVCODEC_VERSION_MINOR   7
+#define LIBAVCODEC_VERSION_MINOR   8
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-- 
2.25.1



More information about the ffmpeg-devel mailing list