Commit 1d36fa93 authored by ramiro's avatar ramiro

Do not misuse HAVE_ defines. Introduce COMPILE_TEMPLATE_ defines and use them

instead.


git-svn-id: file:///var/local/repositories/mplayer/trunk/libswscale@29446 b3059339-0415-0410-9bf9-f77b7e298cf2
parent 2b0698b4
...@@ -1324,14 +1324,10 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin ...@@ -1324,14 +1324,10 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin
#endif #endif
#endif //ARCH_X86 #endif //ARCH_X86
#undef HAVE_MMX #define COMPILE_TEMPLATE_MMX 0
#undef HAVE_MMX2 #define COMPILE_TEMPLATE_MMX2 0
#undef HAVE_AMD3DNOW #define COMPILE_TEMPLATE_AMD3DNOW 0
#undef HAVE_ALTIVEC #define COMPILE_TEMPLATE_ALTIVEC 0
#define HAVE_MMX 0
#define HAVE_MMX2 0
#define HAVE_AMD3DNOW 0
#define HAVE_ALTIVEC 0
#ifdef COMPILE_C #ifdef COMPILE_C
#define RENAME(a) a ## _C #define RENAME(a) a ## _C
...@@ -1340,8 +1336,8 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin ...@@ -1340,8 +1336,8 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin
#ifdef COMPILE_ALTIVEC #ifdef COMPILE_ALTIVEC
#undef RENAME #undef RENAME
#undef HAVE_ALTIVEC #undef COMPILE_TEMPLATE_ALTIVEC
#define HAVE_ALTIVEC 1 #define COMPILE_TEMPLATE_ALTIVEC 1
#define RENAME(a) a ## _altivec #define RENAME(a) a ## _altivec
#include "swscale_template.c" #include "swscale_template.c"
#endif #endif
...@@ -1351,12 +1347,12 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin ...@@ -1351,12 +1347,12 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin
//MMX versions //MMX versions
#ifdef COMPILE_MMX #ifdef COMPILE_MMX
#undef RENAME #undef RENAME
#undef HAVE_MMX #undef COMPILE_TEMPLATE_MMX
#undef HAVE_MMX2 #undef COMPILE_TEMPLATE_MMX2
#undef HAVE_AMD3DNOW #undef COMPILE_TEMPLATE_AMD3DNOW
#define HAVE_MMX 1 #define COMPILE_TEMPLATE_MMX 1
#define HAVE_MMX2 0 #define COMPILE_TEMPLATE_MMX2 0
#define HAVE_AMD3DNOW 0 #define COMPILE_TEMPLATE_AMD3DNOW 0
#define RENAME(a) a ## _MMX #define RENAME(a) a ## _MMX
#include "swscale_template.c" #include "swscale_template.c"
#endif #endif
...@@ -1364,12 +1360,12 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin ...@@ -1364,12 +1360,12 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin
//MMX2 versions //MMX2 versions
#ifdef COMPILE_MMX2 #ifdef COMPILE_MMX2
#undef RENAME #undef RENAME
#undef HAVE_MMX #undef COMPILE_TEMPLATE_MMX
#undef HAVE_MMX2 #undef COMPILE_TEMPLATE_MMX2
#undef HAVE_AMD3DNOW #undef COMPILE_TEMPLATE_AMD3DNOW
#define HAVE_MMX 1 #define COMPILE_TEMPLATE_MMX 1
#define HAVE_MMX2 1 #define COMPILE_TEMPLATE_MMX2 1
#define HAVE_AMD3DNOW 0 #define COMPILE_TEMPLATE_AMD3DNOW 0
#define RENAME(a) a ## _MMX2 #define RENAME(a) a ## _MMX2
#include "swscale_template.c" #include "swscale_template.c"
#endif #endif
...@@ -1377,20 +1373,18 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin ...@@ -1377,20 +1373,18 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin
//3DNOW versions //3DNOW versions
#ifdef COMPILE_3DNOW #ifdef COMPILE_3DNOW
#undef RENAME #undef RENAME
#undef HAVE_MMX #undef COMPILE_TEMPLATE_MMX
#undef HAVE_MMX2 #undef COMPILE_TEMPLATE_MMX2
#undef HAVE_AMD3DNOW #undef COMPILE_TEMPLATE_AMD3DNOW
#define HAVE_MMX 1 #define COMPILE_TEMPLATE_MMX 1
#define HAVE_MMX2 0 #define COMPILE_TEMPLATE_MMX2 0
#define HAVE_AMD3DNOW 1 #define COMPILE_TEMPLATE_AMD3DNOW 1
#define RENAME(a) a ## _3DNow #define RENAME(a) a ## _3DNow
#include "swscale_template.c" #include "swscale_template.c"
#endif #endif
#endif //ARCH_X86 #endif //ARCH_X86
// minor note: the HAVE_xyz are messed up after this line so don't use them
static double getSplineCoeff(double a, double b, double c, double d, double dist) static double getSplineCoeff(double a, double b, double c, double d, double dist)
{ {
// printf("%f %f %f %f %f\n", a,b,c,d,dist); // printf("%f %f %f %f %f\n", a,b,c,d,dist);
...@@ -2003,16 +1997,16 @@ static SwsFunc getSwsFunc(SwsContext *c) ...@@ -2003,16 +1997,16 @@ static SwsFunc getSwsFunc(SwsContext *c)
return swScale_C; return swScale_C;
#endif /* ARCH_X86 && CONFIG_GPL */ #endif /* ARCH_X86 && CONFIG_GPL */
#else //CONFIG_RUNTIME_CPUDETECT #else //CONFIG_RUNTIME_CPUDETECT
#if HAVE_MMX2 #if COMPILE_TEMPLATE_MMX2
sws_init_swScale_MMX2(c); sws_init_swScale_MMX2(c);
return swScale_MMX2; return swScale_MMX2;
#elif HAVE_AMD3DNOW #elif COMPILE_TEMPLATE_AMD3DNOW
sws_init_swScale_3DNow(c); sws_init_swScale_3DNow(c);
return swScale_3DNow; return swScale_3DNow;
#elif HAVE_MMX #elif COMPILE_TEMPLATE_MMX
sws_init_swScale_MMX(c); sws_init_swScale_MMX(c);
return swScale_MMX; return swScale_MMX;
#elif HAVE_ALTIVEC #elif COMPILE_TEMPLATE_ALTIVEC
sws_init_swScale_altivec(c); sws_init_swScale_altivec(c);
return swScale_altivec; return swScale_altivec;
#else #else
...@@ -2565,13 +2559,13 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d ...@@ -2565,13 +2559,13 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
#if !CONFIG_RUNTIME_CPUDETECT //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); flags &= ~(SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2|SWS_CPU_CAPS_3DNOW|SWS_CPU_CAPS_ALTIVEC|SWS_CPU_CAPS_BFIN);
#if HAVE_MMX2 #if COMPILE_TEMPLATE_MMX2
flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2; flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2;
#elif HAVE_AMD3DNOW #elif COMPILE_TEMPLATE_AMD3DNOW
flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_3DNOW; flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_3DNOW;
#elif HAVE_MMX #elif COMPILE_TEMPLATE_MMX
flags |= SWS_CPU_CAPS_MMX; flags |= SWS_CPU_CAPS_MMX;
#elif HAVE_ALTIVEC #elif COMPILE_TEMPLATE_ALTIVEC
flags |= SWS_CPU_CAPS_ALTIVEC; flags |= SWS_CPU_CAPS_ALTIVEC;
#elif ARCH_BFIN #elif ARCH_BFIN
flags |= SWS_CPU_CAPS_BFIN; flags |= SWS_CPU_CAPS_BFIN;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment