Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yuv_table overflow on RGBU #6

Closed
GoogleCodeExporter opened this issue Sep 16, 2015 · 1 comment
Closed

yuv_table overflow on RGBU #6

GoogleCodeExporter opened this issue Sep 16, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

yuv to rgb table uses 2.6 fixed point times 8.0 = 10.6 signed values.

But 2.018 produces a value out of range:
#define RGBU(i) { \
  static_cast<int16>(2.018 * 64 * (i - 128) + 0.5), \
  static_cast<int16>(-0.391 * 64 * (i - 128) + 0.5), \
  0, \
  0 \
}

For RGBU(0xFF)
Since it only affects 2 values, the best solution is to clamp the table entries.

Original issue reported on code.google.com by fbarch...@google.com on 8 Nov 2011 at 7:00

@GoogleCodeExporter
Copy link
Author

The table is fixed.
But in next CL, I'll remove the table method completely.
The SSSE3 version uses multiplies, and the C version mimics the SSSE3 for bit 
exactness

Original comment by fbarch...@chromium.org on 18 Nov 2011 at 9:43

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant