aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2010-08-25 14:39:11 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2010-08-25 14:39:11 +0000
commit0fc29f2708afa4bf01014667d668376e2261e0fa (patch)
tree1d4af31681b5bd74a010ce5a3e4c1aa154eaa0ef
parent8f02861636c8cd6fd4172b089d1104622ef94a0b (diff)
downloadffmpeg-0fc29f2708afa4bf01014667d668376e2261e0fa.tar.gz
swscale: simplify selection of optimizations to compile.
Originally committed as revision 32013 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
-rw-r--r--libswscale/swscale.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index fd4b3ddd44..118816a5df 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1150,30 +1150,32 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin
//Note: we have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one
//Plain C versions
-#if (!HAVE_MMX && !HAVE_ALTIVEC) || CONFIG_RUNTIME_CPUDETECT
-#define COMPILE_C 1
-#endif
-
-#if ARCH_PPC
-#if HAVE_ALTIVEC
-#define COMPILE_ALTIVEC 1
-#endif
-#endif //ARCH_PPC
-
-#if ARCH_X86
-
-#if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT
-#define COMPILE_MMX 1
-#endif
-
-#if HAVE_MMX2 || CONFIG_RUNTIME_CPUDETECT
-#define COMPILE_MMX2 1
-#endif
-
-#if (HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT
-#define COMPILE_3DNOW 1
+#if CONFIG_RUNTIME_CPUDETECT
+# define COMPILE_C 1
+# if ARCH_X86
+# define COMPILE_MMX HAVE_MMX
+# define COMPILE_MMX2 HAVE_MMX2
+# define COMPILE_3DNOW HAVE_AMD3DNOW
+# elif ARCH_PPC
+# define COMPILE_ALTIVEC HAVE_ALTIVEC
+# endif
+#else /* CONFIG_RUNTIME_CPUDETECT */
+# if ARCH_X86
+# if HAVE_MMX2
+# define COMPILE_MMX2 1
+# elif HAVE_AMD3DNOW
+# define COMPILE_3DNOW 1
+# elif HAVE_MMX
+# define COMPILE_MMX 1
+# else
+# define COMPILE_C 1
+# endif
+# elif ARCH_PPC && HAVE_ALTIVEC
+# define COMPILE_ALTIVEC 1
+# else
+# define COMPILE_C 1
+# endif
#endif
-#endif //ARCH_X86
#ifndef COMPILE_C
# define COMPILE_C 0