Xorg: yuv rfx unsigned

ulab-next-nosound
Jay Sorg 10 years ago
parent 3d25d10a54
commit 32598e3214

@ -177,13 +177,14 @@ rdpCopyBox_a8r8g8b8_to_yuvalp(int ax, int ay,
y = (r * 19595 + g * 38470 + b * 7471) >> 16; y = (r * 19595 + g * 38470 + b * 7471) >> 16;
u = (r * -11071 + g * -21736 + b * 32807) >> 16; u = (r * -11071 + g * -21736 + b * 32807) >> 16;
v = (r * 32756 + g * -27429 + b * -5327) >> 16; v = (r * 32756 + g * -27429 + b * -5327) >> 16;
y = y - 128; u = u + 128;
y = max(y, -128); v = v + 128;
u = max(u, -128); y = max(y, 0);
v = max(v, -128); u = max(u, 0);
y = min(y, 127); v = max(v, 0);
u = min(u, 127); y = min(y, 255);
v = min(v, 127); u = min(u, 255);
v = min(v, 255);
*(yptr++) = y; *(yptr++) = y;
*(uptr++) = u; *(uptr++) = u;
*(vptr++) = v; *(vptr++) = v;

Loading…
Cancel
Save