[MPlayer-cvslog] r19339 - in trunk/libswscale: rgb2rgb.c swscale.c yuv2rgb.c

diego subversion at mplayerhq.hu
Sat Aug 5 12:00:54 CEST 2006


Author: diego
Date: Sat Aug  5 12:00:54 2006
New Revision: 19339

Modified:
   trunk/libswscale/rgb2rgb.c
   trunk/libswscale/swscale.c
   trunk/libswscale/yuv2rgb.c

Log:
Do not assemble MMX, MMX2 or 3DNOW code unconditionally on X86 and X86_64.


Modified: trunk/libswscale/rgb2rgb.c
==============================================================================
--- trunk/libswscale/rgb2rgb.c	(original)
+++ trunk/libswscale/rgb2rgb.c	Sat Aug  5 12:00:54 2006
@@ -72,9 +72,11 @@
 			long srcStride1, long srcStride2,
 			long srcStride3, long dstStride);
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if defined(HAVE_MMX)
 static const uint64_t mmx_null  __attribute__((aligned(8))) = 0x0000000000000000ULL;
 static const uint64_t mmx_one   __attribute__((aligned(8))) = 0xFFFFFFFFFFFFFFFFULL;
+#endif
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
 static const uint64_t mask32b  attribute_used __attribute__((aligned(8))) = 0x000000FF000000FFULL;
 static const uint64_t mask32g  attribute_used __attribute__((aligned(8))) = 0x0000FF000000FF00ULL;
 static const uint64_t mask32r  attribute_used __attribute__((aligned(8))) = 0x00FF000000FF0000ULL;
@@ -195,7 +197,7 @@
 */
 
 void sws_rgb2rgb_init(int flags){
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if defined(HAVE_MMX2) || defined(HAVE_3DNOW) || defined(HAVE_MMX)
 	if(flags & SWS_CPU_CAPS_MMX2){
 		rgb15to16= rgb15to16_MMX2;
 		rgb15to24= rgb15to24_MMX2;
@@ -287,7 +289,7 @@
 		vu9_to_vu12= vu9_to_vu12_MMX;
 		yvu9_to_yuy2= yvu9_to_yuy2_MMX;
 	}else
-#endif /* defined(ARCH_X86) || defined(ARCH_X86_64) */
+#endif /* defined(HAVE_MMX2) || defined(HAVE_3DNOW) || defined(HAVE_MMX) */
 	{
 		rgb15to16= rgb15to16_C;
 		rgb15to24= rgb15to24_C;

Modified: trunk/libswscale/swscale.c
==============================================================================
--- trunk/libswscale/swscale.c	(original)
+++ trunk/libswscale/swscale.c	Sat Aug  5 12:00:54 2006
@@ -1240,7 +1240,7 @@
         return 0;
 }
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef HAVE_MMX2
 static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *filter, int32_t *filterPos, int numSplits)
 {
 	uint8_t *fragmentA;
@@ -1411,7 +1411,7 @@
 	}
 	filterPos[i/2]= xpos>>16; // needed to jump to the next part
 }
-#endif // ARCH_X86 || ARCH_X86_64
+#endif /* HAVE_MMX2 */
 
 static void globalInit(void){
     // generating tables:
@@ -2114,11 +2114,11 @@
 				 (flags&SWS_BICUBLIN) ? (flags|SWS_BILINEAR) : flags,
 				 srcFilter->chrH, dstFilter->chrH, c->param);
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#define MAX_FUNNY_CODE_SIZE 10000
+#if defined(HAVE_MMX2)
 // can't downscale !!!
 		if(c->canMMX2BeUsed && (flags & SWS_FAST_BILINEAR))
 		{
-#define MAX_FUNNY_CODE_SIZE 10000
 #ifdef MAP_ANONYMOUS
 			c->funnyYCode = (uint8_t*)mmap(NULL, MAX_FUNNY_CODE_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
 			c->funnyUVCode = (uint8_t*)mmap(NULL, MAX_FUNNY_CODE_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
@@ -2135,7 +2135,7 @@
 			initMMX2HScaler(      dstW, c->lumXInc, c->funnyYCode , c->lumMmx2Filter, c->lumMmx2FilterPos, 8);
 			initMMX2HScaler(c->chrDstW, c->chrXInc, c->funnyUVCode, c->chrMmx2Filter, c->chrMmx2FilterPos, 4);
 		}
-#endif /* defined(ARCH_X86) || defined(ARCH_X86_64) */
+#endif /* defined(HAVE_MMX2) */
 	} // Init Horizontal stuff
 
 

Modified: trunk/libswscale/yuv2rgb.c
==============================================================================
--- trunk/libswscale/yuv2rgb.c	(original)
+++ trunk/libswscale/yuv2rgb.c	Sat Aug  5 12:00:54 2006
@@ -154,7 +154,7 @@
 };
 #endif
 
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#ifdef HAVE_MMX
 
 /* hope these constant values are cache line aligned */
 uint64_t attribute_used __attribute__((aligned(8))) mmx_00ffw = 0x00ff00ff00ff00ffULL;
@@ -578,7 +578,7 @@
 
 SwsFunc yuv2rgb_get_func_ptr (SwsContext *c)
 {
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if defined(HAVE_MMX2) || defined(HAVE_MMX)
     if(c->flags & SWS_CPU_CAPS_MMX2){
 	switch(c->dstFormat){
 	case IMGFMT_BGR32: return yuv420_rgb32_MMX2;



More information about the MPlayer-cvslog mailing list