]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/cuviddec: add av1 support
authorRoman Arzumanyan <rarzumanyan@nvidia.com>
Thu, 3 Sep 2020 11:52:08 +0000 (14:52 +0300)
committerTimo Rothenpieler <timo@rothenpieler.org>
Thu, 15 Oct 2020 19:20:40 +0000 (21:20 +0200)
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
configure
libavcodec/allcodecs.c
libavcodec/cuviddec.c
libavcodec/version.h

index 75f0a0fcaa13ddfc38cfd03ce599c20e33b8f579..273ff4b2c95f98ed969fd6ea1de4c66b337f5fe3 100755 (executable)
--- a/configure
+++ b/configure
@@ -3052,6 +3052,7 @@ nvenc_encoder_deps="nvenc"
 
 aac_mf_encoder_deps="mediafoundation"
 ac3_mf_encoder_deps="mediafoundation"
+av1_cuvid_decoder_deps="cuvid"
 h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
 h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
 h264_amf_encoder_deps="amf"
index fb8b2ad0354b178d3d0b7e9dff7c8030786d462f..30bdf8921d6bf9bc7ef7904e9e7f769eb0bb53c0 100644 (file)
@@ -769,6 +769,7 @@ extern AVCodec ff_idf_decoder;
  * above is available */
 extern AVCodec ff_aac_mf_encoder;
 extern AVCodec ff_ac3_mf_encoder;
+extern AVCodec ff_av1_cuvid_decoder;
 extern AVCodec ff_h263_v4l2m2m_encoder;
 extern AVCodec ff_libaom_av1_decoder;
 /* hwaccel hooks only, so prefer external decoders */
index 2d6377bc8c6d9db54e78c7c032d12448a8a33ea0..ee2ecc01fe4a10b23638f244cd0fd3d277dea353 100644 (file)
 #define cudaVideoSurfaceFormat_YUV444_16Bit 3
 #endif
 
+#if NVDECAPI_CHECK_VERSION(11, 0)
+#define CUVID_HAS_AV1_SUPPORT
+#endif
+
 typedef struct CuvidContext
 {
     AVClass *avclass;
@@ -939,6 +943,11 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx)
     case AV_CODEC_ID_VC1:
         ctx->cuparseinfo.CodecType = cudaVideoCodec_VC1;
         break;
+#endif
+#if CONFIG_AV1_CUVID_DECODER && defined(CUVID_HAS_AV1_SUPPORT)
+    case AV_CODEC_ID_AV1:
+        ctx->cuparseinfo.CodecType = cudaVideoCodec_AV1;
+        break;
 #endif
     default:
         av_log(avctx, AV_LOG_ERROR, "Invalid CUVID codec!\n");
@@ -1134,6 +1143,10 @@ static const AVCodecHWConfigInternal *cuvid_hw_configs[] = {
         .wrapper_name   = "cuvid", \
     };
 
+#if CONFIG_AV1_CUVID_DECODER && defined(CUVID_HAS_AV1_SUPPORT)
+DEFINE_CUVID_CODEC(av1, AV1, NULL)
+#endif
+
 #if CONFIG_HEVC_CUVID_DECODER
 DEFINE_CUVID_CODEC(hevc, HEVC, "hevc_mp4toannexb")
 #endif
index c80fc4df866a5efedd614c23be90de8e1aa67da0..d03d29037942251a0669fa6475d43dfe5c7ecc67 100644 (file)
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR 111
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \