summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2009-07-05 20:35:02 +0000
committerDiego Biurrun <diego@biurrun.de>2009-07-05 20:35:02 +0000
commit93229681b53ce6c857f41f2e585d03512320f7aa (patch)
tree92eef5f5dda4e0c9242b52234d2df249a41e4f10 /libswscale
parent8819b9c600b0e18367ad577e634a6e0bb8879fea (diff)
Merge remaining changes to make libswscale usable in LGPL mode from trunk.
Originally committed as revision 19352 to svn://svn.ffmpeg.org/ffmpeg/branches/0.5
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/swscale.c13
-rw-r--r--libswscale/yuv2rgb.c2
2 files changed, 7 insertions, 8 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 7c335f1680..4338acee03 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -955,13 +955,12 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
//Note: we have C, X86, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one
//Plain C versions
-#if !HAVE_MMX || defined (RUNTIME_CPUDETECT) || !CONFIG_GPL
+#if ((!HAVE_MMX || !CONFIG_GPL) && !HAVE_ALTIVEC) || defined (RUNTIME_CPUDETECT)
#define COMPILE_C
#endif
#if ARCH_PPC
-#if (HAVE_ALTIVEC || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL
-#undef COMPILE_C
+#if HAVE_ALTIVEC || defined (RUNTIME_CPUDETECT)
#define COMPILE_ALTIVEC
#endif
#endif //ARCH_PPC
@@ -1637,8 +1636,8 @@ static void globalInit(void){
static SwsFunc getSwsFunc(int flags){
-#if defined(RUNTIME_CPUDETECT) && CONFIG_GPL
-#if ARCH_X86
+#if defined(RUNTIME_CPUDETECT)
+#if ARCH_X86 && CONFIG_GPL
// ordered per speed fastest first
if (flags & SWS_CPU_CAPS_MMX2)
return swScale_MMX2;
@@ -1657,7 +1656,7 @@ static SwsFunc getSwsFunc(int flags){
return swScale_C;
#endif
return swScale_C;
-#endif /* ARCH_X86 */
+#endif /* ARCH_X86 && CONFIG_GPL */
#else //RUNTIME_CPUDETECT
#if HAVE_MMX2
return swScale_MMX2;
@@ -2194,7 +2193,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
__asm__ volatile("emms\n\t"::: "memory");
#endif
-#if !defined(RUNTIME_CPUDETECT) || !CONFIG_GPL //ensure that the flags match the compiled variant if cpudetect is off
+#if !defined(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;
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
index 65af412c2c..c95d07c3e5 100644
--- a/libswscale/yuv2rgb.c
+++ b/libswscale/yuv2rgb.c
@@ -453,7 +453,7 @@ SwsFunc sws_yuv2rgb_get_func_ptr(SwsContext *c)
#if CONFIG_MLIB
t = sws_yuv2rgb_init_mlib(c);
#endif
-#if HAVE_ALTIVEC && CONFIG_GPL
+#if HAVE_ALTIVEC
if (c->flags & SWS_CPU_CAPS_ALTIVEC)
t = sws_yuv2rgb_init_altivec(c);
#endif