From 9a382f363950c0aab1500aa0937f73bf4dde9ee3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 14 Apr 2016 12:21:20 +0200 Subject: [PATCH] mmaldec: add vc1 decoding support Signed-off-by: Anton Khirnov --- Changelog | 2 +- configure | 3 +++ libavcodec/Makefile | 1 + libavcodec/allcodecs.c | 2 ++ libavcodec/mmaldec.c | 12 ++++++++++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 80d88bcd8e..d4bd9b79f0 100644 --- a/Changelog +++ b/Changelog @@ -55,7 +55,7 @@ version : - libnpp/CUDA-accelerated format conversion and scaling - VAAPI-accelerate H.264/HEVC/MJPEG encoding - Generic OpenMAX IL encoder with support for Raspberry Pi -- MMAL-accelerated MPEG-2 decoding +- MMAL-accelerated MPEG-2 and VC-1 decoding version 11: diff --git a/configure b/configure index 2941e0c088..c5272dfac1 100755 --- a/configure +++ b/configure @@ -2154,6 +2154,9 @@ vc1_vaapi_hwaccel_deps="vaapi" vc1_vaapi_hwaccel_select="vc1_decoder" vc1_vdpau_hwaccel_deps="vdpau" vc1_vdpau_hwaccel_select="vc1_decoder" +vc1_mmal_decoder_deps="mmal" +vc1_mmal_hwaccel_deps="mmal" +vc1_mmal_decoder_select="vc1_decoder" wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel" wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel" wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel" diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 227538c05a..d12c52e819 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -440,6 +440,7 @@ OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1_block.o vc1_loopfilter.o vc1_mc.o vc1_pred.o vc1.o vc1data.o \ msmpeg4dec.o msmpeg4.o msmpeg4data.o \ wmv2data.o +OBJS-$(CONFIG_VC1_MMAL_DECODER) += mmaldec.o OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdaudio.o OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdvideo.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 854a05259b..2b11ef62d3 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -93,6 +93,7 @@ void avcodec_register_all(void) REGISTER_HWACCEL(VC1_DXVA2, vc1_dxva2); REGISTER_HWACCEL(VC1_VAAPI, vc1_vaapi); REGISTER_HWACCEL(VC1_VDPAU, vc1_vdpau); + REGISTER_HWACCEL(VC1_MMAL, vc1_mmal); REGISTER_HWACCEL(WMV3_D3D11VA, wmv3_d3d11va); REGISTER_HWACCEL(WMV3_DXVA2, wmv3_dxva2); REGISTER_HWACCEL(WMV3_VAAPI, wmv3_vaapi); @@ -275,6 +276,7 @@ void avcodec_register_all(void) REGISTER_DECODER(VBLE, vble); REGISTER_DECODER(VC1, vc1); REGISTER_DECODER(VC1IMAGE, vc1image); + REGISTER_DECODER(VC1_MMAL, vc1_mmal); REGISTER_DECODER(VCR1, vcr1); REGISTER_DECODER(VMDVIDEO, vmdvideo); REGISTER_DECODER(VMNC, vmnc); diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c index 331a017910..6015e54867 100644 --- a/libavcodec/mmaldec.c +++ b/libavcodec/mmaldec.c @@ -356,6 +356,10 @@ static av_cold int ffmmal_init_decoder(AVCodecContext *avctx) format_in->encoding = MMAL_ENCODING_MP2V; av_log(avctx, AV_LOG_DEBUG, "Use MMAL MP2V encoding\n"); break; + case AV_CODEC_ID_VC1: + format_in->encoding = MMAL_ENCODING_WVC1; + av_log(avctx, AV_LOG_DEBUG, "Use MMAL WVC1 encoding\n"); + break; case AV_CODEC_ID_H264: default: format_in->encoding = MMAL_ENCODING_H264; @@ -777,6 +781,13 @@ AVHWAccel ff_mpeg2_mmal_hwaccel = { .pix_fmt = AV_PIX_FMT_MMAL, }; +AVHWAccel ff_vc1_mmal_hwaccel = { + .name = "vc1_mmal", + .type = AVMEDIA_TYPE_VIDEO, + .id = AV_CODEC_ID_VC1, + .pix_fmt = AV_PIX_FMT_MMAL, +}; + static const AVOption options[]={ {"extra_buffers", "extra buffers", offsetof(MMALDecodeContext, extra_buffers), AV_OPT_TYPE_INT, {.i64 = 10}, 0, 256, 0}, {NULL} @@ -811,3 +822,4 @@ static const AVOption options[]={ FFMMAL_DEC(h264, AV_CODEC_ID_H264) FFMMAL_DEC(mpeg2, AV_CODEC_ID_MPEG2VIDEO) +FFMMAL_DEC(vc1, AV_CODEC_ID_VC1)