RGBA Conversion

Started by
2 comments, last by soumya_iiitc 16 years, 2 months ago
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.
Advertisement
Linky!
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 :(
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.

This topic is closed to new replies.

Advertisement