[FFmpeg-devel] [RFC/PATCH 1/8] tidsp: add skeleton

Felipe Contreras felipe.contreras
Mon Sep 6 00:15:28 CEST 2010


Signed-off-by: Felipe Contreras <felipe.contreras at gmail.com>
---
 configure                |    1 +
 libavcodec/Makefile      |    1 +
 libavcodec/allcodecs.c   |    1 +
 libavcodec/tidsp_mpeg4.c |   40 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 43 insertions(+), 0 deletions(-)
 create mode 100644 libavcodec/tidsp_mpeg4.c

diff --git a/configure b/configure
index ae3d738..d86c1d3 100755
--- a/configure
+++ b/configure
@@ -1237,6 +1237,7 @@ mpeg2_dxva2_hwaccel_deps="dxva2api_h"
 mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
 mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
 mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
+mpeg4_tidsp_hwaccel_select="mpeg4_decoder"
 mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
 mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
 mpeg_xvmc_decoder_select="mpegvideo_decoder"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 66233d0..8dc0f6c 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -245,6 +245,7 @@ OBJS-$(CONFIG_MPEG2VIDEO_ENCODER)      += mpeg12enc.o mpegvideo_enc.o \
                                           mpeg12.o mpeg12data.o       \
                                           mpegvideo.o error_resilience.o
 OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL)     += vaapi_mpeg4.o
+OBJS-$(CONFIG_MPEG4_TIDSP_HWACCEL)     += tidsp_mpeg4.o
 OBJS-$(CONFIG_MSMPEG4V1_DECODER)       += msmpeg4.o msmpeg4data.o
 OBJS-$(CONFIG_MSMPEG4V1_ENCODER)       += msmpeg4.o msmpeg4data.o h263dec.o \
                                           h263.o ituh263dec.o mpeg4videodec.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index bf28028..d9ecabf 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -64,6 +64,7 @@ void avcodec_register_all(void)
     REGISTER_HWACCEL (VC1_VAAPI, vc1_vaapi);
     REGISTER_HWACCEL (WMV3_DXVA2, wmv3_dxva2);
     REGISTER_HWACCEL (WMV3_VAAPI, wmv3_vaapi);
+    REGISTER_HWACCEL (MPEG4_TIDSP, mpeg4_tidsp);
 
     /* video codecs */
     REGISTER_ENCODER (A64MULTI, a64multi);
diff --git a/libavcodec/tidsp_mpeg4.c b/libavcodec/tidsp_mpeg4.c
new file mode 100644
index 0000000..3c3190d
--- /dev/null
+++ b/libavcodec/tidsp_mpeg4.c
@@ -0,0 +1,40 @@
+/*
+ * MPEG-4 / H.263 HW decode acceleration through TI DSP
+ *
+ * This file is part of FFmpeg.
+ *
+ * This file may be used under the terms of the GNU Lesser General Public
+ * License version 2.1, a copy of which is found in COPYING.LGPLv2.1 included
+ * in the packaging of this file.
+ */
+
+#include "avcodec.h"
+
+static int start_frame(av_unused AVCodecContext *avctx,
+		av_unused const uint8_t *buffer,
+		av_unused uint32_t size)
+{
+	return 0;
+}
+
+static int end_frame(av_unused AVCodecContext *avctx)
+{
+	return 0;
+}
+
+static int decode_slice(av_unused AVCodecContext *avctx,
+		av_unused const uint8_t *buffer,
+		av_unused uint32_t size)
+{
+	return 0;
+}
+
+AVHWAccel mpeg4_tidsp_hwaccel = {
+	.name = "mpeg4_tidsp",
+	.type = AVMEDIA_TYPE_VIDEO,
+	.id = CODEC_ID_MPEG4,
+	.pix_fmt = PIX_FMT_YUV420P,
+	.start_frame = start_frame,
+	.end_frame = end_frame,
+	.decode_slice = decode_slice,
+};
-- 
1.7.2.2




More information about the ffmpeg-devel mailing list