Descriptor Codes and Parameters for ippi Functions


Intel® IPP Image processing function naming conventions are same as other Intel IPP APIs. In general Intel IPP image processing naming convention can be described as below.


This table explains the descriptor codes used for Intel IPP functions with prefix ippi.





The images have 4 channels, the fourth of which is the alpha channel. When identified in this way, the alpha channel will be excluded from the operation.

     ippiAddC_8u_AC4R, ippiMean_8u_AC4R


The images have 1,3 or 4 channels of data interleaved in memory. C1, indicating one channel, can also be used for multiple images in most cases.

 ippiDCT8x8Fwd_16s_C1I, ippiRGBToYUV_8u_C3R


The images have interleaved cannels in memory. This is a special case, in which frequently the second "channel" is itself two interleaved, subsampled channels. The sizes and other arguments, though, are based on a 2-channel image.

    ippiYCbCr422ToRGB_8u_C2C3R, ippiJoin422_8u_P3C2R


The operation is performed in place. The result of the operation is written back into the source, and one argument is both a source and a destination.
(default is not-in-place)



The operation uses a mask to determine which pixels on which to operate.


P3, P4

The images have 3 or 4 channels of data arranged in separate planes; the operation takes an array of pointers to image planes.



The function operates on a defined Rectangle of Interest (ROI) for each of the input images. Most image processing functions have this descriptor and use ROI



The function scales the result of the operation, shifting it right by the scaleFactor argument. This shift generally takes place at a higher bit resolution to preserve precision.


Please take care of the C1, C3, AC4, C2, P3 descriptors, especially in image format conversion (Color Conversion)


A general template for the prototype of the image processing function looks like this:

IppStatus ippiBaseName_<mod>(const Ipp<datatype>* pSrc, int srcStep, ippiRect srcRoi, 
                                                          Ipp<datatype>* pDst, int dstStep, IppiSize roiSize, other paramters);



 Explanation  and Example


Pointer to the source image ROI
Pointer to the destination image ROI
The datatype is <bit depth><bit interpretation>, mainly be 8u, 8s, 16u,16s, 32u,32s,32f, 64f.

1. pSrc != pDst (default)
pSrc and pDst usually point to different memory, unless in-place operation where I in function name.
2. pSrc point to the first data of memory space, can be adjust to any place (i,j) by pSrc+ srcStep/sizeof(datatype)*j+i*channel
3. ippi image pointer are align to various image file natually.  

Example 1: ippiDemo (Image Processing Demo)
// create new desitination image,  
CSampleDoc* pDst =CSampleDoc::CreateNewDoc(...)
ippiFunction(..., (Ipp8u*)pDst->DataPtr(), ...)
Example 2:  Using Intel® IPP with OpenCV 2.1 
IplImage* pDstImgCV= cvCreateImage(...)
ippiFunction(..., (Ipp8u*)pDstImgCV->imageData


Distance in bytes between starts of consecutive lines in the image.

More often, it is image width in bytes. But the value depends on the image data  layout and data type.

step != imgROI.width*Channal*sizeof(datatype)
In most of case, they are equal. But sometimes, it is not, especially for bmp image and ippiMalloc, which required 4 bytes aligned and 32 bytes aligned correspondingly. there are padded zero at the end of row.
Example 1, RGB 8u 271x480, bmp image.
step= ((width*channels*sizeof(datatype))+3)>>2)<<2 = 816  ( not 3x271=813)
Example 2: Wrong step cause incorrect result or program crash randomly. See forum discussion U78264


Size of the source and destination ROI in pixels.

Declared in the ippdefs.h file
typedef struct {
    int width;
    int height;
} IppiSize;

More often roiSize={imgWidth, imgHeight}
But it is actaully the width and height of ROI.
roiSize={roiWidth, roiHeight}. Combined with Pointer pSrc/pDst, it can locate the Region (Rectangle) of Interest.

Example 1: Processing an Image from Edge to Edge   
Example 2:  Upgrade Code Examples in IPP Book for Intel® Compiler and Intel® Parallel Studio


Region of interest in the source image

Declared in ippdefs.h file
typedef struct {
    int x;           int y;
    int width;      int height;
} IppiRect;
x, y denote the coordinates of the top left corner of ROI

More often roiSize={0, 0 imgWidth, imgHeight}
but it can locate the ROI exactly via specify the four values explicitly. The parameter are often used in ippi Geometric Transforms as locate src image ROI

Example 1,  ippiDemo.exe
on 512x512 RGB image and to resize the first quarter
IppiRect srcRoi = {0,srcHeight/2, srcWidth/ 2, srcHeight/2}; 
// x=0, y=128, 128x128, where orgin (0,0) is bottom-left of image
Example 2, ippiResizesqrPixel use independent systems of co-ordinates for srcROI and dstROI,  see forum discussion U65400

To know more about usage of these functions, refer to Image and Video processing manual(Volume 2) - /en-us/

Для получения подробной информации о возможностях оптимизации компилятора обратитесь к нашему Уведомлению об оптимизации.
Возможность комментирования русскоязычного контента была отключена. Узнать подробнее.