(Intel® IPP) - Calling Image Processing Functions

Calling Intel® IPP Functions
Color Conversion from YUV 420 to RGB Results in an Upside-down Image
How can I convert a 24-bit RGB bitmap to a 32-bit RGBA bitmap?
How can I convert raw YUV data to RGB data?
How do I read an image file so it can be used with the Intel IPP?
Which functions can be used to calculate quality differences between two images?
How can I resolve runtime errors and access violations related to image filtering functions?


Calling Intel® IPP Functions

Calling Intel IPP functions is as simple as calling any other C function:

  1. Include the ipp.h header file
  2. Set up the function parameters
  3. Call the function
  4. link ippi library

For select the ippi function for your application, please refer to Descriptor Codes and Parameters for ippi Functions
For link ippi library in your application, please refere to Compiling and Linking with Microsoft* Visual C++* and Intel® C++ Compiler

The multiple versions of optimized code for each function are concealed under a single entry point.
See sample code at Source Code Examples from Intel IPP book

Color conversion from YUV 420 to RGB results in an upside-down image or  in an BGR image
In some imaging pipelines, the interpretations of YUV images and RGB images are flipped relative to each other. The Intel IPP YUVToRGB function does not flip the image. However, Intel IPP does provide routines to perform the flip operation. One solution is to apply the function ippiMirror to flip the result before or after calling the YUVToRGB color conversion function.
If the conversion ippiYUV422ToRGB_8u_C2C3R result in an BGR image, please use call
ippiYCrCb422ToRGB_8u_C2C3R
or
ippiYCbCr422ToBGR_8u_C2C3R
instead of call ippiYUV422ToRGB_8u_C2C3R

How can I convert a 24-bit RGB bitmap to a 32-bit RGBA bitmap?
Create a new 32-bit (4-channel) image and copy the 24-bit (3-channel) image to the 32-bit image:

  • ippiMalloc_8u_AC4
  • ippiCopy_8u_C3AC4R


How can I convert raw YUV data to RGB data?ng>
Use the routine ippiYUV422ToRGB_8u_P3C3R to convert raw YUV to RGB.
and some new ipp color conversion (ippcc) function are avaiable
ippiYUV422ToRGB_8u_C2C3R
ippiYCrCb422ToRGB_8u_C2C3R
ippiRGBToYCbCr420_8u_C3P2R
ippiRGBToYCbCr420_8u_C4P2R
ippiYCbCr420ToRGB_8u_P23R
ippiYUVToRGB_8u_C3C4R
ippiBGRToYCbCr420_709CSC_8u_C3P2R.

How do I read an image file so it can be used with the Intel IPP?
To read an image file, you must understand the structure of the file format you are working with. From this information, you can determine the properties of the image and then store the image data into an Intel IPP buffer. The following is a general outline for loading an image:

  • Retrieve the image properties (width, height, data type, etc.) from the image file header.
  • Based on those properties, create a buffer of the appropriate Intel IPP data type and size.
  • Read/copy the image data into the buffer.
  • Use Intel IPP image processing functions to perform the desired operations on the image data buffer.

For a specific example using Windows* bitmap format, please refer to the ipLoad function from the Tiled Image Processing sample ( ippview.cpp). Read more about Intel IPP image and data type support in the Image Processing Reference Manual, Chapter 2. For image compression, please refer to the Intel IPP JPEG sample code.


Which functions can be used to calculate quality differences between two images?

The Intel IPP contains several functions to measure quality differences between images, including the set of Cross Correlation ( ippiCrossCorXxxx) and Square Distance ( ippiSqrDistanceXxxx) functions. Please refer to Chapter 11 of the Intel IPP Reference Manual: Volume 2 for more details.


How can I resolve runtime errors and access violations related to image filtering functions?
Intel IPP filtering functions assume that all outstanding ROI data exists. The application is required to check that ROI values are set such that all required border pixels exist in the image. If the pixels do not exist then a runtime error will occur. For more information, please refer to the following documents:

Operating System:

Red Hat* Enterprise Linux Desktop 4, Windows Server* 2003 Standard x64 Edition, Red Hat* Enterprise Linux Desktop 3 Update 5, Mac OS*, Red Hat* Enterprise Linux 2.1, SUSE* Linux 9.1, SUSE* Linux Enterprise Server 8.0, SUSE* Linux Enterprise Server 9.0, Windows* XP Professional, Red Hat* Linux 7.3, Red Hat* Linux 8.0, Windows Server* 2003, Red Hat* Linux 9.0, SUSE* Linux* 8.2, Windows* XP 64-Bit Edition Version 2003
For more complete information about compiler optimizations, see our Optimization Notice.