Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
Avisos
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

ipp BGR32 to YUV420, Lost Color

Guojiangli
Principiante
1.622 Vistas

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 Respuestas
AbhishekD_Intel
Moderador
1.604 Vistas

Hi,


Thanks for reaching out to us.

We are forwarding this issue to the SME.


Warm Regards,

Abhishek


Abhinav_S_Intel
Moderador
1.552 Vistas


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-image-processing/image-color-conversion/color-model-conversion/rgbtoyuv.html

Responder