MulC

Multiplies each element of a vector by a constant value.

Syntax

Intel IPP style:

IppStatus ippsqMulC_32f(const Ipp32f* pSrc, Ipp32f val, Ipp32f* pDst, Ipp32u len);

IppStatus ippsqMulCQ15_16s_RmSfs(const Ipp16s* pSrc, Ipp16s len, Ipp16s* pDst, Ipp32u len, int scaleFactor);

IppStatus ippsqMulCQ31_32s_RmSfs(const Ipp32s* pSrc, Ipp32s val, Ipp32s* pDst, Ipp32u len, int scaleFactor);

DSP style:

void ippsq_scale_f32(const float32_t* pSrc, float32_t val, float32_t* pDst, uint32_t len);

void ippsq_scale_q15(const q15_t* pSrc, q15_t val, int32_t scaleFactor, q15_t* pDst, uint32_t len);

void ippsq_scale_q31(const q31_t* pSrc, q31_tval, int32_t scaleFactor, q31_t* pDst, uint32_t len);

Include Files

ippsq.h

dsp.h

Parameters

pSrc

Pointer to the source vector.

val

Scalar value to add to each element of the source vector.

pDst

Pointer to the destination vector.

len

Number of elements in the vector.

scaleFactor

Scale factor for Q15, Q31 function flavors.

Description

This function multiplies each element of the pSrc vector by the val value and stores the result in pDst. Intel IPP-style function flavors with the _RmSfs suffix perform result scaling, rounding down, and saturation.

Scaling is performed by the following formula:

Intel IPP style: pDst[i]=result[i]*2-scaleFactor

DSP style: pDst[i]=result[i]*2scaleFactor

Scaling, Truncation, Saturation

Function Description

ippsqMulCQ15_16s_RmSfs

ippsq_scale_q15

The pSrc values and val are represented in Q15 format. The result of multiplication is represented in Q2.30. After that the function shifts the resulting values with saturation by scaleFactor bits. Finally, the pDst values are represented in Q15 format.

ippsqMulCQ31_32s_RmSfs

ippsq_scale_q31

The pSrc values and val are represented in Q31 format. The result of multiplication is represented in Q2.62. After that the function shifts the resulting values with saturation by scaleFactor bits. Finally, the pDst values are represented in Q31 format.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when any of the specified pointers is NULL.
For more complete information about compiler optimizations, see our Optimization Notice.