Developer Reference

  • 2020
  • 07/15/2020
  • Public Content
Contents

Integer Result Scaling

The default for image processing functions is to saturate the results without scaling them.
Some image processing functions operating on integer data use scaling of the internally computed output results by the integer
scaleFactor
, which is specified as one of the function parameters. These functions have the
Sfs
descriptor in their names.
The scale factor can be negative, positive, or zero. Scaling is applied because internal computations are generally performed with a higher precision than the data types used for input and output images.
The result of integer operations is always saturated to the destination data type range even when scaling is used.
The scaling of an integer result is done by multiplying the output pixel values by 2
-
scaleFactor
before the function returns. This helps retain either the output data range or its precision. Usually the scaling with a positive factor is performed by the shift operation. The result is rounded off to the nearest even integer number (see Rounding Mode).
For example, the integer
Ipp16s
result of the square operation for the input value 200 is equal to 32767 instead of 40000, that is, the result is saturated and the exact value cannot be restored. The scaling of the output value with the factor
scaleFactor
= 1 yields the result 20000, which is not saturated, and the exact value can be restored as 20000*2. Thus, the output data range is retained.
The following example shows how the precision can be partially retained by means of scaling. The integer square root operation (without scaling) for the input value 2 gives the result equal to 1 instead of 1.414. Scaling of the internally computed output value with the factor
scaleFactor
= -3 gives the result 11, and permits the more precise value to be restored as 11*2
-3
= 1.375.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804