History

avcodec/cuviddec: add av1 support

Roman Arzumanyan committed 6 years ago

Commit b23e6ae1 parent b7f51424 files · +16 −1Browse files

Unified · Split

4 files
  1. configure +1 −0
  2. libavcodec/allcodecs.c +1 −0
  3. libavcodec/cuviddec.c +13 −0
  4. libavcodec/version.h +1 −1
configure+1−0
@@ -3052,6 +3052,7 @@ nvenc_encoder_deps="nvenc" · 3051 unmodified lines
30523052
30533053 aac_mf_encoder_deps="mediafoundation"
30543054 ac3_mf_encoder_deps="mediafoundation"
3055+av1_cuvid_decoder_deps="cuvid"
30553056 h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
30563057 h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
30573058 h264_amf_encoder_deps="amf"
libavcodec/allcodecs.c+1−0
@@ -769,6 +769,7 @@ extern AVCodec ff_idf_decoder; · 768 unmodified lines
769769 * above is available */
770770 extern AVCodec ff_aac_mf_encoder;
771771 extern AVCodec ff_ac3_mf_encoder;
772+extern AVCodec ff_av1_cuvid_decoder;
772773 extern AVCodec ff_h263_v4l2m2m_encoder;
773774 extern AVCodec ff_libaom_av1_decoder;
774775 /* hwaccel hooks only, so prefer external decoders */
libavcodec/cuviddec.c+13−0
@@ -42,6 +42,10 @@ · 41 unmodified lines
4242 #define cudaVideoSurfaceFormat_YUV444_16Bit 3
4343 #endif
4444
45+#if NVDECAPI_CHECK_VERSION(11, 0)
46+#define CUVID_HAS_AV1_SUPPORT
47+#endif
48+
4549 typedef struct CuvidContext
4650 {
4751 AVClass *avclass;
@@ -939,6 +943,11 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx) · 891 unmodified lines
939943 case AV_CODEC_ID_VC1:
940944 ctx->cuparseinfo.CodecType = cudaVideoCodec_VC1;
941945 break;
946+#endif
947+#if CONFIG_AV1_CUVID_DECODER && defined(CUVID_HAS_AV1_SUPPORT)
948+ case AV_CODEC_ID_AV1:
949+ ctx->cuparseinfo.CodecType = cudaVideoCodec_AV1;
950+ break;
942951 #endif
943952 default:
944953 av_log(avctx, AV_LOG_ERROR, "Invalid CUVID codec!\n");
@@ -1134,6 +1143,10 @@ static const AVCodecHWConfigInternal *cuvid_hw_configs[] = { · 189 unmodified lines
11341143 .wrapper_name = "cuvid", \
11351144 };
11361145
1146+#if CONFIG_AV1_CUVID_DECODER && defined(CUVID_HAS_AV1_SUPPORT)
1147+DEFINE_CUVID_CODEC(av1, AV1, NULL)
1148+#endif
1149+
11371150 #if CONFIG_HEVC_CUVID_DECODER
11381151 DEFINE_CUVID_CODEC(hevc, HEVC, "hevc_mp4toannexb")
11391152 #endif
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929
3030 #define LIBAVCODEC_VERSION_MAJOR 58
3131 #define LIBAVCODEC_VERSION_MINOR 111
32−#define LIBAVCODEC_VERSION_MICRO 100
32+#define LIBAVCODEC_VERSION_MICRO 101
3333
3434 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3535 LIBAVCODEC_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t