Browse Source

avcodec/cuviddec: add av1 support

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
tags/n4.4
Roman Arzumanyan Timo Rothenpieler 4 years ago
parent
commit
b23e6ae886
4 changed files with 16 additions and 1 deletions
  1. +1
    -0
      configure
  2. +1
    -0
      libavcodec/allcodecs.c
  3. +13
    -0
      libavcodec/cuviddec.c
  4. +1
    -1
      libavcodec/version.h

+ 1
- 0
configure View File

@@ -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"


+ 1
- 0
libavcodec/allcodecs.c View 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 */


+ 13
- 0
libavcodec/cuviddec.c View File

@@ -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;
@@ -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


+ 1
- 1
libavcodec/version.h View 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, \


Loading…
Cancel
Save