summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-06-25 20:06:03 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-06-25 20:06:03 +0000
commit114b73816fa0a3b5cdb7a156ebd92f91063e0c6d (patch)
treea047b806385e5ef2143303ef46009c9e106a6570
parente4ac99c4dbf09216bc5b908c3fd724226f48f6c3 (diff)
downloadmpv-114b73816fa0a3b5cdb7a156ebd92f91063e0c6d.tar.bz2
mpv-114b73816fa0a3b5cdb7a156ebd92f91063e0c6d.tar.xz
AltiVec code and runtime cpudetect do not require CONFIG_GPL.
Make sure the latter is only checked for x86 optimizations, which are GPL. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29390 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libswscale/swscale.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 29fef32ffb..31cf36ae05 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1301,7 +1301,7 @@ 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 || !CONFIG_GPL
+#if ((!HAVE_MMX || !CONFIG_GPL) && !HAVE_ALTIVEC) || CONFIG_RUNTIME_CPUDETECT
#define COMPILE_C
#endif
@@ -1972,10 +1972,10 @@ static void globalInit(void){
static SwsFunc getSwsFunc(SwsContext *c)
{
-#if CONFIG_RUNTIME_CPUDETECT && CONFIG_GPL
+#if CONFIG_RUNTIME_CPUDETECT
int flags = c->flags;
-#if ARCH_X86
+#if ARCH_X86 && CONFIG_GPL
// ordered per speed fastest first
if (flags & SWS_CPU_CAPS_MMX2) {
sws_init_swScale_MMX2(c);
@@ -2003,7 +2003,7 @@ static SwsFunc getSwsFunc(SwsContext *c)
#endif
sws_init_swScale_C(c);
return swScale_C;
-#endif /* ARCH_X86 */
+#endif /* ARCH_X86 && CONFIG_GPL */
#else //CONFIG_RUNTIME_CPUDETECT
#if HAVE_MMX2
sws_init_swScale_MMX2(c);
@@ -2565,7 +2565,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
__asm__ volatile("emms\n\t"::: "memory");
#endif
-#if !CONFIG_RUNTIME_CPUDETECT || !CONFIG_GPL //ensure that the flags match the compiled variant if cpudetect is off
+#if !CONFIG_RUNTIME_CPUDETECT //ensure that the flags match the compiled variant if cpudetect is off
flags &= ~(SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2|SWS_CPU_CAPS_3DNOW|SWS_CPU_CAPS_ALTIVEC|SWS_CPU_CAPS_BFIN);
#if HAVE_MMX2
flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2;