RGBA Conversion
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.
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 :(
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 :(
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement