Mercurial > sdl-ios-xcode
comparison src/video/SDL_yuv_sw.c @ 4064:940fddb81bea SDL-1.2
Mac OS X/x86 won't build the MMX/YUV inline assembly without optimizations
enabled (not enough registers), so for now, we only build it if we see
the __OPTIMIZE__ #define, which GCC provides when you build at -O1 or higher.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sat, 14 Jul 2007 07:26:34 +0000 |
parents | f420bba13676 |
children | 96ce26f24b01 |
comparison
equal
deleted
inserted
replaced
4063:d634945c6172 | 4064:940fddb81bea |
---|---|
119 }; | 119 }; |
120 | 120 |
121 | 121 |
122 /* The colorspace conversion functions */ | 122 /* The colorspace conversion functions */ |
123 | 123 |
124 #if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES | 124 #if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES |
125 extern void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, | 125 extern void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, |
126 unsigned char *lum, unsigned char *cr, | 126 unsigned char *lum, unsigned char *cr, |
127 unsigned char *cb, unsigned char *out, | 127 unsigned char *cb, unsigned char *out, |
128 int rows, int cols, int mod ); | 128 int rows, int cols, int mod ); |
129 extern void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, | 129 extern void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, |
1059 /* You have chosen wisely... */ | 1059 /* You have chosen wisely... */ |
1060 switch (format) { | 1060 switch (format) { |
1061 case SDL_YV12_OVERLAY: | 1061 case SDL_YV12_OVERLAY: |
1062 case SDL_IYUV_OVERLAY: | 1062 case SDL_IYUV_OVERLAY: |
1063 if ( display->format->BytesPerPixel == 2 ) { | 1063 if ( display->format->BytesPerPixel == 2 ) { |
1064 #if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES | 1064 #if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES |
1065 /* inline assembly functions */ | 1065 /* inline assembly functions */ |
1066 if ( SDL_HasMMX() && (Rmask == 0xF800) && | 1066 if ( SDL_HasMMX() && (Rmask == 0xF800) && |
1067 (Gmask == 0x07E0) && | 1067 (Gmask == 0x07E0) && |
1068 (Bmask == 0x001F) && | 1068 (Bmask == 0x001F) && |
1069 (width & 15) == 0) { | 1069 (width & 15) == 0) { |
1081 if ( display->format->BytesPerPixel == 3 ) { | 1081 if ( display->format->BytesPerPixel == 3 ) { |
1082 swdata->Display1X = Color24DitherYV12Mod1X; | 1082 swdata->Display1X = Color24DitherYV12Mod1X; |
1083 swdata->Display2X = Color24DitherYV12Mod2X; | 1083 swdata->Display2X = Color24DitherYV12Mod2X; |
1084 } | 1084 } |
1085 if ( display->format->BytesPerPixel == 4 ) { | 1085 if ( display->format->BytesPerPixel == 4 ) { |
1086 #if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES | 1086 #if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES |
1087 /* inline assembly functions */ | 1087 /* inline assembly functions */ |
1088 if ( SDL_HasMMX() && (Rmask == 0x00FF0000) && | 1088 if ( SDL_HasMMX() && (Rmask == 0x00FF0000) && |
1089 (Gmask == 0x0000FF00) && | 1089 (Gmask == 0x0000FF00) && |
1090 (Bmask == 0x000000FF) && | 1090 (Bmask == 0x000000FF) && |
1091 (width & 15) == 0) { | 1091 (width & 15) == 0) { |