1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec: Add QSV VC-1 video decoder.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Ivan Uskov 2015-07-25 12:28:11 -04:00 committed by Michael Niedermayer
parent 7ec5115409
commit fb57bc6c34
6 changed files with 97 additions and 1 deletions

View File

@ -16,6 +16,7 @@ version <next>:
- removegrain video filter - removegrain video filter
- Intel QSV-accelerated MPEG-2 video and HEVC encoding - Intel QSV-accelerated MPEG-2 video and HEVC encoding
- Intel QSV-accelerated MPEG-2 video decoding - Intel QSV-accelerated MPEG-2 video decoding
- Intel QSV-accelerated VC-1 video decoding
- libkvazaar HEVC encoder - libkvazaar HEVC encoder
- erosion, dilation, deflate and inflate video filters - erosion, dilation, deflate and inflate video filters
- Dynamic Audio Normalizer as dynaudnorm filter - Dynamic Audio Normalizer as dynaudnorm filter

4
configure vendored
View File

@ -2340,6 +2340,8 @@ utvideo_encoder_select="bswapdsp huffman huffyuvencdsp"
vble_decoder_select="huffyuvdsp" vble_decoder_select="huffyuvdsp"
vc1_decoder_select="blockdsp error_resilience h263_decoder h264chroma h264qpel intrax8 mpeg_er qpeldsp startcode" vc1_decoder_select="blockdsp error_resilience h263_decoder h264chroma h264qpel intrax8 mpeg_er qpeldsp startcode"
vc1image_decoder_select="vc1_decoder" vc1image_decoder_select="vc1_decoder"
vc1_qsv_decoder_deps="libmfx"
vc1_qsv_decoder_select="qsvdec vc1_qsv_hwaccel"
vorbis_decoder_select="mdct" vorbis_decoder_select="mdct"
vorbis_encoder_select="mdct" vorbis_encoder_select="mdct"
vp3_decoder_select="hpeldsp vp3dsp videodsp" vp3_decoder_select="hpeldsp vp3dsp videodsp"
@ -2454,6 +2456,8 @@ vc1_vdpau_decoder_deps="vdpau"
vc1_vdpau_decoder_select="vc1_decoder" vc1_vdpau_decoder_select="vc1_decoder"
vc1_vdpau_hwaccel_deps="vdpau" vc1_vdpau_hwaccel_deps="vdpau"
vc1_vdpau_hwaccel_select="vc1_decoder" vc1_vdpau_hwaccel_select="vc1_decoder"
vc1_qsv_hwaccel_deps="libmfx"
vc1_qsv_hwaccel_select="qsvdec_vc1"
wmv3_crystalhd_decoder_select="crystalhd" wmv3_crystalhd_decoder_select="crystalhd"
wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel" wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel" wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"

View File

@ -521,6 +521,7 @@ OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1_block.o vc1_loopfilter.o
vc1dsp.o \ vc1dsp.o \
msmpeg4dec.o msmpeg4.o msmpeg4data.o \ msmpeg4dec.o msmpeg4.o msmpeg4data.o \
wmv2dsp.o wmv2dsp.o
OBJS-$(CONFIG_VC1_QSV_DECODER) += qsvdec_vc1.o
OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o
OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdaudio.o OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdaudio.o
OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdvideo.o OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdvideo.o

View File

@ -101,6 +101,7 @@ void avcodec_register_all(void)
REGISTER_HWACCEL(VC1_DXVA2, vc1_dxva2); REGISTER_HWACCEL(VC1_DXVA2, vc1_dxva2);
REGISTER_HWACCEL(VC1_VAAPI, vc1_vaapi); REGISTER_HWACCEL(VC1_VAAPI, vc1_vaapi);
REGISTER_HWACCEL(VC1_VDPAU, vc1_vdpau); REGISTER_HWACCEL(VC1_VDPAU, vc1_vdpau);
REGISTER_HWACCEL(VC1_QSV, vc1_qsv);
REGISTER_HWACCEL(WMV3_D3D11VA, wmv3_d3d11va); REGISTER_HWACCEL(WMV3_D3D11VA, wmv3_d3d11va);
REGISTER_HWACCEL(WMV3_DXVA2, wmv3_dxva2); REGISTER_HWACCEL(WMV3_DXVA2, wmv3_dxva2);
REGISTER_HWACCEL(WMV3_VAAPI, wmv3_vaapi); REGISTER_HWACCEL(WMV3_VAAPI, wmv3_vaapi);
@ -305,6 +306,7 @@ void avcodec_register_all(void)
REGISTER_DECODER(VC1_CRYSTALHD, vc1_crystalhd); REGISTER_DECODER(VC1_CRYSTALHD, vc1_crystalhd);
REGISTER_DECODER(VC1_VDPAU, vc1_vdpau); REGISTER_DECODER(VC1_VDPAU, vc1_vdpau);
REGISTER_DECODER(VC1IMAGE, vc1image); REGISTER_DECODER(VC1IMAGE, vc1image);
REGISTER_DECODER(VC1_QSV, vc1_qsv);
REGISTER_DECODER(VCR1, vcr1); REGISTER_DECODER(VCR1, vcr1);
REGISTER_DECODER(VMDVIDEO, vmdvideo); REGISTER_DECODER(VMDVIDEO, vmdvideo);
REGISTER_DECODER(VMNC, vmnc); REGISTER_DECODER(VMNC, vmnc);

88
libavcodec/qsvdec_vc1.c Normal file
View File

@ -0,0 +1,88 @@
/*
* Intel MediaSDK QSV based VC-1 video decoder
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdint.h>
#include <string.h>
#include "libavutil/common.h"
#include "libavutil/fifo.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "qsvdec.h"
typedef struct QSVVC1Context {
AVClass *class;
QSVContext qsv;
} QSVVC1Context;
static av_cold int qsv_decode_close(AVCodecContext *avctx)
{
QSVVC1Context *s = avctx->priv_data;
ff_qsv_decode_close(&s->qsv);
return 0;
}
static int qsv_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
QSVVC1Context *s = avctx->priv_data;
AVFrame *frame = data;
return ff_qsv_decode(avctx, &s->qsv, frame, got_frame, avpkt);
}
AVHWAccel ff_vc1_qsv_hwaccel = {
.name = "vc1_qsv",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VC1,
.pix_fmt = AV_PIX_FMT_QSV,
};
#define OFFSET(x) offsetof(QSVVC1Context, x)
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
{ "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VD },
{ NULL },
};
static const AVClass class = {
.class_name = "vc1_qsv",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
};
AVCodec ff_vc1_qsv_decoder = {
.name = "vc1_qsv",
.long_name = NULL_IF_CONFIG_SMALL("VC-1 video (Intel Quick Sync Video acceleration)"),
.priv_data_size = sizeof(QSVVC1Context),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VC1,
.init = NULL,
.decode = qsv_decode_frame,
.flush = NULL,
.close = qsv_decode_close,
.capabilities = CODEC_CAP_DELAY,
.priv_class = &class,
};

View File

@ -29,7 +29,7 @@
#include "libavutil/version.h" #include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 56 #define LIBAVCODEC_VERSION_MAJOR 56
#define LIBAVCODEC_VERSION_MINOR 53 #define LIBAVCODEC_VERSION_MINOR 54
#define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \