Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6704 Discussions

Functions with Sfs (saturation & fixed scaling)

cks2k2
Beginner
382 Views
Question on Sfs functions for example I have an Ipp8u data with value = 2.
And I call the function ippiSqr_8u_C1RSfs() on this number with scale factor = -3.
My result would be 11.
(Example copied from IPP manual).
If I pass this result to another function that only accepts 8u i.e. ippiBilateral_8u_C1R(), will ippiBilateral() use the value 11 or will it use 11*pow(2, -3) = 1.375 ?
Basically I want to write a tone mapping program based on Durand-Dorsey operator, where they perform a bilateral filter on the log(intensity) of the input image. Given that ippiBilateral() only works on 8u, and log will return floating point results, I wonder if with Sfs I can perserve the floating point in 8u form and pass it to ippiBilateral() and have it work as if it was dealing with floating point?
0 Kudos
1 Reply
Ying_H_Intel
Employee
382 Views
Hi cks2k2,

I guess I can understand your question.Itseems the limitation of integerdatatypecomputationare everywhere, thus as developer,we have to take them intoconsidering in details.

Itis valuable totrythem, but please note some facts before do that :
1)ippiBilateral_8u_C1R()and ippiSqr_8u_C1RSfs()(ipps10Log10_32s_Sfs) are independent functions.
So if you feed ippiBilateral with 11, then it willdealedas 11. the function doesn't retain the data as 1.375. And you mustdo the retainyourself after get the output of ippiBilateral.

2)ippiBilateral_8u_C1R()work internally in floating points precisionand thensaturated to the destination data type range before output.

For example, if yourinput image's intensity is 10^1.41, and log(intensity) is 1.41 and output is 1
or if use scalefactor -3, the outputis 11.

Thenuse 11 as input ofippiBilateral, you will get one integer output image. As your input is scaling result of last operatin, you musthandlethe output's scaling according the feature ofbilaterial.
Or use 1 as input of ofippiBilateral, you will get another integer output image.
Comparing the two output image and choose the one suitable.

Best Regards,
Ying

0 Kudos
Reply