Quantcast
Channel: Intel® Software - Intel® Integrated Performance Primitives
Viewing all articles
Browse latest Browse all 1489

Help about YUV420 to RGBA

$
0
0

Hi all,

I have a decoded frame, which is in YUV420 format. I need to convert this file to BGRA or RGBA format. I have found ippiYCbCr420ToBGR_8u_P3C4R API and gave it a try but failed. Could you please help me to find the mistake?

int YUV420_TO_RGB32_IPP( unsigned char *apImage, unsigned char *pY, unsigned char *pU, unsigned char *pV, unsigned int nWidth, unsigned int nHeight) {

const Ipp8u *pYUV[3];
int srcStep[3];
IppiSize roiSize;

pYUV[0] = pY;
pYUV[1] = pU;
pYUV[2] = pV;

srcStep[0] = nWidth;
srcStep[1] = nWidth/2;
srcStep[2] = nWidth/2;

roiSize.width = nWidth;
roiSize.height = nHeight;

Ipp8u aval=255;
ippiYCbCr420ToBGR_8u_P3C4R(pYUV, srcStep, apImage, nWidth*4, roiSize, aval);
return 0;
}

Here is the image that I am supposed to get: https://www.dropbox.com/s/5bgrm4j1cy3v6wq/1.png
Here is the image what I am getting: https://www.dropbox.com/s/86crcvyijz7vd2y/2.png

Thanks.


Viewing all articles
Browse latest Browse all 1489

Trending Articles