Commit 88e8aef9 authored by Timo Rothenpieler's avatar Timo Rothenpieler

avcodec/cuvid: add cuvid decoder

parent 24f51361
......@@ -40,6 +40,8 @@ version <next>:
- MagicYUV decoder
- OpenExr improvements (tile data and B44/B44A support)
- BitJazz SheerVideo decoder
- CUDA CUVID H264/HEVC decoder
version 3.0:
- Common Encryption (CENC) MP4 encoding and decoding support
......
......@@ -163,6 +163,7 @@ Codecs:
cpia.c Stephan Hilb
crystalhd.c Philip Langdale
cscd.c Reimar Doeffinger
cuvid.c Timo Rothenpieler
dca.c Kostya Shishkov, Benjamin Larsson
dirac* Rostislav Pehlivanov
dnxhd* Baptiste Coudurier
......
......@@ -158,6 +158,7 @@ Hardware accelerators:
Hardware-accelerated decoding/encoding:
--enable-cuda enable dynamically linked CUDA [no]
--enable-cuvid enable CUVID support [autodetect]
--enable-libmfx enable HW acceleration through libmfx
--enable-mmal enable decoding via MMAL [no]
--enable-nvenc enable NVIDIA NVENC support [no]
......@@ -1567,6 +1568,7 @@ FEATURE_LIST="
HW_CODECS_LIST="
cuda
cuvid
libmfx
mmal
nvenc
......@@ -2522,6 +2524,7 @@ audiotoolbox_extralibs="-framework CoreFoundation -framework AudioToolbox -frame
# hardware accelerators
crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
cuvid_deps="cuda"
d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder ID3D11VideoContext"
dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
vaapi_deps="va_va_h"
......@@ -2539,6 +2542,7 @@ h263_vaapi_hwaccel_select="h263_decoder"
h263_videotoolbox_hwaccel_deps="videotoolbox"
h263_videotoolbox_hwaccel_select="h263_decoder"
h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
h264_cuvid_hwaccel_deps="cuda cuvid CUVIDH264PICPARAMS"
h264_d3d11va_hwaccel_deps="d3d11va"
h264_d3d11va_hwaccel_select="h264_decoder"
h264_dxva2_hwaccel_deps="dxva2"
......@@ -2564,6 +2568,7 @@ h264_vdpau_hwaccel_deps="vdpau"
h264_vdpau_hwaccel_select="h264_decoder"
h264_videotoolbox_hwaccel_deps="videotoolbox"
h264_videotoolbox_hwaccel_select="h264_decoder"
hevc_cuvid_hwaccel_deps="cuda cuvid CUVIDHEVCPICPARAMS"
hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
hevc_d3d11va_hwaccel_select="hevc_decoder"
hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
......@@ -2618,6 +2623,7 @@ mpeg4_videotoolbox_hwaccel_deps="videotoolbox"
mpeg4_videotoolbox_hwaccel_select="mpeg4_decoder"
msmpeg4_crystalhd_decoder_select="crystalhd"
vc1_crystalhd_decoder_select="crystalhd"
vc1_cuvid_hwaccel_deps="cuda cuvid CUVIDVC1PICPARAMS"
vc1_d3d11va_hwaccel_deps="d3d11va"
vc1_d3d11va_hwaccel_select="vc1_decoder"
vc1_dxva2_hwaccel_deps="dxva2"
......@@ -2633,6 +2639,8 @@ vc1_vdpau_decoder_deps="vdpau"
vc1_vdpau_decoder_select="vc1_decoder"
vc1_vdpau_hwaccel_deps="vdpau"
vc1_vdpau_hwaccel_select="vc1_decoder"
vp8_cuvid_hwaccel_deps="cuda cuvid CUVIDVP9PICPARAMS"
vp9_cuvid_hwaccel_deps="cuda cuvid CUVIDVP9PICPARAMS"
vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
vp9_d3d11va_hwaccel_select="vp9_decoder"
vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
......@@ -2657,6 +2665,8 @@ hwupload_cuda_filter_deps="cuda"
scale_npp_filter_deps="cuda libnpp"
nvenc_encoder_deps="nvenc"
h264_cuvid_decoder_deps="cuda cuvid CUVIDH264PICPARAMS"
h264_cuvid_decoder_select="h264_mp4toannexb_bsf h264_cuvid_hwaccel"
h264_qsv_decoder_deps="libmfx"
h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
h264_qsv_encoder_deps="libmfx"
......@@ -2664,6 +2674,8 @@ h264_qsv_encoder_select="qsvenc"
h264_vaapi_encoder_deps="VAEncPictureParameterBufferH264"
h264_vaapi_encoder_select="vaapi_encode golomb"
hevc_cuvid_decoder_deps="cuda cuvid CUVIDHEVCPICPARAMS"
hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf hevc_cuvid_hwaccel"
hevc_qsv_decoder_deps="libmfx"
hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser qsvdec hevc_qsv_hwaccel"
hevc_qsv_encoder_deps="libmfx"
......@@ -2677,6 +2689,13 @@ mpeg2_qsv_encoder_select="qsvenc"
nvenc_h264_encoder_deps="nvenc"
nvenc_hevc_encoder_deps="nvenc"
vc1_cuvid_decoder_deps="cuda cuvid CUVIDVC1PICPARAMS"
vc1_cuvid_decoder_select="vc1_cuvid_hwaccel"
vp8_cuvid_decoder_deps="cuda cuvid CUVIDVP9PICPARAMS"
vp8_cuvid_decoder_select="vp8_cuvid_hwaccel"
vp9_cuvid_decoder_deps="cuda cuvid CUVIDVP9PICPARAMS"
vp9_cuvid_decoder_select="vp9_cuvid_hwaccel"
# parsers
h264_parser_select="h264_decoder"
hevc_parser_select="golomb"
......@@ -5002,6 +5021,7 @@ die_license_disabled gpl libxvid
die_license_disabled gpl x11grab
die_license_disabled nonfree cuda
die_license_disabled nonfree cuvid
die_license_disabled nonfree libfaac
die_license_disabled nonfree libnpp
enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
......@@ -5509,6 +5529,11 @@ check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
check_type "cuviddec.h" "CUVIDH264PICPARAMS"
check_type "cuviddec.h" "CUVIDHEVCPICPARAMS"
check_type "cuviddec.h" "CUVIDVC1PICPARAMS"
check_type "cuviddec.h" "CUVIDVP9PICPARAMS"
check_cpp_condition windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" && enable winrt || disable winrt
if ! disabled w32threads && ! enabled pthreads; then
......@@ -5572,6 +5597,11 @@ for func in $COMPLEX_FUNCS; do
eval check_complexfunc $func \${${func}_args:-1}
done
# Enable CUVID by default if CUDA is enabled
if enabled cuda && ! disabled cuvid; then
enable cuvid
fi
# these are off by default, so fail if requested and not available
enabled avfoundation_indev && { check_header_objcc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
......@@ -5581,6 +5611,10 @@ enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
enabled cuda && { check_lib cuda.h cuInit -lcuda ||
die "ERROR: CUDA not found"; }
enabled cuvid && { check_lib cuviddec.h cuvidCreateDecoder -lnvcuvid ||
die "ERROR: CUVID not found"; } &&
{ enabled cuda ||
die "ERROR: CUVID requires CUDA"; }
enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
enabled coreimage_filter && { check_header_objcc QuartzCore/CoreImage.h || disable coreimage_filter; }
enabled coreimagesrc_filter && { check_header_objcc QuartzCore/CoreImage.h || disable coreimagesrc_filter; }
......
......@@ -768,12 +768,14 @@ OBJS-$(CONFIG_QSV) += qsv.o
OBJS-$(CONFIG_QSVDEC) += qsvdec.o
OBJS-$(CONFIG_QSVENC) += qsvenc.o
OBJS-$(CONFIG_H264_CUVID_DECODER) += cuvid.o
OBJS-$(CONFIG_H264_MMAL_DECODER) += mmaldec.o
OBJS-$(CONFIG_H264_VDA_DECODER) += vda_h264_dec.o
OBJS-$(CONFIG_H264_OMX_ENCODER) += omx.o
OBJS-$(CONFIG_H264_QSV_DECODER) += qsvdec_h2645.o
OBJS-$(CONFIG_H264_QSV_ENCODER) += qsvenc_h264.o
OBJS-$(CONFIG_H264_VAAPI_ENCODER) += vaapi_encode_h264.o vaapi_encode_h26x.o
OBJS-$(CONFIG_HEVC_CUVID_DECODER) += cuvid.o
OBJS-$(CONFIG_HEVC_QSV_DECODER) += qsvdec_h2645.o
OBJS-$(CONFIG_HEVC_QSV_ENCODER) += qsvenc_hevc.o hevc_ps_enc.o h2645_parse.o
OBJS-$(CONFIG_HEVC_VAAPI_ENCODER) += vaapi_encode_h265.o vaapi_encode_h26x.o
......@@ -784,6 +786,9 @@ OBJS-$(CONFIG_MPEG4_OMX_ENCODER) += omx.o
OBJS-$(CONFIG_NVENC_ENCODER) += nvenc_h264.o
OBJS-$(CONFIG_NVENC_H264_ENCODER) += nvenc_h264.o
OBJS-$(CONFIG_NVENC_HEVC_ENCODER) += nvenc_hevc.o
OBJS-$(CONFIG_VC1_CUVID_DECODER) += cuvid.o
OBJS-$(CONFIG_VP8_CUVID_DECODER) += cuvid.o
OBJS-$(CONFIG_VP9_CUVID_DECODER) += cuvid.o
# libavformat dependencies
OBJS-$(CONFIG_ISO_MEDIA) += mpeg4audio.o mpegaudiodata.o
......
......@@ -69,6 +69,7 @@ void avcodec_register_all(void)
/* hardware accelerators */
REGISTER_HWACCEL(H263_VAAPI, h263_vaapi);
REGISTER_HWACCEL(H263_VIDEOTOOLBOX, h263_videotoolbox);
REGISTER_HWACCEL(H264_CUVID, h264_cuvid);
REGISTER_HWACCEL(H264_D3D11VA, h264_d3d11va);
REGISTER_HWACCEL(H264_DXVA2, h264_dxva2);
REGISTER_HWACCEL(H264_MMAL, h264_mmal);
......@@ -78,6 +79,7 @@ void avcodec_register_all(void)
REGISTER_HWACCEL(H264_VDA_OLD, h264_vda_old);
REGISTER_HWACCEL(H264_VDPAU, h264_vdpau);
REGISTER_HWACCEL(H264_VIDEOTOOLBOX, h264_videotoolbox);
REGISTER_HWACCEL(HEVC_CUVID, hevc_cuvid);
REGISTER_HWACCEL(HEVC_D3D11VA, hevc_d3d11va);
REGISTER_HWACCEL(HEVC_DXVA2, hevc_dxva2);
REGISTER_HWACCEL(HEVC_QSV, hevc_qsv);
......@@ -98,12 +100,15 @@ void avcodec_register_all(void)
REGISTER_HWACCEL(MPEG4_VAAPI, mpeg4_vaapi);
REGISTER_HWACCEL(MPEG4_VDPAU, mpeg4_vdpau);
REGISTER_HWACCEL(MPEG4_VIDEOTOOLBOX, mpeg4_videotoolbox);
REGISTER_HWACCEL(VC1_CUVID, vc1_cuvid);
REGISTER_HWACCEL(VC1_D3D11VA, vc1_d3d11va);
REGISTER_HWACCEL(VC1_DXVA2, vc1_dxva2);
REGISTER_HWACCEL(VC1_VAAPI, vc1_vaapi);
REGISTER_HWACCEL(VC1_VDPAU, vc1_vdpau);
REGISTER_HWACCEL(VC1_MMAL, vc1_mmal);
REGISTER_HWACCEL(VC1_QSV, vc1_qsv);
REGISTER_HWACCEL(VP8_CUVID, vp8_cuvid);
REGISTER_HWACCEL(VP9_CUVID, vp9_cuvid);
REGISTER_HWACCEL(VP9_D3D11VA, vp9_d3d11va);
REGISTER_HWACCEL(VP9_DXVA2, vp9_dxva2);
REGISTER_HWACCEL(VP9_VAAPI, vp9_vaapi);
......@@ -618,6 +623,7 @@ void avcodec_register_all(void)
/* external libraries, that shouldn't be used by default if one of the
* above is available */
REGISTER_ENCODER(LIBOPENH264, libopenh264);
REGISTER_DECODER(H264_CUVID, h264_cuvid);
REGISTER_ENCODER(H264_QSV, h264_qsv);
REGISTER_ENCODER(H264_VAAPI, h264_vaapi);
REGISTER_ENCODER(H264_VIDEOTOOLBOX, h264_videotoolbox);
......@@ -625,11 +631,15 @@ void avcodec_register_all(void)
REGISTER_ENCODER(H264_OMX, h264_omx);
REGISTER_ENCODER(NVENC_H264, nvenc_h264);
REGISTER_ENCODER(NVENC_HEVC, nvenc_hevc);
REGISTER_DECODER(HEVC_CUVID, hevc_cuvid);
REGISTER_ENCODER(HEVC_QSV, hevc_qsv);
REGISTER_ENCODER(HEVC_VAAPI, hevc_vaapi);
REGISTER_ENCODER(LIBKVAZAAR, libkvazaar);
REGISTER_ENCODER(MJPEG_VAAPI, mjpeg_vaapi);
REGISTER_ENCODER(MPEG2_QSV, mpeg2_qsv);
REGISTER_DECODER(VC1_CUVID, vc1_cuvid);
REGISTER_DECODER(VP8_CUVID, vp8_cuvid);
REGISTER_DECODER(VP9_CUVID, vp9_cuvid);
/* parsers */
REGISTER_PARSER(AAC, aac);
......
This diff is collapsed.
......@@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 45
#define LIBAVCODEC_VERSION_MINOR 46
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment