mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-24 07:50:11 +01:00
avcodec: add av1 VAAPI decoder
Example cmdline: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -v verbose \ -c:v av1 -i input.ivf -pix_fmt yuv420p -vsync passthrough -f md5 \ -y out.md5 Signed-off-by: Fei Wang <fei.w.wang@intel.com>
This commit is contained in:
@@ -215,7 +215,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 (0)
|
||||
#define HWACCEL_MAX (CONFIG_AV1_VAAPI_HWACCEL)
|
||||
enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts;
|
||||
|
||||
if (seq->seq_profile == 2 && seq->color_config.high_bitdepth)
|
||||
@@ -276,6 +276,19 @@ static int get_pixel_format(AVCodecContext *avctx)
|
||||
return -1;
|
||||
s->pix_fmt = pix_fmt;
|
||||
|
||||
switch (s->pix_fmt) {
|
||||
case AV_PIX_FMT_YUV420P:
|
||||
#if CONFIG_AV1_VAAPI_HWACCEL
|
||||
*fmtp++ = AV_PIX_FMT_VAAPI;
|
||||
#endif
|
||||
break;
|
||||
case AV_PIX_FMT_YUV420P10:
|
||||
#if CONFIG_AV1_VAAPI_HWACCEL
|
||||
*fmtp++ = AV_PIX_FMT_VAAPI;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
*fmtp++ = s->pix_fmt;
|
||||
*fmtp = AV_PIX_FMT_NONE;
|
||||
|
||||
@@ -840,6 +853,9 @@ AVCodec ff_av1_decoder = {
|
||||
.flush = av1_decode_flush,
|
||||
.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles),
|
||||
.hw_configs = (const AVCodecHWConfigInternal * []) {
|
||||
#if CONFIG_AV1_VAAPI_HWACCEL
|
||||
HWACCEL_VAAPI(av1),
|
||||
#endif
|
||||
NULL
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user