summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorRoman Arzumanyan <rarzumanyan@nvidia.com>2020-09-03 14:52:08 +0300
committerTimo Rothenpieler <timo@rothenpieler.org>2020-10-15 21:20:40 +0200
commitb23e6ae8864baaa80d2082dbf16dec9359d2902c (patch)
tree3ea8eb641ccf78cbea5940bab4f50aae02982b89 /libavcodec
parentb7f51428b1c73ab5840485ce537ce098a85d0881 (diff)
avcodec/cuviddec: add av1 support
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/allcodecs.c1
-rw-r--r--libavcodec/cuviddec.c13
-rw-r--r--libavcodec/version.h2
3 files changed, 15 insertions, 1 deletions
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index fb8b2ad035..30bdf8921d 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -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 */
diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c
index 2d6377bc8c..ee2ecc01fe 100644
--- a/libavcodec/cuviddec.c
+++ b/libavcodec/cuviddec.c
@@ -42,6 +42,10 @@
#define cudaVideoSurfaceFormat_YUV444_16Bit 3
#endif
+#if NVDECAPI_CHECK_VERSION(11, 0)
+#define CUVID_HAS_AV1_SUPPORT
+#endif
+
typedef struct CuvidContext
{
AVClass *avclass;
@@ -940,6 +944,11 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx)
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");
return AVERROR_BUG;
@@ -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
diff --git a/libavcodec/version.h b/libavcodec/version.h
index c80fc4df86..d03d290379 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -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, \