Computes the sum of squares of vector elements.

Syntax

Intel IPP style:

IppStatus ippsqSumSqr_32f(const Ipp32f* pSrc, Ipp32u len, Ipp32f* pSumSqr);

IppStatus ippsqSumSqrQ15Q30_16s64s(const Ipp16s* pSrc, Ipp32u len, Ipp64s* pSumSqr);

IppStatus ippsqSumSqrQ31Q48_32s64s_Rms(const Ipp32s* pSrc, Ipp32u len, Ipp64s* pSumSqr);

DSP style:

void ippsq_power_f32(const float32_t* pSrc, uint32_t len, float32_t* pSumSqr);

void ippsq_power_q15(const q15_t* pSrc, uint32_t len, q63_t* pSumSqr);

void ippsq_power_q31(const q31_t* pSrc, uint32_t len, q63_t* pSumSqr);

Include Files

ippsq.h

dsp.h

Parameters

pSrc

Pointer to the source vector.

pSumSqr

Pointer to the result.

len

Number of elements in the vector.

Description

This function computes the sum of squares of elements of the pSrc vector and stores the result in pSumSqr. The result is computed by the following formula:

SumSqr=SUM(pSrc[n]*pSrc[n])

Function flavor with the _Rms suffix additionally does the following:

  • Performs rounding down.

  • Performs saturation of the result if it exceeds the data range.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when any of the specified pointers is NULL.
Para obter informações mais completas sobre otimizações do compilador, consulte nosso aviso de otimização.