Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Guojiangli
Beginner
190 Views

ipp BGR32 to YUV420, Lost Color

void BGRA2NV12(const unsigned char I[], const int image_width, const int image_height, unsigned char J[])
{
IppStatus ipp_status;

int srcStep = image_width * 4;
int dstYStep = image_width;
int dstCbCrStep = image_width;
IppiSize roiSize = { image_width, image_height };

const Ipp8u* psrc=(Ipp8u*)I;

Ipp8u* pDstY = (Ipp8u*)J; //Y color plane is the first image_width*image_height pixels of J.
Ipp8u* pDstCbCr = (Ipp8u*)&J[image_width * image_height]; //In NV12 format, UV plane starts below Y.
Ipp8u* pDstV = (Ipp8u*)&J[image_width * image_height * 3 / 2];

//unsigned char * pDst[3] = { pDstY, pDstCbCr, pDstV };
unsigned char* pDst[3] = { pDstY, pDstCbCr, pDstV };
int dstStep[3] = { image_width, image_width / 2, image_width / 2 };

ipp_status = ippiBGRToYCbCr420_8u_AC4P3R((Ipp8u*)pSrc, srcStep, (Ipp8u**)pDst, dstStep, roiSize);
#if 0
if (ipp_status != ippStsNoErr)
{
memset(J, 128, image_width * image_height * 3 / 2);
}
#endif
}

 

Use this function to compare the original image with the output image during image conversion. It is found that the output image, red is lost. Is it written in the wrong way? How to solve it?

0 Kudos
2 Replies
AbhishekD_Intel
Moderator
172 Views

Hi,


Thanks for reaching out to us.

We are forwarding this issue to the SME.


Warm Regards,

Abhishek


Abhinav_S_Intel
Moderator
119 Views


The function BGRToYUV420 uses the same formulas as the function ippiRGBToYUV does. Can you please refer and verify the formulas mentioned here in this example?

https://software.intel.com/content/www/us/en/develop/documentation/ipp-dev-reference/top/volume-2-im...

Reply