21 #include "../SDL_internal.h" 93 #if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES 94 extern void Color565DitherYV12MMX1X(
int *colortab,
Uint32 * rgb_2_pix,
95 unsigned char *lum,
unsigned char *cr,
96 unsigned char *cb,
unsigned char *out,
97 int rows,
int cols,
int mod);
98 extern void ColorRGBDitherYV12MMX1X(
int *colortab,
Uint32 * rgb_2_pix,
99 unsigned char *lum,
unsigned char *cr,
100 unsigned char *cb,
unsigned char *out,
101 int rows,
int cols,
int mod);
106 unsigned char *lum,
unsigned char *cr,
107 unsigned char *cb,
unsigned char *out,
108 int rows,
int cols,
int mod)
110 unsigned short *row1;
111 unsigned short *row2;
117 int cols_2 = cols / 2;
119 row1 = (
unsigned short *) out;
120 row2 = row1 + cols + mod;
131 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
132 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
133 + colortab[*cb + 2 * 256];
134 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
139 *row1++ = (
unsigned short) (rgb_2_pix[L + cr_r] |
140 rgb_2_pix[L + crb_g] |
141 rgb_2_pix[L + cb_b]);
144 *row1++ = (
unsigned short) (rgb_2_pix[L + cr_r] |
145 rgb_2_pix[L + crb_g] |
146 rgb_2_pix[L + cb_b]);
152 *row2++ = (
unsigned short) (rgb_2_pix[L + cr_r] |
153 rgb_2_pix[L + crb_g] |
154 rgb_2_pix[L + cb_b]);
157 *row2++ = (
unsigned short) (rgb_2_pix[L + cr_r] |
158 rgb_2_pix[L + crb_g] |
159 rgb_2_pix[L + cb_b]);
176 unsigned char *lum,
unsigned char *cr,
177 unsigned char *cb,
unsigned char *out,
178 int rows,
int cols,
int mod)
188 int cols_2 = cols / 2;
191 row2 = row1 + cols * 3 + mod * 3;
203 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
204 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
205 + colortab[*cb + 2 * 256];
206 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
211 value = (rgb_2_pix[L + cr_r] |
212 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
213 *row1++ = (
value) & 0xFF;
214 *row1++ = (value >> 8) & 0xFF;
215 *row1++ = (value >> 16) & 0xFF;
218 value = (rgb_2_pix[L + cr_r] |
219 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
220 *row1++ = (
value) & 0xFF;
221 *row1++ = (value >> 8) & 0xFF;
222 *row1++ = (value >> 16) & 0xFF;
228 value = (rgb_2_pix[L + cr_r] |
229 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
230 *row2++ = (
value) & 0xFF;
231 *row2++ = (value >> 8) & 0xFF;
232 *row2++ = (value >> 16) & 0xFF;
235 value = (rgb_2_pix[L + cr_r] |
236 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
237 *row2++ = (
value) & 0xFF;
238 *row2++ = (value >> 8) & 0xFF;
239 *row2++ = (value >> 16) & 0xFF;
256 unsigned char *lum,
unsigned char *cr,
257 unsigned char *cb,
unsigned char *out,
258 int rows,
int cols,
int mod)
267 int cols_2 = cols / 2;
269 row1 = (
unsigned int *) out;
270 row2 = row1 + cols + mod;
281 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
282 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
283 + colortab[*cb + 2 * 256];
284 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
289 *row1++ = (rgb_2_pix[L + cr_r] |
290 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
293 *row1++ = (rgb_2_pix[L + cr_r] |
294 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
300 *row2++ = (rgb_2_pix[L + cr_r] |
301 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
304 *row2++ = (rgb_2_pix[L + cr_r] |
305 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
327 unsigned char *lum,
unsigned char *cr,
328 unsigned char *cb,
unsigned char *out,
329 int rows,
int cols,
int mod)
331 unsigned int *row1 = (
unsigned int *) out;
332 const int next_row = cols + (mod / 2);
333 unsigned int *row2 = row1 + 2 * next_row;
339 int cols_2 = cols / 2;
343 mod = (next_row * 3) + (mod / 2);
351 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
352 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
353 + colortab[*cb + 2 * 256];
354 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
359 row1[0] = row1[next_row] = (rgb_2_pix[L + cr_r] |
360 rgb_2_pix[L + crb_g] |
361 rgb_2_pix[L + cb_b]);
365 row1[0] = row1[next_row] = (rgb_2_pix[L + cr_r] |
366 rgb_2_pix[L + crb_g] |
367 rgb_2_pix[L + cb_b]);
374 row2[0] = row2[next_row] = (rgb_2_pix[L + cr_r] |
375 rgb_2_pix[L + crb_g] |
376 rgb_2_pix[L + cb_b]);
380 row2[0] = row2[next_row] = (rgb_2_pix[L + cr_r] |
381 rgb_2_pix[L + crb_g] |
382 rgb_2_pix[L + cb_b]);
400 unsigned char *lum,
unsigned char *cr,
401 unsigned char *cb,
unsigned char *out,
402 int rows,
int cols,
int mod)
405 unsigned char *row1 = out;
406 const int next_row = (cols * 2 + mod) * 3;
407 unsigned char *row2 = row1 + 2 * next_row;
413 int cols_2 = cols / 2;
417 mod = next_row * 3 + mod * 3;
425 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
426 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
427 + colortab[*cb + 2 * 256];
428 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
433 value = (rgb_2_pix[L + cr_r] |
434 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
435 row1[0 + 0] = row1[3 + 0] = row1[next_row + 0] =
436 row1[next_row + 3 + 0] = (
value) & 0xFF;
437 row1[0 + 1] = row1[3 + 1] = row1[next_row + 1] =
438 row1[next_row + 3 + 1] = (value >> 8) & 0xFF;
439 row1[0 + 2] = row1[3 + 2] = row1[next_row + 2] =
440 row1[next_row + 3 + 2] = (value >> 16) & 0xFF;
444 value = (rgb_2_pix[L + cr_r] |
445 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
446 row1[0 + 0] = row1[3 + 0] = row1[next_row + 0] =
447 row1[next_row + 3 + 0] = (
value) & 0xFF;
448 row1[0 + 1] = row1[3 + 1] = row1[next_row + 1] =
449 row1[next_row + 3 + 1] = (value >> 8) & 0xFF;
450 row1[0 + 2] = row1[3 + 2] = row1[next_row + 2] =
451 row1[next_row + 3 + 2] = (value >> 16) & 0xFF;
458 value = (rgb_2_pix[L + cr_r] |
459 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
460 row2[0 + 0] = row2[3 + 0] = row2[next_row + 0] =
461 row2[next_row + 3 + 0] = (
value) & 0xFF;
462 row2[0 + 1] = row2[3 + 1] = row2[next_row + 1] =
463 row2[next_row + 3 + 1] = (value >> 8) & 0xFF;
464 row2[0 + 2] = row2[3 + 2] = row2[next_row + 2] =
465 row2[next_row + 3 + 2] = (value >> 16) & 0xFF;
469 value = (rgb_2_pix[L + cr_r] |
470 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
471 row2[0 + 0] = row2[3 + 0] = row2[next_row + 0] =
472 row2[next_row + 3 + 0] = (
value) & 0xFF;
473 row2[0 + 1] = row2[3 + 1] = row2[next_row + 1] =
474 row2[next_row + 3 + 1] = (value >> 8) & 0xFF;
475 row2[0 + 2] = row2[3 + 2] = row2[next_row + 2] =
476 row2[next_row + 3 + 2] = (value >> 16) & 0xFF;
494 unsigned char *lum,
unsigned char *cr,
495 unsigned char *cb,
unsigned char *out,
496 int rows,
int cols,
int mod)
498 unsigned int *row1 = (
unsigned int *) out;
499 const int next_row = cols * 2 + mod;
500 unsigned int *row2 = row1 + 2 * next_row;
506 int cols_2 = cols / 2;
510 mod = (next_row * 3) + mod;
518 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
519 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
520 + colortab[*cb + 2 * 256];
521 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
526 row1[0] = row1[1] = row1[next_row] = row1[next_row + 1] =
527 (rgb_2_pix[L + cr_r] |
528 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
532 row1[0] = row1[1] = row1[next_row] = row1[next_row + 1] =
533 (rgb_2_pix[L + cr_r] |
534 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
541 row2[0] = row2[1] = row2[next_row] = row2[next_row + 1] =
542 (rgb_2_pix[L + cr_r] |
543 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
547 row2[0] = row2[1] = row2[next_row] = row2[next_row + 1] =
548 (rgb_2_pix[L + cr_r] |
549 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
567 unsigned char *lum,
unsigned char *cr,
568 unsigned char *cb,
unsigned char *out,
569 int rows,
int cols,
int mod)
576 int cols_2 = cols / 2;
578 row = (
unsigned short *) out;
586 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
587 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
588 + colortab[*cb + 2 * 256];
589 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
595 *row++ = (
unsigned short) (rgb_2_pix[L + cr_r] |
596 rgb_2_pix[L + crb_g] |
597 rgb_2_pix[L + cb_b]);
601 *row++ = (
unsigned short) (rgb_2_pix[L + cr_r] |
602 rgb_2_pix[L + crb_g] |
603 rgb_2_pix[L + cb_b]);
613 unsigned char *lum,
unsigned char *cr,
614 unsigned char *cb,
unsigned char *out,
615 int rows,
int cols,
int mod)
623 int cols_2 = cols / 2;
625 row = (
unsigned char *) out;
633 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
634 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
635 + colortab[*cb + 2 * 256];
636 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
642 value = (rgb_2_pix[L + cr_r] |
643 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
644 *row++ = (
value) & 0xFF;
645 *row++ = (value >> 8) & 0xFF;
646 *row++ = (value >> 16) & 0xFF;
650 value = (rgb_2_pix[L + cr_r] |
651 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
652 *row++ = (
value) & 0xFF;
653 *row++ = (value >> 8) & 0xFF;
654 *row++ = (value >> 16) & 0xFF;
663 unsigned char *lum,
unsigned char *cr,
664 unsigned char *cb,
unsigned char *out,
665 int rows,
int cols,
int mod)
672 int cols_2 = cols / 2;
674 row = (
unsigned int *) out;
681 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
682 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
683 + colortab[*cb + 2 * 256];
684 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
690 *row++ = (rgb_2_pix[L + cr_r] |
691 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
695 *row++ = (rgb_2_pix[L + cr_r] |
696 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
711 unsigned char *lum,
unsigned char *cr,
712 unsigned char *cb,
unsigned char *out,
713 int rows,
int cols,
int mod)
715 unsigned int *
row = (
unsigned int *) out;
716 const int next_row = cols + (mod / 2);
721 int cols_2 = cols / 2;
729 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
730 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
731 + colortab[*cb + 2 * 256];
732 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
738 row[0] = row[next_row] = (rgb_2_pix[L + cr_r] |
739 rgb_2_pix[L + crb_g] |
740 rgb_2_pix[L + cb_b]);
745 row[0] = row[next_row] = (rgb_2_pix[L + cr_r] |
746 rgb_2_pix[L + crb_g] |
747 rgb_2_pix[L + cb_b]);
757 unsigned char *lum,
unsigned char *cr,
758 unsigned char *cb,
unsigned char *out,
759 int rows,
int cols,
int mod)
762 unsigned char *
row = out;
763 const int next_row = (cols * 2 + mod) * 3;
768 int cols_2 = cols / 2;
775 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
776 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
777 + colortab[*cb + 2 * 256];
778 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
784 value = (rgb_2_pix[L + cr_r] |
785 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
786 row[0 + 0] = row[3 + 0] = row[next_row + 0] =
787 row[next_row + 3 + 0] = (
value) & 0xFF;
788 row[0 + 1] = row[3 + 1] = row[next_row + 1] =
789 row[next_row + 3 + 1] = (value >> 8) & 0xFF;
790 row[0 + 2] = row[3 + 2] = row[next_row + 2] =
791 row[next_row + 3 + 2] = (value >> 16) & 0xFF;
796 value = (rgb_2_pix[L + cr_r] |
797 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
798 row[0 + 0] = row[3 + 0] = row[next_row + 0] =
799 row[next_row + 3 + 0] = (
value) & 0xFF;
800 row[0 + 1] = row[3 + 1] = row[next_row + 1] =
801 row[next_row + 3 + 1] = (value >> 8) & 0xFF;
802 row[0 + 2] = row[3 + 2] = row[next_row + 2] =
803 row[next_row + 3 + 2] = (value >> 16) & 0xFF;
813 unsigned char *lum,
unsigned char *cr,
814 unsigned char *cb,
unsigned char *out,
815 int rows,
int cols,
int mod)
817 unsigned int *
row = (
unsigned int *) out;
818 const int next_row = cols * 2 + mod;
823 int cols_2 = cols / 2;
831 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
832 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
833 + colortab[*cb + 2 * 256];
834 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
840 row[0] = row[1] = row[next_row] = row[next_row + 1] =
841 (rgb_2_pix[L + cr_r] |
842 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
847 row[0] = row[1] = row[next_row] = row[next_row + 1] =
848 (rgb_2_pix[L + cr_r] |
849 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
882 return sizeof(
Uint32) * 8;
896 Uint32 Rmask, Gmask, Bmask, Amask;
899 (target_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask) || bpp < 15) {
900 return SDL_SetError(
"Unsupported YUV destination format");
904 r_2_pix_alloc = &swdata->
rgb_2_pix[0 * 768];
905 g_2_pix_alloc = &swdata->
rgb_2_pix[1 * 768];
906 b_2_pix_alloc = &swdata->
rgb_2_pix[2 * 768];
911 for (i = 0; i < 256; ++
i) {
914 r_2_pix_alloc[i + 256] |= Amask;
917 g_2_pix_alloc[i + 256] |= Amask;
920 b_2_pix_alloc[i + 256] |= Amask;
931 for (i = 0; i < 256; ++
i) {
932 r_2_pix_alloc[i + 256] |= (r_2_pix_alloc[i + 256]) << 16;
933 g_2_pix_alloc[i + 256] |= (g_2_pix_alloc[i + 256]) << 16;
934 b_2_pix_alloc[i + 256] |= (b_2_pix_alloc[i + 256]) << 16;
942 for (i = 0; i < 256; ++
i) {
943 r_2_pix_alloc[
i] = r_2_pix_alloc[256];
944 r_2_pix_alloc[i + 512] = r_2_pix_alloc[511];
945 g_2_pix_alloc[
i] = g_2_pix_alloc[256];
946 g_2_pix_alloc[i + 512] = g_2_pix_alloc[511];
947 b_2_pix_alloc[
i] = b_2_pix_alloc[256];
948 b_2_pix_alloc[i + 512] = b_2_pix_alloc[511];
956 #if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES 959 (Gmask == 0x07E0) && (Bmask == 0x001F)
960 && (swdata->
w & 15) == 0) {
962 swdata->
Display1X = Color565DitherYV12MMX1X;
977 #if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES 980 (Gmask == 0x0000FF00) &&
981 (Bmask == 0x000000FF) && (swdata->
w & 15) == 0) {
983 swdata->
Display1X = ColorRGBDitherYV12MMX1X;
1063 Cr_r_tab = &swdata->
colortab[0 * 256];
1064 Cr_g_tab = &swdata->
colortab[1 * 256];
1065 Cb_g_tab = &swdata->
colortab[2 * 256];
1066 Cb_b_tab = &swdata->
colortab[3 * 256];
1067 for (i = 0; i < 256; i++) {
1071 CB = CR = (i - 128);
1072 Cr_r_tab[
i] = (int) ((0.419 / 0.299) * CR);
1073 Cr_g_tab[
i] = (int) (-(0.299 / 0.419) * CR);
1074 Cb_g_tab[
i] = (int) (-(0.114 / 0.331) * CB);
1075 Cb_b_tab[
i] = (int) ((0.587 / 0.331) * CB);
1096 SDL_assert(0 &&
"We should never get here (caught above)");
1108 *pixels = swdata->
planes[0];
1115 const void *
pixels,
int pitch)
1117 switch (swdata->
format) {
1120 if (rect->
x == 0 && rect->
y == 0 &&
1121 rect->
w == swdata->
w && rect->
h == swdata->
h) {
1123 (swdata->
h * swdata->
w) + (swdata->
h * swdata->
w) / 2);
1130 src = (
Uint8 *) pixels;
1131 dst = swdata->
pixels + rect->
y * swdata->
w + rect->
x;
1133 for (row = 0; row < rect->
h; ++
row) {
1140 src = (
Uint8 *) pixels + rect->
h * pitch;
1141 dst = swdata->
pixels + swdata->
h * swdata->
w;
1142 dst += rect->
y/2 * swdata->
w/2 + rect->
x/2;
1143 length = rect->
w / 2;
1144 for (row = 0; row < rect->
h/2; ++
row) {
1151 src = (
Uint8 *) pixels + rect->
h * pitch + (rect->
h * pitch) / 4;
1152 dst = swdata->
pixels + swdata->
h * swdata->
w +
1153 (swdata->
h * swdata->
w) / 4;
1154 dst += rect->
y/2 * swdata->
w/2 + rect->
x/2;
1155 length = rect->
w / 2;
1156 for (row = 0; row < rect->
h/2; ++
row) {
1171 src = (
Uint8 *) pixels;
1175 length = rect->
w * 2;
1176 for (row = 0; row < rect->
h; ++
row) {
1189 const Uint8 *Yplane,
int Ypitch,
1190 const Uint8 *Uplane,
int Upitch,
1191 const Uint8 *Vplane,
int Vpitch)
1200 dst = swdata->
pixels + rect->
y * swdata->
w + rect->
x;
1202 for (row = 0; row < rect->
h; ++
row) {
1211 dst = swdata->
pixels + swdata->
h * swdata->
w;
1213 dst = swdata->
pixels + swdata->
h * swdata->
w +
1214 (swdata->
h * swdata->
w) / 4;
1216 dst += rect->
y/2 * swdata->
w/2 + rect->
x/2;
1217 length = rect->
w / 2;
1218 for (row = 0; row < rect->
h/2; ++
row) {
1227 dst = swdata->
pixels + swdata->
h * swdata->
w;
1229 dst = swdata->
pixels + swdata->
h * swdata->
w +
1230 (swdata->
h * swdata->
w) / 4;
1232 dst += rect->
y/2 * swdata->
w/2 + rect->
x/2;
1233 length = rect->
w / 2;
1234 for (row = 0; row < rect->
h/2; ++
row) {
1244 void **
pixels,
int *pitch)
1246 switch (swdata->
format) {
1250 && (rect->
x != 0 || rect->
y != 0 || rect->
w != swdata->
w 1251 || rect->
h != swdata->
h)) {
1253 (
"YV12 and IYUV textures only support full surface locks");
1259 *pixels = swdata->
planes[0] + rect->
y * swdata->
pitches[0] + rect->
x * 2;
1261 *pixels = swdata->
planes[0];
1280 Uint8 *lum, *Cr, *Cb;
1283 if (targetbpp == 0) {
1296 if (srcrect->
x || srcrect->
y || srcrect->
w < swdata->
w 1297 || srcrect->
h < swdata->
h) {
1304 }
else if ((srcrect->
w != w) || (srcrect->
h != h)) {
1305 if ((w == 2 * srcrect->
w) && (h == 2 * srcrect->
h)) {
1313 Uint32 Rmask, Gmask, Bmask, Amask;
1326 Gmask, Bmask, Amask);
1337 Gmask, Bmask, Amask);
1345 switch (swdata->
format) {
1362 lum = swdata->
planes[0] + 1;
1374 mod = (pitch / targetbpp);
1377 mod -= (swdata->
w * 2);
1379 lum, Cr, Cb, pixels, swdata->
h, swdata->
w, mod);
1383 lum, Cr, Cb, pixels, swdata->
h, swdata->
w, mod);
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
void SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture *swdata)
SDL_SW_YUVTexture * SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
void(* Display1X)(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)
static void Color24DitherYUY2Mod1X(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)
static int SDL_SW_SetupYUVDisplay(SDL_SW_YUVTexture *swdata, Uint32 target_format)
GLint GLint GLint GLint GLint x
static void Color16DitherYV12Mod1X(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)
int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, void **pixels, int *pitch)
static void Color16DitherYUY2Mod1X(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)
#define SDL_BYTESPERPIXEL(X)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
uint32_t Uint32
An unsigned 32-bit integer type.
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp
#define SDL_CreateRGBSurfaceFrom
static void Color24DitherYV12Mod2X(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)
static int number_of_bits_set(Uint32 a)
int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, const void *pixels, int pitch)
void * SDL_calloc(size_t nmemb, size_t size)
static int free_bits_at_bottom(Uint32 a)
GLint GLint GLint GLint GLint GLint y
GLsizei const GLfloat * value
uint8_t Uint8
An unsigned 8-bit integer type.
static void Color16DitherYV12Mod2X(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)
#define SDL_PixelFormatEnumToMasks
void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture *swdata)
static void Color32DitherYUY2Mod1X(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)
int32_t Sint32
A signed 32-bit integer type.
void(* Display2X)(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
#define SDL_assert(condition)
#define SDL_OutOfMemory()
int SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture *swdata, void **pixels, int *pitch)
#define SDL_CreateRGBSurface
int SDL_SW_UpdateYUVTexturePlanar(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch)
int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture *swdata, const SDL_Rect *srcrect, Uint32 target_format, int w, int h, void *pixels, int pitch)
static void Color16DitherYUY2Mod2X(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)
GLubyte GLubyte GLubyte GLubyte w
static void Color32DitherYUY2Mod2X(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)
GLuint GLsizei GLsizei * length
GLboolean GLboolean GLboolean GLboolean a
static void Color24DitherYV12Mod1X(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)
static void Color32DitherYV12Mod2X(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)
GLfloat GLfloat GLfloat GLfloat h
A rectangle, with the origin at the upper left.
static void Color24DitherYUY2Mod2X(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)
static void Color32DitherYV12Mod1X(int *colortab, Uint32 *rgb_2_pix, unsigned char *lum, unsigned char *cr, unsigned char *cb, unsigned char *out, int rows, int cols, int mod)