Commit 1178baba authored by James Almer's avatar James Almer

Merge commit 'b90fdb2c'

* commit 'b90fdb2c':
  hevcdec: add a CUVID hwaccel

Adapted for ffmpeg by Timo Rothenpieler.
Merged-by: 's avatarJames Almer <jamrial@gmail.com>
parents ec54df7d b90fdb2c
...@@ -13,7 +13,7 @@ version <next>: ...@@ -13,7 +13,7 @@ version <next>:
- PCE support for extended channel layouts in the AAC encoder - PCE support for extended channel layouts in the AAC encoder
- native aptX encoder and decoder - native aptX encoder and decoder
- Raw aptX muxer and demuxer - Raw aptX muxer and demuxer
- NVIDIA NVDEC-accelerated H.264 hwaccel decoding - NVIDIA NVDEC-accelerated H.264 and HEVC hwaccel decoding
version 3.4: version 3.4:
......
...@@ -2692,6 +2692,8 @@ hevc_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_HEVC" ...@@ -2692,6 +2692,8 @@ hevc_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
hevc_d3d11va2_hwaccel_select="hevc_decoder" hevc_d3d11va2_hwaccel_select="hevc_decoder"
hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC" hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
hevc_dxva2_hwaccel_select="hevc_decoder" hevc_dxva2_hwaccel_select="hevc_decoder"
hevc_nvdec_hwaccel_deps="cuda nvdec"
hevc_nvdec_hwaccel_select="hevc_decoder"
hevc_qsv_hwaccel_deps="libmfx" hevc_qsv_hwaccel_deps="libmfx"
hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC" hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
hevc_vaapi_hwaccel_select="hevc_decoder" hevc_vaapi_hwaccel_select="hevc_decoder"
......
...@@ -846,6 +846,7 @@ OBJS-$(CONFIG_H264_VDPAU_HWACCEL) += vdpau_h264.o ...@@ -846,6 +846,7 @@ OBJS-$(CONFIG_H264_VDPAU_HWACCEL) += vdpau_h264.o
OBJS-$(CONFIG_H264_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o OBJS-$(CONFIG_H264_VIDEOTOOLBOX_HWACCEL) += videotoolbox.o
OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL) += dxva2_hevc.o OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL) += dxva2_hevc.o
OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o
OBJS-$(CONFIG_HEVC_NVDEC_HWACCEL) += nvdec_hevc.o
OBJS-$(CONFIG_HEVC_QSV_HWACCEL) += qsvdec_h2645.o OBJS-$(CONFIG_HEVC_QSV_HWACCEL) += qsvdec_h2645.o
OBJS-$(CONFIG_HEVC_VAAPI_HWACCEL) += vaapi_hevc.o OBJS-$(CONFIG_HEVC_VAAPI_HWACCEL) += vaapi_hevc.o
OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o
......
...@@ -79,6 +79,7 @@ static void register_all(void) ...@@ -79,6 +79,7 @@ static void register_all(void)
REGISTER_HWACCEL(HEVC_D3D11VA, hevc_d3d11va); REGISTER_HWACCEL(HEVC_D3D11VA, hevc_d3d11va);
REGISTER_HWACCEL(HEVC_D3D11VA2, hevc_d3d11va2); REGISTER_HWACCEL(HEVC_D3D11VA2, hevc_d3d11va2);
REGISTER_HWACCEL(HEVC_DXVA2, hevc_dxva2); REGISTER_HWACCEL(HEVC_DXVA2, hevc_dxva2);
REGISTER_HWACCEL(HEVC_NVDEC, hevc_nvdec);
REGISTER_HWACCEL(HEVC_MEDIACODEC, hevc_mediacodec); REGISTER_HWACCEL(HEVC_MEDIACODEC, hevc_mediacodec);
REGISTER_HWACCEL(HEVC_QSV, hevc_qsv); REGISTER_HWACCEL(HEVC_QSV, hevc_qsv);
REGISTER_HWACCEL(HEVC_VAAPI, hevc_vaapi); REGISTER_HWACCEL(HEVC_VAAPI, hevc_vaapi);
......
...@@ -354,6 +354,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) ...@@ -354,6 +354,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
{ {
#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + \ #define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + \
CONFIG_HEVC_D3D11VA_HWACCEL * 2 + \ CONFIG_HEVC_D3D11VA_HWACCEL * 2 + \
CONFIG_HEVC_NVDEC_HWACCEL + \
CONFIG_HEVC_VAAPI_HWACCEL + \ CONFIG_HEVC_VAAPI_HWACCEL + \
CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL + \ CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL + \
CONFIG_HEVC_VDPAU_HWACCEL) CONFIG_HEVC_VDPAU_HWACCEL)
...@@ -375,6 +376,9 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) ...@@ -375,6 +376,9 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
#if CONFIG_HEVC_VDPAU_HWACCEL #if CONFIG_HEVC_VDPAU_HWACCEL
*fmt++ = AV_PIX_FMT_VDPAU; *fmt++ = AV_PIX_FMT_VDPAU;
#endif #endif
#if CONFIG_HEVC_NVDEC_HWACCEL
*fmt++ = AV_PIX_FMT_CUDA;
#endif
#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL #if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
*fmt++ = AV_PIX_FMT_VIDEOTOOLBOX; *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
#endif #endif
...@@ -392,6 +396,9 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) ...@@ -392,6 +396,9 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
#endif #endif
#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL #if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
*fmt++ = AV_PIX_FMT_VIDEOTOOLBOX; *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
#endif
#if CONFIG_HEVC_NVDEC_HWACCEL
*fmt++ = AV_PIX_FMT_CUDA;
#endif #endif
break; break;
} }
......
...@@ -53,6 +53,7 @@ static int map_avcodec_id(enum AVCodecID id) ...@@ -53,6 +53,7 @@ static int map_avcodec_id(enum AVCodecID id)
{ {
switch (id) { switch (id) {
case AV_CODEC_ID_H264: return cudaVideoCodec_H264; case AV_CODEC_ID_H264: return cudaVideoCodec_H264;
case AV_CODEC_ID_HEVC: return cudaVideoCodec_HEVC;
} }
return -1; return -1;
} }
......
This diff is collapsed.
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