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

bt 601 check accuracy #397

Open
GoogleCodeExporter opened this issue Mar 25, 2015 · 0 comments
Open

bt 601 check accuracy #397

GoogleCodeExporter opened this issue Mar 25, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Check the bt.601 YUV to RGB formala is correct.

This is reference code used by libyuv

void YUVToRGBReference(int y, int u, int v, int* r, int* g, int* b) {
  *r = RoundToByte((y - 16) * 1.164 + (v - 128) * 1.596);
  *g = RoundToByte((y - 16) * 1.164 + (u - 128) * -0.391 + (v - 128) * -0.813);
  *b = RoundToByte((y - 16) * 1.164 + (u - 128) * 2.018);
}

which matches this
http://stackoverflow.com/questions/11306802/yuv420p-to-rgb-image-conversion

Microsoft documents it with more accuracy
https://msdn.microsoft.com/en-us/library/windows/desktop/dd206750%28v=vs.85%29.a
spx

This also shows some of the conversions
http://en.wikipedia.org/wiki/YUV#Numerical_approximations

Original issue reported on code.google.com by [email protected] on 6 Feb 2015 at 11:04

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