Commit 0537a122 authored by Lei Zhang's avatar Lei Zhang Committed by Alexandre Julliard

qcap: Don't clip intermediate values in YUV to RGB conversion code.

parent e755a96f
......@@ -68,21 +68,21 @@ void YUV_Init(void) {
for (y_ = 0; y_ <= 255; y_++)
{
y = ((float) 255 / 219) * (y_ - 16);
yuv_xy[y_] = ValidRange((int) (y));
yuv_xy[y_] = y;
}
for (cb = 0; cb <= 255; cb++)
{
u = ((float) 255 / 224) * (cb - 128);
yuv_gu[cb] = - ValidRange((int) (0.344 * u));
yuv_bu[cb] = ValidRange((int) (1.772 * u));
yuv_gu[cb] = -0.344 * u;
yuv_bu[cb] = 1.772 * u;
}
for (cr = 0; cr <= 255; cr++)
{
v = ((float) 255 / 224) * (cr - 128);
yuv_rv[cr] = ValidRange((int) (1.402 * v));
yuv_gv[cr] = - ValidRange((int) (0.714 * v));
yuv_rv[cr] = 1.402 * v;
yuv_gv[cr] = -0.714 * v;
}
TRACE("Filled hash table\n");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment