changeset 638:0012f75c92bb libavcodec

altivec build tidyup patch by (Brian Foley <bfoley at compsoc dot nuigalway dot ie>)
author michaelni
date Mon, 02 Sep 2002 08:48:12 +0000
parents de12d5b9c9ad
children f449913e8419
files Makefile dsputil.c dsputil.h ppc/dsputil_altivec.c ppc/dsputil_altivec.h ppc/dsputil_ppc.c
diffstat 6 files changed, 31 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sun Sep 01 20:54:38 2002 +0000
+++ b/Makefile	Mon Sep 02 08:48:12 2002 +0000
@@ -73,6 +73,10 @@
 endif
 
 ifeq ($(TARGET_ARCH_POWERPC),yes)
+OBJS += ppc/dsputil_ppc.o
+endif
+
+ifeq ($(TARGET_ALTIVEC),yes)
 CFLAGS += -faltivec
 OBJS += ppc/dsputil_altivec.o
 endif
--- a/dsputil.c	Sun Sep 01 20:54:38 2002 +0000
+++ b/dsputil.c	Mon Sep 02 08:48:12 2002 +0000
@@ -1340,9 +1340,7 @@
     use_permuted_idct = 0;
 #endif
 #ifdef ARCH_POWERPC
-#ifdef CONFIG_DARWIN
-    dsputil_init_altivec();
-#endif
+    dsputil_init_ppc();
 #endif
 
 #ifdef SIMPLE_IDCT
--- a/dsputil.h	Sun Sep 01 20:54:38 2002 +0000
+++ b/dsputil.h	Mon Sep 02 08:48:12 2002 +0000
@@ -167,9 +167,7 @@
 #define emms_c()
 #define __align8 __attribute__ ((aligned (16)))
 
-#ifdef CONFIG_DARWIN
-void dsputil_init_altivec(void);
-#endif
+void dsputil_init_ppc(void);
 
 #else
 
--- a/ppc/dsputil_altivec.c	Sun Sep 01 20:54:38 2002 +0000
+++ b/ppc/dsputil_altivec.c	Mon Sep 02 08:48:12 2002 +0000
@@ -127,15 +127,6 @@
     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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ppc/dsputil_altivec.h	Mon Sep 02 08:48:12 2002 +0000
@@ -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);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ppc/dsputil_ppc.c	Mon Sep 02 08:48:12 2002 +0000
@@ -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 */
+    }
+}