RGB to YUV420 conversion using NPP libraries.

I’m trying to use the following function, that takes a packed RGB and creates the YUV planar images.
nppiRGBToYUV420_8u_C3P3R (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst[3], int rDstStep[3], NppiSize oSizeROI)

I’m not sure how to handle Npp8u *pDst[3]. Is that a 3 channel image (nppiMalloc_8u_C3) or three 1 channel images (nppiMalloc_8u_C1) ?
What would be the step size?

In this case the function that you want to call is C3P3R, C3 = one pointer to 3 packed (interleaved) channels (like R,G,B) per pixel (and 1 source step size for the entire row of pixels), P3 = 3 pointers to 3 planar channels, one planar pixel channel per pointer with each channel having a corresponding channel specific destination step size for each row of pixels.

1 Like