I am a newer to cuda and its image,signal processing library :NPP ,now I am trying to convert YUV420 to BGR ,use this function:
NppStatus nppiYUV420ToBGR_8u_P3C3R(const Npp8u * const pSrc[3], int rSrcStep[3], Npp8u * pDst, int nDstStep, NppiSize oSizeROI);
but I can't decide the rSrcStep , I know it's the row size of each component ,Y U V, but not sure I really understand it , the original image size is 1920x1080 (wxh) ,I use a opencv Mat to contain the YUV image
cv::Mat(cv::Size(1920,1080*3/2), CV_8UC1, (void*)data)
,then for the parameter rSrcStep of the 1st function ,I try rSrcStep={1920,1920/2,1920/2} ,but it returns NPP_STEP_ERROR
ps: for the nDestStep , I use the below function to allocate dest buff ,and get the step at same time
Npp8u *
nppiMalloc_8u_C3(int nWidthPixels, int nHeightPixels, int * pStepBytes);
1080*(3/2) because YUV420 size is wh3/2 bytes when original RGB image is w*h
Set
rSrcStepandnDstStepto the following values:Where
COLS = 1920.In YUV420 planar format (I420), the resolution of Y channel is full resolution, and the resolution of U and V channels is half resolution in each axis.
Example:

Y:
U:

V:

Assuming the data is continuous in memory, the step (row stride in bytes) of Y equals to image width, and the step of U and V equals width/2.
Testing:
The testing code uses FFmpeg for building the input image in raw I420 format, and uses FFmpeg for converting the raw BGR output to PNG image.
Output (

out.png):