From 3d03c0a24ec27fb7e5387012e170dce00535c110 Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Mon, 13 Aug 2001 21:45:36 +0000 Subject: [PATCH] arm optimizations Originally committed as revision 82 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/Makefile | 10 ++++++++++ libavcodec/dsputil.c | 3 +++ libavcodec/dsputil.h | 13 +++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index d2be0e760..8738ddd32 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -31,6 +31,12 @@ OBJS += i386/fdctdata.o i386/cputest.o \ i386/idct_mmx.o endif +# armv4l specific stuff +ifeq ($(TARGET_ARCH_ARMV4L),yes) +ASM_OBJS += armv4l/jrevdct_arm.o +OBJS += armv4l/dsputil_arm.o +endif + SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s) LIB= libavcodec.a @@ -48,6 +54,9 @@ dsputil.o: dsputil.c dsputil.h %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< +%.o: %.S + $(CC) $(CFLAGS) -c -o $@ $< + %.o: %.s nasm -f elf -o $@ $< @@ -59,6 +68,7 @@ depend: clean: rm -f *.o *~ *.a i386/*.o i386/*~ \ + armv4l/*.o armv4l/*~ \ libac3/*.o libac3/*~ \ mpglib/*.o mpglib/*~ \ apiexample $(TESTS) diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 4cb781a82..abbca19da 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -450,4 +450,7 @@ void dsputil_init(void) #ifdef HAVE_MMX dsputil_init_mmx(); #endif +#ifdef ARCH_ARMV4L + dsputil_init_armv4l(); +#endif } diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 14613adba..80a934ccd 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -2,7 +2,6 @@ #define DSPUTIL_H #include "common.h" -#include /* dct code */ typedef short DCTELEM; @@ -75,7 +74,7 @@ static inline int block_permute_op(int j) void block_permute(INT16 *block); -#ifdef HAVE_MMX +#if defined(HAVE_MMX) #define MM_MMX 0x0001 /* standard MMX */ #define MM_3DNOW 0x0004 /* AMD 3DNOW */ @@ -102,6 +101,16 @@ static inline void emms(void) void dsputil_init_mmx(void); +#elif defined(ARCH_ARMV4L) + +#define emms_c() + +/* This is to use 4 bytes read to the IDCT pointers for some 'zero' + line ptimizations */ +#define __align8 __attribute__ ((aligned (4))) + +void dsputil_init_armv4l(void); + #else #define emms_c() -- 2.11.0