Mean

Mean

Supported Technologies

SSE2

Synopsis

FwStatus   fwsMean_32f ( const Fw32f * pSrc, int len, Fw32f * pMean, FwHintAlgorithm hint );
FwStatus   fwsMean_32fc ( const Fw32fc * pSrc, int len, Fw32fc * pMean, FwHintAlgorithm hint );
FwStatus   fwsMean_64f ( const Fw64f * pSrc, int len, Fw64f * pMean );
FwStatus   fwsMean_64fc ( const Fw64fc * pSrc, int len, Fw64fc * pMean );
FwStatus   fwsMean_16s_Sfs ( const Fw16s * pSrc, int len, Fw16s * pMean, int scaleFactor );
FwStatus   fwsMean_16sc_Sfs ( const Fw16sc * pSrc, int len, Fw16sc * pMean, int scaleFactor );

Parameters

hint   Hints whether to choose a fast or accurate computation algorithm.
len   Specifies the number of elements in a buffer.
pMean   Pointer to the destination buffer that contains the mean of the values in the source buffer.
pSrc   Pointer to a source buffer.
scaleFactor   Specifies an integer scaling factor for the Sfs operation. The returned result is multiplied by 2^(-scaleFactor).

Description

These functions step through vector elements in a source buffer, calculate the arithmetic mean, and write the value to a location specified by a pointer.

The following formula is used.

 Mean = 1/len ((n = 0) - (len-1)) Sum(pSrc[n])

The 16-bit signed and 16-bit signed complex versions perform an integer scaling operation on the result.