[FFmpeg-cvslog] Merge commit 'e0b164576f7467b7b1127c18175e215dc1df011f'

Clément Bœsch git at videolan.org
Sat Apr 1 12:23:03 EEST 2017


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sat Apr  1 11:17:24 2017 +0200| [e06b8b07d5996bbc56226f01faba6b6495dbaa12] | committer: Clément Bœsch

Merge commit 'e0b164576f7467b7b1127c18175e215dc1df011f'

* commit 'e0b164576f7467b7b1127c18175e215dc1df011f':
  qsv: Add VP8 decoder

Merged-by: Clément Bœsch <u at pkh.me>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e06b8b07d5996bbc56226f01faba6b6495dbaa12
---

 configure                 |  3 +++
 libavcodec/Makefile       |  1 +
 libavcodec/allcodecs.c    |  2 ++
 libavcodec/qsv.c          |  8 ++++++++
 libavcodec/qsvdec_other.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++-
 5 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 292766a..b6eb1f9 100755
--- a/configure
+++ b/configure
@@ -2730,6 +2730,7 @@ vp9_cuvid_hwaccel_deps="cuda cuvid"
 vp9_cuvid_hwaccel_select="vp9_cuvid_decoder"
 vp8_mediacodec_decoder_deps="mediacodec"
 vp8_mediacodec_hwaccel_deps="mediacodec"
+vp8_qsv_hwaccel_deps="libmfx"
 vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
 vp9_d3d11va_hwaccel_select="vp9_decoder"
 vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
@@ -2792,6 +2793,8 @@ nvenc_hevc_encoder_deps="nvenc"
 
 vc1_cuvid_decoder_deps="cuda cuvid"
 vp8_cuvid_decoder_deps="cuda cuvid"
+vp8_qsv_decoder_deps="libmfx"
+vp8_qsv_decoder_select="qsvdec vp8_qsv_hwaccel vp8_parser"
 vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
 vp8_vaapi_encoder_select="vaapi_encode"
 vp9_cuvid_decoder_deps="cuda cuvid"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index c12db91..7414d93 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -609,6 +609,7 @@ OBJS-$(CONFIG_VP7_DECODER)             += vp8.o vp56rac.o
 OBJS-$(CONFIG_VP8_DECODER)             += vp8.o vp56rac.o
 OBJS-$(CONFIG_VP8_CUVID_DECODER)       += cuvid.o
 OBJS-$(CONFIG_VP8_MEDIACODEC_DECODER)  += mediacodecdec.o
+OBJS-$(CONFIG_VP8_QSV_DECODER)         += qsvdec_other.o
 OBJS-$(CONFIG_VP8_VAAPI_ENCODER)       += vaapi_encode_vp8.o
 OBJS-$(CONFIG_VP9_DECODER)             += vp9.o vp9data.o vp9dsp.o vp9lpf.o vp9recon.o \
                                           vp9block.o vp9prob.o vp9mvs.o vp56rac.o \
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index b7d03ad..4df4772 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -111,6 +111,7 @@ static void register_all(void)
     REGISTER_HWACCEL(VC1_QSV,           vc1_qsv);
     REGISTER_HWACCEL(VP8_CUVID,         vp8_cuvid);
     REGISTER_HWACCEL(VP8_MEDIACODEC,    vp8_mediacodec);
+    REGISTER_HWACCEL(VP8_QSV,           vp8_qsv);
     REGISTER_HWACCEL(VP9_CUVID,         vp9_cuvid);
     REGISTER_HWACCEL(VP9_D3D11VA,       vp9_d3d11va);
     REGISTER_HWACCEL(VP9_DXVA2,         vp9_dxva2);
@@ -668,6 +669,7 @@ static void register_all(void)
     REGISTER_DECODER(VC1_CUVID,         vc1_cuvid);
     REGISTER_DECODER(VP8_CUVID,         vp8_cuvid);
     REGISTER_DECODER(VP8_MEDIACODEC,    vp8_mediacodec);
+    REGISTER_DECODER(VP8_QSV,           vp8_qsv);
     REGISTER_ENCODER(VP8_VAAPI,         vp8_vaapi);
     REGISTER_DECODER(VP9_CUVID,         vp9_cuvid);
     REGISTER_DECODER(VP9_MEDIACODEC,    vp9_mediacodec);
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 57ccbe9..dfc1536 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -34,6 +34,10 @@
 #include "avcodec.h"
 #include "qsv_internal.h"
 
+#if QSV_VERSION_ATLEAST(1, 12)
+#include "mfx/mfxvp8.h"
+#endif
+
 int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
 {
     switch (codec_id) {
@@ -48,6 +52,10 @@ int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
         return MFX_CODEC_MPEG2;
     case AV_CODEC_ID_VC1:
         return MFX_CODEC_VC1;
+#if QSV_VERSION_ATLEAST(1, 12)
+    case AV_CODEC_ID_VP8:
+        return MFX_CODEC_VP8;
+#endif
     default:
         break;
     }
diff --git a/libavcodec/qsvdec_other.c b/libavcodec/qsvdec_other.c
index 7c2f4f0..b94093d 100644
--- a/libavcodec/qsvdec_other.c
+++ b/libavcodec/qsvdec_other.c
@@ -1,5 +1,5 @@
 /*
- * Intel MediaSDK QSV based MPEG-2 and VC-1 decoders
+ * Intel MediaSDK QSV based MPEG-2, VC-1 and VP8 decoders
  *
  * copyright (c) 2015 Anton Khirnov
  *
@@ -74,6 +74,17 @@ static av_cold int qsv_decode_init(AVCodecContext *avctx)
     QSVOtherContext *s = avctx->priv_data;
     int ret;
 
+#if CONFIG_VP8_QSV_DECODER
+    if (avctx->codec_id == AV_CODEC_ID_VP8) {
+        static const char *uid_vp8dec_hw = "f622394d8d87452f878c51f2fc9b4131";
+
+        av_freep(&s->qsv.load_plugins);
+        s->qsv.load_plugins = av_strdup(uid_vp8dec_hw);
+        if (!s->qsv.load_plugins)
+            return AVERROR(ENOMEM);
+    }
+#endif
+
     s->packet_fifo = av_fifo_alloc(sizeof(AVPacket));
     if (!s->packet_fifo) {
         ret = AVERROR(ENOMEM);
@@ -216,3 +227,38 @@ AVCodec ff_vc1_qsv_decoder = {
                                                     AV_PIX_FMT_NONE },
 };
 #endif
+
+#if CONFIG_VP8_QSV_HWACCEL
+AVHWAccel ff_vp8_qsv_hwaccel = {
+    .name           = "vp8_qsv",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = AV_CODEC_ID_VP8,
+    .pix_fmt        = AV_PIX_FMT_QSV,
+};
+#endif
+
+#if CONFIG_VP8_QSV_DECODER
+static const AVClass vp8_qsv_class = {
+    .class_name = "vp8_qsv",
+    .item_name  = av_default_item_name,
+    .option     = options,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_vp8_qsv_decoder = {
+    .name           = "vp8_qsv",
+    .long_name      = NULL_IF_CONFIG_SMALL("VP8 video (Intel Quick Sync Video acceleration)"),
+    .priv_data_size = sizeof(QSVOtherContext),
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = AV_CODEC_ID_VP8,
+    .init           = qsv_decode_init,
+    .decode         = qsv_decode_frame,
+    .flush          = qsv_decode_flush,
+    .close          = qsv_decode_close,
+    .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING,
+    .priv_class     = &vp8_qsv_class,
+    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
+                                                    AV_PIX_FMT_QSV,
+                                                    AV_PIX_FMT_NONE },
+};
+#endif


======================================================================

diff --cc configure
index 292766a,b4e2792..b6eb1f9
--- a/configure
+++ b/configure
@@@ -2717,28 -2185,13 +2717,29 @@@ vc1_mmal_decoder_deps="mmal
  vc1_mmal_decoder_select="mmal"
  vc1_mmal_hwaccel_deps="mmal"
  vc1_qsv_hwaccel_deps="libmfx"
 +vc1_qsv_hwaccel_select="qsvdec_vc1"
  vc1_vaapi_hwaccel_deps="vaapi"
  vc1_vaapi_hwaccel_select="vc1_decoder"
 +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"
 +vp8_cuvid_hwaccel_select="vp8_cuvid_decoder"
 +vp9_cuvid_hwaccel_deps="cuda cuvid"
 +vp9_cuvid_hwaccel_select="vp9_cuvid_decoder"
 +vp8_mediacodec_decoder_deps="mediacodec"
 +vp8_mediacodec_hwaccel_deps="mediacodec"
+ vp8_qsv_hwaccel_deps="libmfx"
 -vp8_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferVP8"
 -vp8_vaapi_hwaccel_select="vp8_decoder"
 +vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
 +vp9_d3d11va_hwaccel_select="vp9_decoder"
 +vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
 +vp9_dxva2_hwaccel_select="vp9_decoder"
 +vp9_mediacodec_decoder_deps="mediacodec"
 +vp9_mediacodec_hwaccel_deps="mediacodec"
 +vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9_bit_depth"
 +vp9_vaapi_hwaccel_select="vp9_decoder"
 +wmv3_crystalhd_decoder_select="crystalhd"
  wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
  wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
@@@ -2790,12 -2236,6 +2791,14 @@@ mpeg4_cuvid_decoder_deps="cuda cuvid
  nvenc_h264_encoder_deps="nvenc"
  nvenc_hevc_encoder_deps="nvenc"
  
 +vc1_cuvid_decoder_deps="cuda cuvid"
 +vp8_cuvid_decoder_deps="cuda cuvid"
++vp8_qsv_decoder_deps="libmfx"
++vp8_qsv_decoder_select="qsvdec vp8_qsv_hwaccel vp8_parser"
 +vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
 +vp8_vaapi_encoder_select="vaapi_encode"
 +vp9_cuvid_decoder_deps="cuda cuvid"
 +
  # parsers
  h264_parser_select="golomb h264dsp h264parse"
  hevc_parser_select="golomb"
diff --cc libavcodec/Makefile
index c12db91,f0752a2..7414d93
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@@ -607,21 -476,12 +607,22 @@@ OBJS-$(CONFIG_VP6_DECODER)             
                                            vp6dsp.o vp56rac.o
  OBJS-$(CONFIG_VP7_DECODER)             += vp8.o vp56rac.o
  OBJS-$(CONFIG_VP8_DECODER)             += vp8.o vp56rac.o
 +OBJS-$(CONFIG_VP8_CUVID_DECODER)       += cuvid.o
 +OBJS-$(CONFIG_VP8_MEDIACODEC_DECODER)  += mediacodecdec.o
+ OBJS-$(CONFIG_VP8_QSV_DECODER)         += qsvdec_other.o
 -OBJS-$(CONFIG_VP9_DECODER)             += vp9.o vp9data.o vp9dsp.o \
 -                                          vp9block.o vp9prob.o vp9mvs.o vp56rac.o
 +OBJS-$(CONFIG_VP8_VAAPI_ENCODER)       += vaapi_encode_vp8.o
 +OBJS-$(CONFIG_VP9_DECODER)             += vp9.o vp9data.o vp9dsp.o vp9lpf.o vp9recon.o \
 +                                          vp9block.o vp9prob.o vp9mvs.o vp56rac.o \
 +                                          vp9dsp_8bpp.o vp9dsp_10bpp.o vp9dsp_12bpp.o
 +OBJS-$(CONFIG_VP9_CUVID_DECODER)       += cuvid.o
 +OBJS-$(CONFIG_VP9_MEDIACODEC_DECODER)  += mediacodecdec.o
 +OBJS-$(CONFIG_VPLAYER_DECODER)         += textdec.o ass.o
  OBJS-$(CONFIG_VQA_DECODER)             += vqavideo.o
  OBJS-$(CONFIG_WAVPACK_DECODER)         += wavpack.o
 +OBJS-$(CONFIG_WAVPACK_ENCODER)         += wavpackenc.o
  OBJS-$(CONFIG_WEBP_DECODER)            += webp.o
 +OBJS-$(CONFIG_WEBVTT_DECODER)          += webvttdec.o ass.o
 +OBJS-$(CONFIG_WEBVTT_ENCODER)          += webvttenc.o ass_split.o
  OBJS-$(CONFIG_WMALOSSLESS_DECODER)     += wmalosslessdec.o wma_common.o
  OBJS-$(CONFIG_WMAPRO_DECODER)          += wmaprodec.o wma.o wma_common.o
  OBJS-$(CONFIG_WMAV1_DECODER)           += wmadec.o wma.o wma_common.o aactab.o
diff --cc libavcodec/allcodecs.c
index b7d03ad,591fd87..4df4772
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@@ -108,14 -94,9 +108,15 @@@ static void register_all(void
      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(VP8_MEDIACODEC,    vp8_mediacodec);
+     REGISTER_HWACCEL(VP8_QSV,           vp8_qsv);
 -    REGISTER_HWACCEL(VP8_VAAPI,         vp8_vaapi);
 +    REGISTER_HWACCEL(VP9_CUVID,         vp9_cuvid);
 +    REGISTER_HWACCEL(VP9_D3D11VA,       vp9_d3d11va);
 +    REGISTER_HWACCEL(VP9_DXVA2,         vp9_dxva2);
 +    REGISTER_HWACCEL(VP9_MEDIACODEC,    vp9_mediacodec);
 +    REGISTER_HWACCEL(VP9_VAAPI,         vp9_vaapi);
      REGISTER_HWACCEL(WMV3_D3D11VA,      wmv3_d3d11va);
      REGISTER_HWACCEL(WMV3_DXVA2,        wmv3_dxva2);
      REGISTER_HWACCEL(WMV3_VAAPI,        wmv3_vaapi);
@@@ -656,21 -502,13 +657,22 @@@
      REGISTER_ENCODER(HEVC_NVENC,        hevc_nvenc);
      REGISTER_ENCODER(HEVC_QSV,          hevc_qsv);
      REGISTER_ENCODER(HEVC_VAAPI,        hevc_vaapi);
 +    REGISTER_ENCODER(LIBKVAZAAR,        libkvazaar);
 +    REGISTER_DECODER(MJPEG_CUVID,       mjpeg_cuvid);
      REGISTER_ENCODER(MJPEG_VAAPI,       mjpeg_vaapi);
 +    REGISTER_DECODER(MPEG1_CUVID,       mpeg1_cuvid);
 +    REGISTER_DECODER(MPEG2_CUVID,       mpeg2_cuvid);
      REGISTER_ENCODER(MPEG2_QSV,         mpeg2_qsv);
 -    REGISTER_ENCODER(MPEG4_OMX,         mpeg4_omx);
 -#if FF_API_NVENC_OLD_NAME
 -    REGISTER_ENCODER(NVENC_H264,        nvenc_h264);
 -    REGISTER_ENCODER(NVENC_HEVC,        nvenc_hevc);
 -#endif
 +    REGISTER_ENCODER(MPEG2_VAAPI,       mpeg2_vaapi);
 +    REGISTER_DECODER(MPEG4_CUVID,       mpeg4_cuvid);
 +    REGISTER_DECODER(MPEG4_MEDIACODEC,  mpeg4_mediacodec);
 +    REGISTER_DECODER(VC1_CUVID,         vc1_cuvid);
 +    REGISTER_DECODER(VP8_CUVID,         vp8_cuvid);
 +    REGISTER_DECODER(VP8_MEDIACODEC,    vp8_mediacodec);
++    REGISTER_DECODER(VP8_QSV,           vp8_qsv);
 +    REGISTER_ENCODER(VP8_VAAPI,         vp8_vaapi);
 +    REGISTER_DECODER(VP9_CUVID,         vp9_cuvid);
 +    REGISTER_DECODER(VP9_MEDIACODEC,    vp9_mediacodec);
  
      /* parsers */
      REGISTER_PARSER(AAC,                aac);
diff --cc libavcodec/qsvdec_other.c
index 7c2f4f0,3ea1859..b94093d
--- a/libavcodec/qsvdec_other.c
+++ b/libavcodec/qsvdec_other.c
@@@ -216,3 -227,38 +227,38 @@@ AVCodec ff_vc1_qsv_decoder = 
                                                      AV_PIX_FMT_NONE },
  };
  #endif
