[MPlayer-dev-eng] [PATCH/RFC] libswscale using mmx even when disabled by configure

Rich Felker dalias at aerifal.cx
Wed Jul 19 07:13:43 CEST 2006


while testing just now, i discovered that 3 files in libswscale try to
assemble mmx code even when mmx is explicitly disabled. they're
wrongly using ARCH_X86[_64] defines instead of HAVE_{MMX|MMX2|3DNOW}
to decide what to compile. i was having trouble sorting through all
the ifdef mess so i just undefined ARCH_X86 when mmx, mmx2, and 3dnow
are all disabled. this is not really a clean fix though.

on the other hand, what about having a global --disable-asm or
--disable-arch option in the configure script to disable the setting
of the ARCH_* defines entirely?

rich

-------------- next part --------------
Index: libswscale/yuv2rgb.c
===================================================================
--- libswscale/yuv2rgb.c	(revision 18987)
+++ libswscale/yuv2rgb.c	(working copy)
@@ -43,6 +43,11 @@
 #include "mangle.h"
 #include "libvo/img_format.h" //FIXME try to reduce dependency of such stuff
 
+#if !defined(HAVE_MMX) && !defined(HAVE_MMX2) && !defined(HAVE_3DNOW)
+#undef ARCH_X86
+#undef ARCH_X86_64
+#endif
+
 #ifdef HAVE_MLIB
 #include "yuv2rgb_mlib.c"
 #endif
Index: libswscale/swscale.c
===================================================================
--- libswscale/swscale.c	(revision 18987)
+++ libswscale/swscale.c	(working copy)
@@ -86,6 +86,11 @@
 //#define WORDS_BIGENDIAN
 #define DITHER1XBPP
 
+#if !defined(HAVE_MMX) && !defined(HAVE_MMX2) && !defined(HAVE_3DNOW)
+#undef ARCH_X86
+#undef ARCH_X86_64
+#endif
+
 #define FAST_BGR2YV12 // use 7 bit coeffs instead of 15bit
 
 #define RET 0xC3 //near return opcode for X86
Index: libswscale/rgb2rgb.c
===================================================================
--- libswscale/rgb2rgb.c	(revision 18987)
+++ libswscale/rgb2rgb.c	(working copy)
@@ -16,6 +16,11 @@
 #include "bswap.h"
 #include "libvo/fastmemcpy.h"
 
+#if !defined(HAVE_MMX) && !defined(HAVE_MMX2) && !defined(HAVE_3DNOW)
+#undef ARCH_X86
+#undef ARCH_X86_64
+#endif
+
 #define FAST_BGR2YV12 // use 7 bit coeffs instead of 15bit
 
 void (*rgb24to32)(const uint8_t *src,uint8_t *dst,long src_size);


More information about the MPlayer-dev-eng mailing list