diff options
author | Brian Foley <bfoley@compsoc.nuigalway.ie> | 2002-09-02 08:48:12 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-09-02 08:48:12 +0000 |
commit | ab6c65f69307bff2a2d073a94b839619ab64386b (patch) | |
tree | a45a82147617f17f62aea7bf70d299623c41ecad /libavcodec | |
parent | 004c18ee9ce785c33ffedcbb3b8749f4d63a9a2a (diff) | |
download | ffmpeg-ab6c65f69307bff2a2d073a94b839619ab64386b.tar.gz |
altivec build tidyup patch by (Brian Foley <bfoley at compsoc dot nuigalway dot ie>)
Originally committed as revision 898 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/Makefile | 4 | ||||
-rw-r--r-- | libavcodec/dsputil.c | 4 | ||||
-rw-r--r-- | libavcodec/dsputil.h | 4 | ||||
-rw-r--r-- | libavcodec/ppc/dsputil_altivec.c | 9 | ||||
-rw-r--r-- | libavcodec/ppc/dsputil_altivec.h | 5 | ||||
-rw-r--r-- | libavcodec/ppc/dsputil_ppc.c | 20 |
6 files changed, 31 insertions, 15 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 2b226bc44f..31f5be28a6 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -73,6 +73,10 @@ CFLAGS += -Wa,-mpca56 -finline-limit=8000 -fforce-addr -freduce-all-givs endif ifeq ($(TARGET_ARCH_POWERPC),yes) +OBJS += ppc/dsputil_ppc.o +endif + +ifeq ($(TARGET_ALTIVEC),yes) CFLAGS += -faltivec OBJS += ppc/dsputil_altivec.o endif diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 9eae404581..b30d368de9 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -1340,9 +1340,7 @@ void dsputil_init(void) use_permuted_idct = 0; #endif #ifdef ARCH_POWERPC -#ifdef CONFIG_DARWIN - dsputil_init_altivec(); -#endif + dsputil_init_ppc(); #endif #ifdef SIMPLE_IDCT diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 27f7524049..8703203269 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -167,9 +167,7 @@ void dsputil_init_alpha(void); #define emms_c() #define __align8 __attribute__ ((aligned (16))) -#ifdef CONFIG_DARWIN -void dsputil_init_altivec(void); -#endif +void dsputil_init_ppc(void); #else diff --git a/libavcodec/ppc/dsputil_altivec.c b/libavcodec/ppc/dsputil_altivec.c index aab5ea6431..18d9d27a48 100644 --- a/libavcodec/ppc/dsputil_altivec.c +++ b/libavcodec/ppc/dsputil_altivec.c @@ -127,15 +127,6 @@ int pix_sum_altivec(UINT8 * pix, int line_size) return s; } -void dsputil_init_altivec(void) -{ - if (has_altivec()) { - pix_abs16x16 = pix_abs16x16_altivec; - pix_abs8x8 = pix_abs8x8_altivec; - pix_sum = pix_sum_altivec; - } -} - int has_altivec(void) { #if CONFIG_DARWIN diff --git a/libavcodec/ppc/dsputil_altivec.h b/libavcodec/ppc/dsputil_altivec.h new file mode 100644 index 0000000000..42c373e76b --- /dev/null +++ b/libavcodec/ppc/dsputil_altivec.h @@ -0,0 +1,5 @@ +extern int pix_abs16x16_altivec(uint8_t *pix1, uint8_t *pix2, int line_size); +extern int pix_abs8x8_altivec(uint8_t *pix1, uint8_t *pix2, int line_size); +extern int pix_sum_altivec(UINT8 * pix, int line_size); + +extern int has_altivec(void); diff --git a/libavcodec/ppc/dsputil_ppc.c b/libavcodec/ppc/dsputil_ppc.c new file mode 100644 index 0000000000..1311cc61b1 --- /dev/null +++ b/libavcodec/ppc/dsputil_ppc.c @@ -0,0 +1,20 @@ +#include "../../config.h" +#include "../dsputil.h" + +#ifdef HAVE_ALTIVEC +#include "dsputil_altivec.h" +#endif + +void dsputil_init_ppc(void) +{ +#if HAVE_ALTIVEC + if (has_altivec()) { + pix_abs16x16 = pix_abs16x16_altivec; + pix_abs8x8 = pix_abs8x8_altivec; + pix_sum = pix_sum_altivec; + } else +#endif + { + /* Non-AltiVec PPC optimisations here */ + } +} |