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

This commit is contained in:
Lei Zhang 2008-12-09 16:35:32 -08:00 committed by Alexandre Julliard
parent e755a96fc8
commit 0537a122c7
1 changed files with 5 additions and 5 deletions

View File

@ -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");
}