+ 
+ #if CONFIG_VP8_QSV_HWACCEL
+ AVHWAccel ff_vp8_qsv_hwaccel = {
+     .name           = "vp8_qsv",
+     .type           = AVMEDIA_TYPE_VIDEO,
+     .id             = AV_CODEC_ID_VP8,
+     .pix_fmt        = AV_PIX_FMT_QSV,
+ };
+ #endif
+ 
+ #if CONFIG_VP8_QSV_DECODER
+ static const AVClass vp8_qsv_class = {
+     .class_name = "vp8_qsv",
+     .item_name  = av_default_item_name,
+     .option     = options,
+     .version    = LIBAVUTIL_VERSION_INT,
+ };
+ 
+ AVCodec ff_vp8_qsv_decoder = {
+     .name           = "vp8_qsv",
+     .long_name      = NULL_IF_CONFIG_SMALL("VP8 video (Intel Quick Sync Video acceleration)"),
+     .priv_data_size = sizeof(QSVOtherContext),
+     .type           = AVMEDIA_TYPE_VIDEO,
+     .id             = AV_CODEC_ID_VP8,
+     .init           = qsv_decode_init,
+     .decode         = qsv_decode_frame,
+     .flush          = qsv_decode_flush,
+     .close          = qsv_decode_close,
 -    .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
++    .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING,
+     .priv_class     = &vp8_qsv_class,
+     .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
+                                                     AV_PIX_FMT_QSV,
+                                                     AV_PIX_FMT_NONE },
+ };
+ #endif



More information about the ffmpeg-cvslog mailing list