diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2020-10-17 18:16:54 +0200 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2020-11-11 18:36:09 +0100 |
commit | ac5b45abab3815c36c9110f979b547b2189e739d (patch) | |
tree | c105af0b35b3650baf8a8021748e8bc6ef6a11fc /libavcodec/av1dec.c | |
parent | 72982f8cb5dad6252a14226d28128313eed4a5ff (diff) | |
download | ffmpeg-ac5b45abab3815c36c9110f979b547b2189e739d.tar.gz |
avcodec/nvdec: add av1 hwaccel
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Co-authored-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/av1dec.c')
-rw-r--r-- | libavcodec/av1dec.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 7185ad827c..1078f708f7 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -317,7 +317,7 @@ static int get_pixel_format(AVCodecContext *avctx) uint8_t bit_depth; int ret; enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE; -#define HWACCEL_MAX (CONFIG_AV1_VAAPI_HWACCEL) +#define HWACCEL_MAX (CONFIG_AV1_NVDEC_HWACCEL + CONFIG_AV1_VAAPI_HWACCEL) enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts; if (seq->seq_profile == 2 && seq->color_config.high_bitdepth) @@ -380,11 +380,17 @@ static int get_pixel_format(AVCodecContext *avctx) switch (s->pix_fmt) { case AV_PIX_FMT_YUV420P: +#if CONFIG_AV1_NVDEC_HWACCEL + *fmtp++ = AV_PIX_FMT_CUDA; +#endif #if CONFIG_AV1_VAAPI_HWACCEL *fmtp++ = AV_PIX_FMT_VAAPI; #endif break; case AV_PIX_FMT_YUV420P10: +#if CONFIG_AV1_NVDEC_HWACCEL + *fmtp++ = AV_PIX_FMT_CUDA; +#endif #if CONFIG_AV1_VAAPI_HWACCEL *fmtp++ = AV_PIX_FMT_VAAPI; #endif @@ -968,6 +974,9 @@ AVCodec ff_av1_decoder = { .flush = av1_decode_flush, .profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), .hw_configs = (const AVCodecHWConfigInternal * []) { +#if CONFIG_AV1_NVDEC_HWACCEL + HWACCEL_NVDEC(av1), +#endif #if CONFIG_AV1_VAAPI_HWACCEL HWACCEL_VAAPI(av1), #endif |