Mercurial > sdl-ios-xcode
comparison src/video/SDL_yuv_sw.c @ 2786:6bacfecbf27e
indent
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 25 Nov 2008 02:21:53 +0000 |
parents | 5651642f4a78 |
children | 9e7ce3069096 |
comparison
equal
deleted
inserted
replaced
2785:fa1095d42a5b | 2786:6bacfecbf27e |
---|---|
89 #include "SDL_yuv_sw_c.h" | 89 #include "SDL_yuv_sw_c.h" |
90 | 90 |
91 | 91 |
92 struct SDL_SW_YUVTexture | 92 struct SDL_SW_YUVTexture |
93 { | 93 { |
94 Uint32 format; | 94 Uint32 format; |
95 Uint32 target_format; | 95 Uint32 target_format; |
96 int w, h; | 96 int w, h; |
97 Uint8 *pixels; | 97 Uint8 *pixels; |
98 int *colortab; | 98 int *colortab; |
99 Uint32 *rgb_2_pix; | 99 Uint32 *rgb_2_pix; |
100 void (*Display1X) (int *colortab, Uint32 * rgb_2_pix, | 100 void (*Display1X) (int *colortab, Uint32 * rgb_2_pix, |
101 unsigned char *lum, unsigned char *cr, | 101 unsigned char *lum, unsigned char *cr, |
1073 return NULL; | 1073 return NULL; |
1074 } | 1074 } |
1075 | 1075 |
1076 swdata->format = format; | 1076 swdata->format = format; |
1077 swdata->target_format = SDL_PIXELFORMAT_UNKNOWN; | 1077 swdata->target_format = SDL_PIXELFORMAT_UNKNOWN; |
1078 swdata->w = w; | 1078 swdata->w = w; |
1079 swdata->h = h; | 1079 swdata->h = h; |
1080 swdata->pixels = (Uint8 *) SDL_malloc(w * h * 2); | 1080 swdata->pixels = (Uint8 *) SDL_malloc(w * h * 2); |
1081 swdata->colortab = (int *) SDL_malloc(4 * 256 * sizeof(int)); | 1081 swdata->colortab = (int *) SDL_malloc(4 * 256 * sizeof(int)); |
1082 swdata->rgb_2_pix = (Uint32 *) SDL_malloc(3 * 768 * sizeof(Uint32)); | 1082 swdata->rgb_2_pix = (Uint32 *) SDL_malloc(3 * 768 * sizeof(Uint32)); |
1083 if (!swdata->pixels || !swdata->colortab || !swdata->rgb_2_pix) { | 1083 if (!swdata->pixels || !swdata->colortab || !swdata->rgb_2_pix) { |
1084 SDL_OutOfMemory(); | 1084 SDL_OutOfMemory(); |
1108 case SDL_PIXELFORMAT_IYUV: | 1108 case SDL_PIXELFORMAT_IYUV: |
1109 swdata->pitches[0] = w; | 1109 swdata->pitches[0] = w; |
1110 swdata->pitches[1] = swdata->pitches[0] / 2; | 1110 swdata->pitches[1] = swdata->pitches[0] / 2; |
1111 swdata->pitches[2] = swdata->pitches[0] / 2; | 1111 swdata->pitches[2] = swdata->pitches[0] / 2; |
1112 swdata->planes[0] = swdata->pixels; | 1112 swdata->planes[0] = swdata->pixels; |
1113 swdata->planes[1] = | 1113 swdata->planes[1] = swdata->planes[0] + swdata->pitches[0] * h; |
1114 swdata->planes[0] + swdata->pitches[0] * h; | 1114 swdata->planes[2] = swdata->planes[1] + swdata->pitches[1] * h / 2; |
1115 swdata->planes[2] = | |
1116 swdata->planes[1] + swdata->pitches[1] * h / 2; | |
1117 break; | 1115 break; |
1118 case SDL_PIXELFORMAT_YUY2: | 1116 case SDL_PIXELFORMAT_YUY2: |
1119 case SDL_PIXELFORMAT_UYVY: | 1117 case SDL_PIXELFORMAT_UYVY: |
1120 case SDL_PIXELFORMAT_YVYU: | 1118 case SDL_PIXELFORMAT_YVYU: |
1121 swdata->pitches[0] = w * 2; | 1119 swdata->pitches[0] = w * 2; |