[FFmpeg-devel] [PATCH] QSV MJPEG video decoder has been added.

Michael Niedermayer michael at niedermayer.cc
Sun Aug 2 19:55:45 CEST 2015


On Sun, Aug 02, 2015 at 03:31:07PM +0300, Ivan Uskov wrote:
> Hello All,
> 
> The attached patch adds QSV-based mjpeg video decoder.
> Please review.
>   
> 
> -- 
> Best regards,
>  Ivan                          mailto:ivan.uskov at nablet.com

>  Changelog                 |    1 
>  configure                 |    4 ++
>  libavcodec/Makefile       |    1 
>  libavcodec/allcodecs.c    |    2 +
>  libavcodec/qsv.c          |   10 ++++-
>  libavcodec/qsvdec_mjpeg.c |   88 ++++++++++++++++++++++++++++++++++++++++++++++
>  libavcodec/version.h      |    4 +-
>  7 files changed, 107 insertions(+), 3 deletions(-)
> bb73d75e397cda2dc536765bdeb6dde07cf59458  0001-QSV-MJPEG-video-decoder-has-been-added.patch
> From a9fef261b1498a8945c1f81e08f226ead4e176fd Mon Sep 17 00:00:00 2001
> From: Ivan Uskov <ivan.uskov at nablet.com>
> Date: Sun, 2 Aug 2015 08:19:28 -0400
> Subject: [PATCH] QSV MJPEG video decoder has been added.
> 
> ---
>  Changelog                 |  1 +
>  configure                 |  4 +++
>  libavcodec/Makefile       |  1 +
>  libavcodec/allcodecs.c    |  2 ++
>  libavcodec/qsv.c          | 10 +++++-
>  libavcodec/qsvdec_mjpeg.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++
>  libavcodec/version.h      |  4 +--
>  7 files changed, 107 insertions(+), 3 deletions(-)
>  create mode 100644 libavcodec/qsvdec_mjpeg.c
> 
> diff --git a/Changelog b/Changelog
> index f41d837..0002281 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -17,6 +17,7 @@ version <next>:
>  - Intel QSV-accelerated MPEG-2 video and HEVC encoding
>  - Intel QSV-accelerated MPEG-2 video and HEVC decoding
>  - Intel QSV-accelerated VC-1 video decoding
> +- Intel QSV-accelerated MJPEG video decoding
>  - libkvazaar HEVC encoder
>  - erosion, dilation, deflate and inflate video filters
>  - Dynamic Audio Normalizer as dynaudnorm filter
> diff --git a/configure b/configure
> index f3550a0..6f5d3c8 100755
> --- a/configure
> +++ b/configure
> @@ -2254,6 +2254,8 @@ mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
>  mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables"
>  mjpeg_encoder_select="aandcttables jpegtables mpegvideoenc"
>  mjpegb_decoder_select="mjpeg_decoder"
> +mjpeg_qsv_decoder_deps="libmfx"
> +mjpeg_qsv_decoder_select="qsvdec mjpeg_qsv_hwaccel"
>  mlp_decoder_select="mlp_parser"
>  motionpixels_decoder_select="bswapdsp"
>  mp1_decoder_select="mpegaudio"
> @@ -2417,6 +2419,8 @@ hevc_dxva2_hwaccel_select="hevc_decoder"
>  hevc_qsv_hwaccel_deps="libmfx"
>  hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
>  hevc_vdpau_hwaccel_select="hevc_decoder"
> +mjpeg_qsv_hwaccel_deps="libmfx"
> +mjpeg_qsv_hwaccel_select="qsvdec_mjpeg"
>  mpeg_vdpau_decoder_deps="vdpau"
>  mpeg_vdpau_decoder_select="mpeg2video_decoder"
>  mpeg_xvmc_hwaccel_deps="xvmc"
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 7cf2403..00cfca7 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -338,6 +338,7 @@ OBJS-$(CONFIG_MIMIC_DECODER)           += mimic.o
>  OBJS-$(CONFIG_MJPEG_DECODER)           += mjpegdec.o
>  OBJS-$(CONFIG_MJPEG_ENCODER)           += mjpegenc.o mjpegenc_common.o
>  OBJS-$(CONFIG_MJPEGB_DECODER)          += mjpegbdec.o
> +OBJS-$(CONFIG_MJPEG_QSV_DECODER)       += qsvdec_mjpeg.o
>  OBJS-$(CONFIG_MLP_DECODER)             += mlpdec.o mlpdsp.o
>  OBJS-$(CONFIG_MMVIDEO_DECODER)         += mmvideo.o
>  OBJS-$(CONFIG_MOTIONPIXELS_DECODER)    += motionpixels.o
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index 417f824..6177933 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -88,6 +88,7 @@ void avcodec_register_all(void)
>      REGISTER_HWACCEL(HEVC_DXVA2,        hevc_dxva2);
>      REGISTER_HWACCEL(HEVC_QSV,          hevc_qsv);
>      REGISTER_HWACCEL(HEVC_VDPAU,        hevc_vdpau);
> +    REGISTER_HWACCEL(MJPEG_QSV,         mjpeg_qsv);
>      REGISTER_HWACCEL(MPEG1_XVMC,        mpeg1_xvmc);
>      REGISTER_HWACCEL(MPEG1_VDPAU,       mpeg1_vdpau);
>      REGISTER_HWACCEL(MPEG2_XVMC,        mpeg2_xvmc);
> @@ -213,6 +214,7 @@ void avcodec_register_all(void)
>      REGISTER_DECODER(MIMIC,             mimic);
>      REGISTER_ENCDEC (MJPEG,             mjpeg);
>      REGISTER_DECODER(MJPEGB,            mjpegb);
> +    REGISTER_DECODER(MJPEG_QSV,         mjpeg_qsv);
>      REGISTER_DECODER(MMVIDEO,           mmvideo);
>      REGISTER_DECODER(MOTIONPIXELS,      motionpixels);
>  #if FF_API_XVMC
> diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
> index 4c8e6b0..0f5c9ce 100644
> --- a/libavcodec/qsv.c
> +++ b/libavcodec/qsv.c
> @@ -20,7 +20,6 @@
>  
>  #include <mfx/mfxvideo.h>
>  #include <mfx/mfxplugin.h>
> -
>  #include <stdio.h>
>  #include <string.h>
>  
> @@ -30,6 +29,11 @@
>  #include "avcodec.h"
>  #include "qsv_internal.h"
>  
> +#if QSV_VERSION_ATLEAST(1, 3)
> +#include <mfx/mfxjpeg.h>
> +#endif

this seems not working

CC      libavcodec/qsv.o
libavcodec/qsv.c:33:25: fatal error: mfx/mfxjpeg.h: No such file or directory
 #include <mfx/mfxjpeg.h>
                         ^
compilation terminated.
common.mak:57: recipe for target 'libavcodec/qsv.o' failed
make: *** [libavcodec/qsv.o] Error 1


/usr/local/include/mfx/mfxvideo.h:#define MFX_VERSION_MAJOR 1
/usr/local/include/mfx/mfxvideo.h:#define MFX_VERSION_MINOR 10
/usr/local/include/mfxvideo.h:#define MFX_VERSION_MAJOR 1
/usr/local/include/mfxvideo.h:#define MFX_VERSION_MINOR 10

it appears the file was not in mfx_dispatch previously
so a check in confgure might be needed

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150802/a0183bfb/attachment.sig>


More information about the ffmpeg-devel mailing list