How to determine Source-Image Line Step for frame?

153 Views Asked by At

I have a YUV422 frame (more specifically UYVY format). How can I determine the Source Image Line step because its needed parameter for conversion in function:

NppStatus nppiYUV422ToRGB_8u_P3C3R(const Npp8u* const pSrc[3], int rSrcStep[3], Npp8u* pDst, int nDstStep, NppiSize oSizeROI);
1

There are 1 best solutions below

0
On

The source image line step is the width in bytes between 2 rows.

For some image containers, on the host side, this line step (also called alignement) is a multiple of 32bits in order to improve performance while using SSE instructions.

This value depends on how you have allocated your memory, do you used cudaMalloc or cudaMallocPitch ?

If you are not aware of this value, try to set your line width in bytes (number of colums x sizeof(one pixel) ) or search in the documentation of the library you are using to load images to get the good value.

For example, in OpenCV containers this parameter is called step, while in FreeImagePlus calling getScanWidth will return the good value.