AddC

Adds a constant value to each element of a vector.

Syntax

Intel IPP style:

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

IppStatus ippsqAddCQ15_16s_s(const Ipp16s* pSrc, Ipp16s val, Ipp16s* pDst, Ipp32u len);

IppStatus ippsqAddCQ31_32s_s(const Ipp32s* pSrc, Ipp32s val, Ipp32s* pDst, Ipp32u len);

DSP style:

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

void ippsq_offset_q15(const q15_t* pSrc, q15_tval, q15_t* pDst, uint32_t len);

void ippsq_offset_q31(const q31_t* pSrc, q31_t val, 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.

Description

This function adds the val value to each element of the pSrc vector and stores the result in pDst. Function flavors with the _s suffix perform saturation of the result if the output value exceeds the data range.

Q31 and Q15 function flavors perform saturation if the resulting value exceeds the data range.

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.