swscale: remove AMD3DNOW "optimizations".

The functions are identical to their MMX counterparts. Thus,
pretending that swscale is highly optimized for AMD3DNOW
extensions is a poorly executed practical joke at best.
This commit is contained in:
Ronald S. Bultje 2011-05-24 10:19:41 -04:00
parent fe43d5d71e
commit 1dd4f4be5a
2 changed files with 2 additions and 35 deletions

View File

@ -1178,7 +1178,6 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin
//Plain C versions //Plain C versions
#define COMPILE_TEMPLATE_MMX2 0 #define COMPILE_TEMPLATE_MMX2 0
#define COMPILE_TEMPLATE_AMD3DNOW 0
#define COMPILE_TEMPLATE_ALTIVEC 0 #define COMPILE_TEMPLATE_ALTIVEC 0
#include "swscale_template.c" #include "swscale_template.c"
@ -1195,9 +1194,7 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin
#if HAVE_MMX #if HAVE_MMX
#undef RENAME #undef RENAME
#undef COMPILE_TEMPLATE_MMX2 #undef COMPILE_TEMPLATE_MMX2
#undef COMPILE_TEMPLATE_AMD3DNOW
#define COMPILE_TEMPLATE_MMX2 0 #define COMPILE_TEMPLATE_MMX2 0
#define COMPILE_TEMPLATE_AMD3DNOW 0
#define RENAME(a) a ## _MMX #define RENAME(a) a ## _MMX
#include "x86/swscale_template.c" #include "x86/swscale_template.c"
#endif #endif
@ -1206,24 +1203,11 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin
#if HAVE_MMX2 #if HAVE_MMX2
#undef RENAME #undef RENAME
#undef COMPILE_TEMPLATE_MMX2 #undef COMPILE_TEMPLATE_MMX2
#undef COMPILE_TEMPLATE_AMD3DNOW
#define COMPILE_TEMPLATE_MMX2 1 #define COMPILE_TEMPLATE_MMX2 1
#define COMPILE_TEMPLATE_AMD3DNOW 0
#define RENAME(a) a ## _MMX2 #define RENAME(a) a ## _MMX2
#include "x86/swscale_template.c" #include "x86/swscale_template.c"
#endif #endif
//3DNOW versions
#if HAVE_AMD3DNOW
#undef RENAME
#undef COMPILE_TEMPLATE_MMX2
#undef COMPILE_TEMPLATE_AMD3DNOW
#define COMPILE_TEMPLATE_MMX2 0
#define COMPILE_TEMPLATE_AMD3DNOW 1
#define RENAME(a) a ## _3DNow
#include "x86/swscale_template.c"
#endif
SwsFunc ff_getSwsFunc(SwsContext *c) SwsFunc ff_getSwsFunc(SwsContext *c)
{ {
int cpu_flags = av_get_cpu_flags(); int cpu_flags = av_get_cpu_flags();
@ -1237,12 +1221,6 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
return swScale_MMX2; return swScale_MMX2;
} else } else
#endif #endif
#if HAVE_AMD3DNOW
if (cpu_flags & AV_CPU_FLAG_3DNOW) {
sws_init_swScale_3DNow(c);
return swScale_3DNow;
} else
#endif
#if HAVE_MMX #if HAVE_MMX
if (cpu_flags & AV_CPU_FLAG_MMX) { if (cpu_flags & AV_CPU_FLAG_MMX) {
sws_init_swScale_MMX(c); sws_init_swScale_MMX(c);

View File

@ -22,23 +22,14 @@
#undef REAL_MOVNTQ #undef REAL_MOVNTQ
#undef MOVNTQ #undef MOVNTQ
#undef PAVGB
#undef PREFETCH #undef PREFETCH
#if COMPILE_TEMPLATE_AMD3DNOW #if COMPILE_TEMPLATE_MMX2
#define PREFETCH "prefetch"
#elif COMPILE_TEMPLATE_MMX2
#define PREFETCH "prefetchnta" #define PREFETCH "prefetchnta"
#else #else
#define PREFETCH " # nop" #define PREFETCH " # nop"
#endif #endif
#if COMPILE_TEMPLATE_MMX2
#define PAVGB(a,b) "pavgb " #a ", " #b " \n\t"
#elif COMPILE_TEMPLATE_AMD3DNOW
#define PAVGB(a,b) "pavgusb " #a ", " #b " \n\t"
#endif
#if COMPILE_TEMPLATE_MMX2 #if COMPILE_TEMPLATE_MMX2
#define REAL_MOVNTQ(a,b) "movntq " #a ", " #b " \n\t" #define REAL_MOVNTQ(a,b) "movntq " #a ", " #b " \n\t"
#else #else
@ -2559,9 +2550,7 @@ static int RENAME(swScale)(SwsContext *c, const uint8_t* src[], int srcStride[],
fillPlane(dst[3], dstStride[3], dstW, dstY-lastDstY, lastDstY, 255); fillPlane(dst[3], dstStride[3], dstW, dstY-lastDstY, lastDstY, 255);
if (COMPILE_TEMPLATE_MMX2) __asm__ volatile("sfence":::"memory"); if (COMPILE_TEMPLATE_MMX2) __asm__ volatile("sfence":::"memory");
/* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */ __asm__ volatile("emms" :::"memory");
if (COMPILE_TEMPLATE_AMD3DNOW) __asm__ volatile("femms" :::"memory");
else __asm__ volatile("emms" :::"memory");
/* store changed local vars back in the context */ /* store changed local vars back in the context */
c->dstY= dstY; c->dstY= dstY;