History

lavc/qsvdec: Add QSV AV1 decoder

AV1 decoder is supported on Tiger Lake+ platforms since libmfx 1.34

Haihao Xiang committed 6 years ago

Commit cc25ae51 parent f8f23a75 files · +37 −1Browse files

Unified · Split

5 files
  1. Changelog +1 −0
  2. configure +1 −0
  3. libavcodec/allcodecs.c +1 −0
  4. libavcodec/qsv.c +4 −0
  5. libavcodec/qsvdec_other.c +30 −1
Changelog+1−0
@@ -28,6 +28,7 @@ version <next>: · 27 unmodified lines
2828 - DAT demuxer
2929 - aax demuxer
3030 - IPU decoder, parser and demuxer
31+- Intel QSV-accelerated AV1 decoding
3132
3233
3334 version 4.3:
configure+1−0
@@ -3140,6 +3140,7 @@ vp9_qsv_encoder_deps="libmfx MFX_CODEC_VP9" · 3139 unmodified lines
31403140 vp9_qsv_encoder_select="qsvenc"
31413141 vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m"
31423142 wmv3_crystalhd_decoder_select="crystalhd"
3143+av1_qsv_decoder_select="qsvdec"
31433144
31443145 # parsers
31453146 aac_parser_select="adts_header"
libavcodec/allcodecs.c+1−0
@@ -821,6 +821,7 @@ extern AVCodec ff_vp9_mediacodec_decoder; · 820 unmodified lines
821821 extern AVCodec ff_vp9_qsv_decoder;
822822 extern AVCodec ff_vp9_vaapi_encoder;
823823 extern AVCodec ff_vp9_qsv_encoder;
824+extern AVCodec ff_av1_qsv_decoder;
824825
825826 // The iterate API is not usable with ossfuzz due to the excessive size of binaries created
826827 #if CONFIG_OSSFUZZ
libavcodec/qsv.c+4−0
@@ -64,6 +64,10 @@ int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id) · 63 unmodified lines
6464 case AV_CODEC_ID_VP9:
6565 return MFX_CODEC_VP9;
6666 #endif
67+#if QSV_VERSION_ATLEAST(1, 34)
68+ case AV_CODEC_ID_AV1:
69+ return MFX_CODEC_AV1;
70+#endif
6771
6872 default:
6973 break;
libavcodec/qsvdec_other.c+30−1
@@ -1,5 +1,5 @@
11 /*
2− * Intel MediaSDK QSV based MPEG-2, VC-1, VP8, MJPEG and VP9 decoders
2+ * Intel MediaSDK QSV based MPEG-2, VC-1, VP8, MJPEG, VP9 and AV1 decoders
33 *
44 * copyright (c) 2015 Anton Khirnov
55 *
@@ -327,3 +327,32 @@ AVCodec ff_vp9_qsv_decoder = { · 321 unmodified lines
327327 .wrapper_name = "qsv",
328328 };
329329 #endif
330+
331+#if CONFIG_AV1_QSV_DECODER
332+static const AVClass av1_qsv_class = {
333+ .class_name = "av1_qsv",
334+ .item_name = av_default_item_name,
335+ .option = options,
336+ .version = LIBAVUTIL_VERSION_INT,
337+};
338+
339+AVCodec ff_av1_qsv_decoder = {
340+ .name = "av1_qsv",
341+ .long_name = NULL_IF_CONFIG_SMALL("AV1 video (Intel Quick Sync Video acceleration)"),
342+ .priv_data_size = sizeof(QSVOtherContext),
343+ .type = AVMEDIA_TYPE_VIDEO,
344+ .id = AV_CODEC_ID_AV1,
345+ .init = qsv_decode_init,
346+ .decode = qsv_decode_frame,
347+ .flush = qsv_decode_flush,
348+ .close = qsv_decode_close,
349+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HYBRID,
350+ .priv_class = &av1_qsv_class,
351+ .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
352+ AV_PIX_FMT_P010,
353+ AV_PIX_FMT_QSV,
354+ AV_PIX_FMT_NONE },
355+ .hw_configs = ff_qsv_hw_configs,
356+ .wrapper_name = "qsv",
357+};
358+#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t