Could scaleFactor be negative?

Could scaleFactor be negative?

I am wondering whether I could setscaleFactor to be negative integer in the function

IppStatus ippsMul_16s_ISfs(const Ipp16s * pSrc, Ipp16s * pSrcDst, int len, int scaleFactor);

Thanks.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi,
Yes. The scale factor can be negative, positive, or zero. Scaling of an integer result is done by multiplying the output vector values by 2** (-scaleFactor ) before the function returns.
if (scaleFactor > 0) pDst = output >> scaleFactor
if (scaleFactor < 0) pDst = output<< ( - scaleFactor)

Thanks

Login to leave a comment.