21 #include "../SDL_internal.h" 94 #ifdef USE_MMX_ASSEMBLY 95 extern void Color565DitherYV12MMX1X(
int *colortab,
Uint32 * rgb_2_pix,
96 unsigned char *lum,
unsigned char *cr,
97 unsigned char *cb,
unsigned char *out,
98 int rows,
int cols,
int mod);
99 extern void ColorRGBDitherYV12MMX1X(
int *colortab,
Uint32 * rgb_2_pix,
100 unsigned char *lum,
unsigned char *cr,
101 unsigned char *cb,
unsigned char *out,
102 int rows,
int cols,
int mod);
107 unsigned char *lum,
unsigned char *cr,
108 unsigned char *cb,
unsigned char *out,
109 int rows,
int cols,
int mod)
111 unsigned short *row1;
112 unsigned short *row2;
118 int cols_2 = cols / 2;
120 row1 = (
unsigned short *) out;
121 row2 = row1 + cols + mod;
132 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
133 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
134 + colortab[*cb + 2 * 256];
135 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
140 *row1++ = (
unsigned short) (rgb_2_pix[L + cr_r] |
141 rgb_2_pix[L + crb_g] |
142 rgb_2_pix[L + cb_b]);
145 *row1++ = (
unsigned short) (rgb_2_pix[L + cr_r] |
146 rgb_2_pix[L + crb_g] |
147 rgb_2_pix[L + cb_b]);
153 *row2++ = (
unsigned short) (rgb_2_pix[L + cr_r] |
154 rgb_2_pix[L + crb_g] |
155 rgb_2_pix[L + cb_b]);
158 *row2++ = (
unsigned short) (rgb_2_pix[L + cr_r] |
159 rgb_2_pix[L + crb_g] |
160 rgb_2_pix[L + cb_b]);
177 unsigned char *lum,
unsigned char *cr,
178 unsigned char *cb,
unsigned char *out,
179 int rows,
int cols,
int mod)
189 int cols_2 = cols / 2;
192 row2 = row1 + cols * 3 + mod * 3;
204 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
205 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
206 + colortab[*cb + 2 * 256];
207 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
212 value = (rgb_2_pix[L + cr_r] |
213 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
214 *row1++ = (
value) & 0xFF;
215 *row1++ = (value >> 8) & 0xFF;
216 *row1++ = (value >> 16) & 0xFF;
219 value = (rgb_2_pix[L + cr_r] |
220 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
221 *row1++ = (
value) & 0xFF;
222 *row1++ = (value >> 8) & 0xFF;
223 *row1++ = (value >> 16) & 0xFF;
229 value = (rgb_2_pix[L + cr_r] |
230 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
231 *row2++ = (
value) & 0xFF;
232 *row2++ = (value >> 8) & 0xFF;
233 *row2++ = (value >> 16) & 0xFF;
236 value = (rgb_2_pix[L + cr_r] |
237 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
238 *row2++ = (
value) & 0xFF;
239 *row2++ = (value >> 8) & 0xFF;
240 *row2++ = (value >> 16) & 0xFF;
257 unsigned char *lum,
unsigned char *cr,
258 unsigned char *cb,
unsigned char *out,
259 int rows,
int cols,
int mod)
268 int cols_2 = cols / 2;
270 row1 = (
unsigned int *) out;
271 row2 = row1 + cols + mod;
282 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
283 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
284 + colortab[*cb + 2 * 256];
285 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
290 *row1++ = (rgb_2_pix[L + cr_r] |
291 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
294 *row1++ = (rgb_2_pix[L + cr_r] |
295 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
301 *row2++ = (rgb_2_pix[L + cr_r] |
302 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
305 *row2++ = (rgb_2_pix[L + cr_r] |
306 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
328 unsigned char *lum,
unsigned char *cr,
329 unsigned char *cb,
unsigned char *out,
330 int rows,
int cols,
int mod)
332 unsigned int *row1 = (
unsigned int *) out;
333 const int next_row = cols + (mod / 2);
334 unsigned int *row2 = row1 + 2 * next_row;
340 int cols_2 = cols / 2;
344 mod = (next_row * 3) + (mod / 2);
352 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
353 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
354 + colortab[*cb + 2 * 256];
355 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
360 row1[0] = row1[next_row] = (rgb_2_pix[L + cr_r] |
361 rgb_2_pix[L + crb_g] |
362 rgb_2_pix[L + cb_b]);
366 row1[0] = row1[next_row] = (rgb_2_pix[L + cr_r] |
367 rgb_2_pix[L + crb_g] |
368 rgb_2_pix[L + cb_b]);
375 row2[0] = row2[next_row] = (rgb_2_pix[L + cr_r] |
376 rgb_2_pix[L + crb_g] |
377 rgb_2_pix[L + cb_b]);
381 row2[0] = row2[next_row] = (rgb_2_pix[L + cr_r] |
382 rgb_2_pix[L + crb_g] |
383 rgb_2_pix[L + cb_b]);
401 unsigned char *lum,
unsigned char *cr,
402 unsigned char *cb,
unsigned char *out,
403 int rows,
int cols,
int mod)
406 unsigned char *row1 = out;
407 const int next_row = (cols * 2 + mod) * 3;
408 unsigned char *row2 = row1 + 2 * next_row;
414 int cols_2 = cols / 2;
418 mod = next_row * 3 + mod * 3;
426 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
427 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
428 + colortab[*cb + 2 * 256];
429 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
434 value = (rgb_2_pix[L + cr_r] |
435 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
436 row1[0 + 0] = row1[3 + 0] = row1[next_row + 0] =
437 row1[next_row + 3 + 0] = (
value) & 0xFF;
438 row1[0 + 1] = row1[3 + 1] = row1[next_row + 1] =
439 row1[next_row + 3 + 1] = (value >> 8) & 0xFF;
440 row1[0 + 2] = row1[3 + 2] = row1[next_row + 2] =
441 row1[next_row + 3 + 2] = (value >> 16) & 0xFF;
445 value = (rgb_2_pix[L + cr_r] |
446 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
447 row1[0 + 0] = row1[3 + 0] = row1[next_row + 0] =
448 row1[next_row + 3 + 0] = (
value) & 0xFF;
449 row1[0 + 1] = row1[3 + 1] = row1[next_row + 1] =
450 row1[next_row + 3 + 1] = (value >> 8) & 0xFF;
451 row1[0 + 2] = row1[3 + 2] = row1[next_row + 2] =
452 row1[next_row + 3 + 2] = (value >> 16) & 0xFF;
459 value = (rgb_2_pix[L + cr_r] |
460 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
461 row2[0 + 0] = row2[3 + 0] = row2[next_row + 0] =
462 row2[next_row + 3 + 0] = (
value) & 0xFF;
463 row2[0 + 1] = row2[3 + 1] = row2[next_row + 1] =
464 row2[next_row + 3 + 1] = (value >> 8) & 0xFF;
465 row2[0 + 2] = row2[3 + 2] = row2[next_row + 2] =
466 row2[next_row + 3 + 2] = (value >> 16) & 0xFF;
470 value = (rgb_2_pix[L + cr_r] |
471 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
472 row2[0 + 0] = row2[3 + 0] = row2[next_row + 0] =
473 row2[next_row + 3 + 0] = (
value) & 0xFF;
474 row2[0 + 1] = row2[3 + 1] = row2[next_row + 1] =
475 row2[next_row + 3 + 1] = (value >> 8) & 0xFF;
476 row2[0 + 2] = row2[3 + 2] = row2[next_row + 2] =
477 row2[next_row + 3 + 2] = (value >> 16) & 0xFF;
495 unsigned char *lum,
unsigned char *cr,
496 unsigned char *cb,
unsigned char *out,
497 int rows,
int cols,
int mod)
499 unsigned int *row1 = (
unsigned int *) out;
500 const int next_row = cols * 2 + mod;
501 unsigned int *row2 = row1 + 2 * next_row;
507 int cols_2 = cols / 2;
511 mod = (next_row * 3) + mod;
519 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
520 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
521 + colortab[*cb + 2 * 256];
522 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
527 row1[0] = row1[1] = row1[next_row] = row1[next_row + 1] =
528 (rgb_2_pix[L + cr_r] |
529 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
533 row1[0] = row1[1] = row1[next_row] = row1[next_row + 1] =
534 (rgb_2_pix[L + cr_r] |
535 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
542 row2[0] = row2[1] = row2[next_row] = row2[next_row + 1] =
543 (rgb_2_pix[L + cr_r] |
544 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
548 row2[0] = row2[1] = row2[next_row] = row2[next_row + 1] =
549 (rgb_2_pix[L + cr_r] |
550 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
568 unsigned char *lum,
unsigned char *cr,
569 unsigned char *cb,
unsigned char *out,
570 int rows,
int cols,
int mod)
577 int cols_2 = cols / 2;
579 row = (
unsigned short *) out;
587 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
588 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
589 + colortab[*cb + 2 * 256];
590 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
596 *row++ = (
unsigned short) (rgb_2_pix[L + cr_r] |
597 rgb_2_pix[L + crb_g] |
598 rgb_2_pix[L + cb_b]);
602 *row++ = (
unsigned short) (rgb_2_pix[L + cr_r] |
603 rgb_2_pix[L + crb_g] |
604 rgb_2_pix[L + cb_b]);
614 unsigned char *lum,
unsigned char *cr,
615 unsigned char *cb,
unsigned char *out,
616 int rows,
int cols,
int mod)
624 int cols_2 = cols / 2;
626 row = (
unsigned char *) out;
634 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
635 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
636 + colortab[*cb + 2 * 256];
637 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
643 value = (rgb_2_pix[L + cr_r] |
644 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
645 *row++ = (
value) & 0xFF;
646 *row++ = (value >> 8) & 0xFF;
647 *row++ = (value >> 16) & 0xFF;
651 value = (rgb_2_pix[L + cr_r] |
652 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
653 *row++ = (
value) & 0xFF;
654 *row++ = (value >> 8) & 0xFF;
655 *row++ = (value >> 16) & 0xFF;
664 unsigned char *lum,
unsigned char *cr,
665 unsigned char *cb,
unsigned char *out,
666 int rows,
int cols,
int mod)
673 int cols_2 = cols / 2;
675 row = (
unsigned int *) out;
682 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
683 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
684 + colortab[*cb + 2 * 256];
685 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
691 *row++ = (rgb_2_pix[L + cr_r] |
692 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
696 *row++ = (rgb_2_pix[L + cr_r] |
697 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
712 unsigned char *lum,
unsigned char *cr,
713 unsigned char *cb,
unsigned char *out,
714 int rows,
int cols,
int mod)
716 unsigned int *
row = (
unsigned int *) out;
717 const int next_row = cols + (mod / 2);
722 int cols_2 = cols / 2;
730 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
731 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
732 + colortab[*cb + 2 * 256];
733 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
739 row[0] = row[next_row] = (rgb_2_pix[L + cr_r] |
740 rgb_2_pix[L + crb_g] |
741 rgb_2_pix[L + cb_b]);
746 row[0] = row[next_row] = (rgb_2_pix[L + cr_r] |
747 rgb_2_pix[L + crb_g] |
748 rgb_2_pix[L + cb_b]);
758 unsigned char *lum,
unsigned char *cr,
759 unsigned char *cb,
unsigned char *out,
760 int rows,
int cols,
int mod)
763 unsigned char *
row = out;
764 const int next_row = (cols * 2 + mod) * 3;
769 int cols_2 = cols / 2;
776 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
777 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
778 + colortab[*cb + 2 * 256];
779 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
785 value = (rgb_2_pix[L + cr_r] |
786 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
787 row[0 + 0] = row[3 + 0] = row[next_row + 0] =
788 row[next_row + 3 + 0] = (
value) & 0xFF;
789 row[0 + 1] = row[3 + 1] = row[next_row + 1] =
790 row[next_row + 3 + 1] = (value >> 8) & 0xFF;
791 row[0 + 2] = row[3 + 2] = row[next_row + 2] =
792 row[next_row + 3 + 2] = (value >> 16) & 0xFF;
797 value = (rgb_2_pix[L + cr_r] |
798 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
799 row[0 + 0] = row[3 + 0] = row[next_row + 0] =
800 row[next_row + 3 + 0] = (
value) & 0xFF;
801 row[0 + 1] = row[3 + 1] = row[next_row + 1] =
802 row[next_row + 3 + 1] = (value >> 8) & 0xFF;
803 row[0 + 2] = row[3 + 2] = row[next_row + 2] =
804 row[next_row + 3 + 2] = (value >> 16) & 0xFF;
814 unsigned char *lum,
unsigned char *cr,
815 unsigned char *cb,
unsigned char *out,
816 int rows,
int cols,
int mod)
818 unsigned int *
row = (
unsigned int *) out;
819 const int next_row = cols * 2 + mod;
824 int cols_2 = cols / 2;
832 cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256];
833 crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256]
834 + colortab[*cb + 2 * 256];
835 cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256];
841 row[0] = row[1] = row[next_row] = row[next_row + 1] =
842 (rgb_2_pix[L + cr_r] |
843 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
848 row[0] = row[1] = row[next_row] = row[next_row + 1] =
849 (rgb_2_pix[L + cr_r] |
850 rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]);
899 Uint32 Rmask, Gmask, Bmask, Amask;
903 (target_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask) || bpp < 15) {
904 return SDL_SetError(
"Unsupported YUV destination format");
908 r_2_pix_alloc = &swdata->
rgb_2_pix[0 * 768];
909 g_2_pix_alloc = &swdata->
rgb_2_pix[1 * 768];
910 b_2_pix_alloc = &swdata->
rgb_2_pix[2 * 768];
915 for (i = 0; i < 256; ++
i) {
919 r_2_pix_alloc[i + 256] <<= freebits;
921 r_2_pix_alloc[i + 256] |= Amask;
926 g_2_pix_alloc[i + 256] <<= freebits;
928 g_2_pix_alloc[i + 256] |= Amask;
933 b_2_pix_alloc[i + 256] <<= freebits;
935 b_2_pix_alloc[i + 256] |= Amask;
946 for (i = 0; i < 256; ++
i) {
947 r_2_pix_alloc[i + 256] |= (r_2_pix_alloc[i + 256]) << 16;
948 g_2_pix_alloc[i + 256] |= (g_2_pix_alloc[i + 256]) << 16;
949 b_2_pix_alloc[i + 256] |= (b_2_pix_alloc[i + 256]) << 16;
957 for (i = 0; i < 256; ++
i) {
958 r_2_pix_alloc[
i] = r_2_pix_alloc[256];
959 r_2_pix_alloc[i + 512] = r_2_pix_alloc[511];
960 g_2_pix_alloc[
i] = g_2_pix_alloc[256];
961 g_2_pix_alloc[i + 512] = g_2_pix_alloc[511];
962 b_2_pix_alloc[
i] = b_2_pix_alloc[256];
963 b_2_pix_alloc[i + 512] = b_2_pix_alloc[511];
971 #ifdef USE_MMX_ASSEMBLY 974 (Gmask == 0x07E0) && (Bmask == 0x001F)
975 && (swdata->
w & 15) == 0) {
977 swdata->
Display1X = Color565DitherYV12MMX1X;
992 #ifdef USE_MMX_ASSEMBLY 995 (Gmask == 0x0000FF00) &&
996 (Bmask == 0x000000FF) && (swdata->
w & 15) == 0) {
998 swdata->
Display1X = ColorRGBDitherYV12MMX1X;
1078 Cr_r_tab = &swdata->
colortab[0 * 256];
1079 Cr_g_tab = &swdata->
colortab[1 * 256];
1080 Cb_g_tab = &swdata->
colortab[2 * 256];
1081 Cb_b_tab = &swdata->
colortab[3 * 256];
1082 for (i = 0; i < 256; i++) {
1086 CB = CR = (i - 128);
1087 Cr_r_tab[
i] = (int) ((0.419 / 0.299) * CR);
1088 Cr_g_tab[
i] = (int) (-(0.299 / 0.419) * CR);
1089 Cb_g_tab[
i] = (int) (-(0.114 / 0.331) * CB);
1090 Cb_b_tab[
i] = (int) ((0.587 / 0.331) * CB);
1111 SDL_assert(0 &&
"We should never get here (caught above)");
1123 *pixels = swdata->
planes[0];
1130 const void *
pixels,
int pitch)
1132 switch (swdata->
format) {
1135 if (rect->
x == 0 && rect->
y == 0 &&
1136 rect->
w == swdata->
w && rect->
h == swdata->
h) {
1138 (swdata->
h * swdata->
w) + (swdata->
h * swdata->
w) / 2);
1145 src = (
Uint8 *) pixels;
1146 dst = swdata->
pixels + rect->
y * swdata->
w + rect->
x;
1148 for (row = 0; row < rect->
h; ++
row) {
1155 src = (
Uint8 *) pixels + rect->
h * pitch;
1156 dst = swdata->
pixels + swdata->
h * swdata->
w;
1157 dst += rect->
y/2 * swdata->
w/2 + rect->
x/2;
1158 length = rect->
w / 2;
1159 for (row = 0; row < rect->
h/2; ++
row) {
1166 src = (
Uint8 *) pixels + rect->
h * pitch + (rect->
h * pitch) / 4;
1167 dst = swdata->
pixels + swdata->
h * swdata->
w +
1168 (swdata->
h * swdata->
w) / 4;
1169 dst += rect->
y/2 * swdata->
w/2 + rect->
x/2;
1170 length = rect->
w / 2;
1171 for (row = 0; row < rect->
h/2; ++
row) {
1186 src = (
Uint8 *) pixels;
1190 length = rect->
w * 2;
1191 for (row = 0; row < rect->
h; ++
row) {
1204 const Uint8 *Yplane,
int Ypitch,
1205 const Uint8 *Uplane,
int Upitch,
1206 const Uint8 *Vplane,
int Vpitch)
1215 dst = swdata->
pixels + rect->
y * swdata->
w + rect->
x;
1217 for (row = 0; row < rect->
h; ++
row) {
1226 dst = swdata->
pixels + swdata->
h * swdata->
w;
1228 dst = swdata->
pixels + swdata->
h * swdata->
w +
1229 (swdata->
h * swdata->
w) / 4;
1231 dst += rect->
y/2 * swdata->
w/2 + rect->
x/2;
1232 length = rect->
w / 2;
1233 for (row = 0; row < rect->
h/2; ++
row) {
1242 dst = swdata->
pixels + swdata->
h * swdata->
w;
1244 dst = swdata->
pixels + swdata->
h * swdata->
w +
1245 (swdata->
h * swdata->
w) / 4;
1247 dst += rect->
y/2 * swdata->
w/2 + rect->
x/2;
1248 length = rect->
w / 2;
1249 for (row = 0; row < rect->
h/2; ++
row) {
1259 void **
pixels,
int *pitch)
1261 switch (swdata->
format) {
1265 && (rect->
x != 0 || rect->
y != 0 || rect->
w != swdata->
w 1266 || rect->
h != swdata->
h)) {
1268 (
"YV12 and IYUV textures only support full surface locks");
1274 *pixels = swdata->
planes[0] + rect->
y * swdata->
pitches[0] + rect->
x * 2;
1276 *pixels = swdata->
planes[0];
1295 Uint8 *lum, *Cr, *Cb;
1298 if (targetbpp == 0) {
1311 if (srcrect->
x || srcrect->
y || srcrect->
w < swdata->
w 1312 || srcrect->
h < swdata->
h) {
1319 }
else if ((srcrect->
w != w) || (srcrect->
h != h)) {
1320 if ((w == 2 * srcrect->
w) && (h == 2 * srcrect->
h)) {
1328 Uint32 Rmask, Gmask, Bmask, Amask;
1341 Gmask, Bmask, Amask);
1352 Gmask, Bmask, Amask);
1360 switch (swdata->
format) {
1377 lum = swdata->
planes[0] + 1;
1389 mod = (pitch / targetbpp);
1392 mod -= (swdata->
w * 2);
1394 lum, Cr, Cb, pixels, swdata->
h, swdata->
w, mod);
1398 lum, Cr, Cb, pixels, swdata->
h, swdata->
w, mod);
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
GLfloat GLfloat GLfloat GLfloat h
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)
uint32_t Uint32
An unsigned 32-bit integer type.
#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)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
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)
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)
GLubyte GLubyte GLubyte GLubyte w
GLsizei const GLfloat * value
static int free_bits_at_bottom_nonzero(Uint32 a)
GLint GLint GLint GLint GLint GLint y
#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)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
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)
static SDL_INLINE int free_bits_at_bottom(Uint32 a)
#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)
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)
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)