Jump to content
  • Advertisement
Sign in to follow this  
soumya_iiitc

RGBA Conversion

This topic is 3750 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

I have received a (void *pbuffer) video data in 4:2:2 YUV format.How can i converts this data into RGBA format. Sample code will be very use full for me.

Share this post


Link to post
Share on other sites
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!