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

How to do the multiply of Ipp16s and float?

pango
Beginner
254 Views
my program multiply the RGB vector of a image by a float value,the data type of image is Ipp16s,I write below code to do the multiply:
float ratio=0.5f;//the float value
Ipp16s mulValue[]={IppMax16S*ratio,IppMax16S*ratio,IppMax16S*ratio};
ippiMulC_16s_AC4RSfs(pTempSrc,lineBytesEx,mulValue,pTempDst,lineBytesEx,roiSize,16);//wrong
the result of above code is wrong,and I think the key is that the input of "mulValue" and "scaleFactor" param is wrong,but I can't understand the explaination in SDK,so where is the problem of my code?How to rewrite it?
0 Kudos
1 Reply
Vladimir_Dudnik
Employee
254 Views
Hi,
seems you need to do shift by 15 not by 16:
ippiMulC_16s_AC4RSfs(pTempSrc,lineBytesEx,mulValue,pTempDst,lineBytesEx,roiSize,15);
Regards,
Vladimir
0 Kudos
Reply