comparison src/video/SDL_yuv_sw.c @ 2168:07f084fe97d0

Merged r3211:3213 from branches/SDL-1.2: YUV MMX inline asm for GCC.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 11 Jul 2007 07:39:01 +0000
parents a788656ca29a
children bef26cfc8f79
comparison
equal deleted inserted replaced
2167:8f2174e22cd5 2168:07f084fe97d0
115 SDL_Surface *display; 115 SDL_Surface *display;
116 }; 116 };
117 117
118 /* The colorspace conversion functions */ 118 /* The colorspace conversion functions */
119 119
120 #if 0 /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES */ 120 #if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
121 extern void Color565DitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix, 121 extern void Color565DitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix,
122 unsigned char *lum, unsigned char *cr, 122 unsigned char *lum, unsigned char *cr,
123 unsigned char *cb, unsigned char *out, 123 unsigned char *cb, unsigned char *out,
124 int rows, int cols, int mod); 124 int rows, int cols, int mod);
125 extern void ColorRGBDitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix, 125 extern void ColorRGBDitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix,
976 /* You have chosen wisely... */ 976 /* You have chosen wisely... */
977 switch (swdata->texture->format) { 977 switch (swdata->texture->format) {
978 case SDL_PIXELFORMAT_YV12: 978 case SDL_PIXELFORMAT_YV12:
979 case SDL_PIXELFORMAT_IYUV: 979 case SDL_PIXELFORMAT_IYUV:
980 if (SDL_BYTESPERPIXEL(target_format) == 2) { 980 if (SDL_BYTESPERPIXEL(target_format) == 2) {
981 #if 0 /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES */ 981 #if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
982 /* inline assembly functions */ 982 /* inline assembly functions */
983 if (SDL_HasMMX() && (Rmask == 0xF800) && 983 if (SDL_HasMMX() && (Rmask == 0xF800) &&
984 (Gmask == 0x07E0) && (Bmask == 0x001F) && (width & 15) == 0) { 984 (Gmask == 0x07E0) && (Bmask == 0x001F) && (width & 15) == 0) {
985 /*printf("Using MMX 16-bit 565 dither\n");*/ 985 /*printf("Using MMX 16-bit 565 dither\n");*/
986 swdata->Display1X = Color565DitherYV12MMX1X; 986 swdata->Display1X = Color565DitherYV12MMX1X;
996 if (SDL_BYTESPERPIXEL(target_format) == 3) { 996 if (SDL_BYTESPERPIXEL(target_format) == 3) {
997 swdata->Display1X = Color24DitherYV12Mod1X; 997 swdata->Display1X = Color24DitherYV12Mod1X;
998 swdata->Display2X = Color24DitherYV12Mod2X; 998 swdata->Display2X = Color24DitherYV12Mod2X;
999 } 999 }
1000 if (SDL_BYTESPERPIXEL(target_format) == 4) { 1000 if (SDL_BYTESPERPIXEL(target_format) == 4) {
1001 #if 0 /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES */ 1001 #if (__GNUC__ > 2) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
1002 /* inline assembly functions */ 1002 /* inline assembly functions */
1003 if (SDL_HasMMX() && (Rmask == 0x00FF0000) && 1003 if (SDL_HasMMX() && (Rmask == 0x00FF0000) &&
1004 (Gmask == 0x0000FF00) && 1004 (Gmask == 0x0000FF00) &&
1005 (Bmask == 0x000000FF) && (width & 15) == 0) { 1005 (Bmask == 0x000000FF) && (width & 15) == 0) {
1006 /*printf("Using MMX 32-bit dither\n");*/ 1006 /*printf("Using MMX 32-bit dither\n");*/