Mean

Mean

Supported Technologies

SSE2

Synopsis

FwStatus   fwsMean_32f ( const Fw32f * pSrcint lenFw32f * pMeanFwHintAlgorithm hint );
FwStatus   fwsMean_32fc ( const Fw32fc * pSrcint lenFw32fc * pMeanFwHintAlgorithm hint );
FwStatus   fwsMean_64f ( const Fw64f * pSrcint lenFw64f * pMean );
FwStatus   fwsMean_64fc ( const Fw64fc * pSrcint lenFw64fc * pMean );
FwStatus   fwsMean_16s_Sfs ( const Fw16s * pSrcint lenFw16s * pMeanint scaleFactor );
FwStatus   fwsMean_16sc_Sfs ( const Fw16sc * pSrcint lenFw16sc * pMeanint 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.