[FFmpeg-cvslog] swscale: remove AMD3DNOW "optimizations".

Ronald S. Bultje git at videolan.org
Wed May 25 06:37:11 CEST 2011


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Tue May 24 10:19:41 2011 -0400| [1dd4f4be5a82409a162b42b120fc5054fef9d899] | committer: Ronald S. Bultje

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1dd4f4be5a82409a162b42b120fc5054fef9d899
---

 libswscale/swscale.c              |   22 ----------------------
 libswscale/x86/swscale_template.c |   15 ++-------------
 2 files changed, 2 insertions(+), 35 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 4977a3a..5b71a6f 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1178,7 +1178,6 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin
 //Plain C versions
 
 #define COMPILE_TEMPLATE_MMX2 0
-#define COMPILE_TEMPLATE_AMD3DNOW 0
 #define COMPILE_TEMPLATE_ALTIVEC 0
 
 #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
 #undef RENAME
 #undef COMPILE_TEMPLATE_MMX2
-#undef COMPILE_TEMPLATE_AMD3DNOW
 #define COMPILE_TEMPLATE_MMX2 0
-#define COMPILE_TEMPLATE_AMD3DNOW 0
 #define RENAME(a) a ## _MMX
 #include "x86/swscale_template.c"
 #endif
@@ -1206,24 +1203,11 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin
 #if HAVE_MMX2
 #undef RENAME
 #undef COMPILE_TEMPLATE_MMX2
-#undef COMPILE_TEMPLATE_AMD3DNOW
 #define COMPILE_TEMPLATE_MMX2 1
-#define COMPILE_TEMPLATE_AMD3DNOW 0
 #define RENAME(a) a ## _MMX2
 #include "x86/swscale_template.c"
 #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)
 {
     int cpu_flags = av_get_cpu_flags();
@@ -1237,12 +1221,6 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
         return swScale_MMX2;
     } else
 #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 (cpu_flags & AV_CPU_FLAG_MMX) {
         sws_init_swScale_MMX(c);
diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c
index d067131..63e0f72 100644
--- a/libswscale/x86/swscale_template.c
+++ b/libswscale/x86/swscale_template.c
@@ -22,24 +22,15 @@
 
 #undef REAL_MOVNTQ
 #undef MOVNTQ
-#undef PAVGB
 #undef PREFETCH
 
-#if COMPILE_TEMPLATE_AMD3DNOW
-#define PREFETCH  "prefetch"
-#elif COMPILE_TEMPLATE_MMX2
+#if COMPILE_TEMPLATE_MMX2
 #define PREFETCH "prefetchnta"
 #else
 #define PREFETCH  " # nop"
 #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
 #define REAL_MOVNTQ(a,b) "movntq " #a ", " #b " \n\t"
 #else
 #define REAL_MOVNTQ(a,b) "movq " #a ", " #b " \n\t"
@@ -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);
 
     if (COMPILE_TEMPLATE_MMX2)      __asm__ volatile("sfence":::"memory");
-    /* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */
-    if (COMPILE_TEMPLATE_AMD3DNOW)  __asm__ volatile("femms" :::"memory");
-    else                            __asm__ volatile("emms"  :::"memory");
+    __asm__ volatile("emms"  :::"memory");
 
     /* store changed local vars back in the context */
     c->dstY= dstY;



More information about the ffmpeg-cvslog mailing list