Skip to content

bt 601 check accuracy #397

Description

@GoogleCodeExporter
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 fbarch...@google.com on 6 Feb 2015 at 11:04

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions