Sign in to follow this  

RGBA Conversion

This topic is 3589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Converting YUV to RGB as such is easy, a few multiplies and adds. The formulas are well-known and available for example at http://en.wikipedia.org/wiki/Yuv.

The problem is, however, that you have 4:2:2 data, i.e. your image is chroma subsampled. This means you have to decode two pixels at a time (or at least, you have to read two pixels at a time for being able to decode one). There is sample code for decoding one 4:2:2 layout on the same page at Wikipedia too.
However, there are half a dozen different component layouts for 4:2:2, so it might happen that it's not the one you need.

EDIT: Ah darn, Rattenhirn beat me to it :(

Share this post


Link to post
Share on other sites
Thanks for the link.

Is there is any ready code available which will convert YUV 4:2:2 data to RGBA.
I am using Visual Studio 8.0.

I know that ffmpeg dll will solve my purpose but i don't want to include this for this purpose only.

Share this post


Link to post
Share on other sites

This topic is 3589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this