Xorg: yuv rfx unsigned

This commit is contained in:
Jay Sorg 2014-11-03 19:08:54 -08:00
parent 3d25d10a54
commit 32598e3214

View File

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