How to use ippiYCbCr420ToRGB_8u_P2C3R

How to use ippiYCbCr420ToRGB_8u_P2C3R


Based from this link (, I can use ippiYCbCr420ToRGB_8u_P2C3R to convert NV12 to BGR but I can't find any sample code on how to use the API. Could someone give me a simple code snippet? Say a 640x480 NV12 frame to a BGR of the same size? I'm new to IPP (using 7.1 now). What I'm particularly unsure of are these: const Ipp8u* pY, int pYStep, const Ipp8u* pCbCr, int CbCrStep parameters.



3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Chew,

You may refer to IPPi manul page 208 to see the YCbCr420 2 plane format. The width of Y and interlace UV is same, so the step is same
Suppose your NV12 data are stored in to 2 plane . pYdata, and pUVData.
const Ipp8u* pY = pYData;
int pYStep = 640
int CbCrStep=640

then as the do the conversion.

And regarding the code sample, you can refer to ipp sample package, like in ipp image processing ippiDemo sample , ipp UMC sample, there are almost of kind of color conversion functions demo.

Best Regards,

Some code from

Const Ipp8u* (pYUV[3]) = {0,0,0};
pYUV[0] = pData;
pYUV[1] = pYUV[0] + 1920*1080;

pYUV[2] = pYUV[1] + 1920*1080/4

int YUVStep[3] = {1920,960,960};

Int step;

IppiSize roi = {1920,1080};

Ipp8u* pBuf = ippiMalloc_8u_C3(1920,1080, &step);

ippiYUV420ToBGR_8u_P3C3R(pYUV, YUVStep, pBuf, step, roi};

Hi Ying,

Thank you very much for you reply. Actually, I was expecting some sample codes from the evaluation download but the only sample in there was which is kind of limited. I'm assuming now that these samples you mentioned are to be downloaded separately. I'll check that later.

Leave a Comment

Please sign in to add a comment. Not a member? Join today