UpdatePower

Integrates the square of an input vector with specified integration weight.

Syntax

IppStatus ippsUpdatePower_16s32s_I(const Ipp16s* pSrc, int len, Ipp32s* pSrcDst, int srcShiftRight,Ipp16s alpha, IppHintAlgorithm hint);

Parameters

pSrc

Pointer to the source vector.

len

Number of elements of the vector.

pSrcDst

Pointer to input and output

srcShiftRight

Shift value.

alpha

Integration weight.

hint

Suggests using specific code. The possible values for the hint argument are described in Hint Arguments.

Description

The function ippsUpdatePower is declared in the ipps.h file. This function performs len iterations in which the sum alpha * pSrcDst + (1 - alpha) * (pSrc[i] *pSrc[i]) shift is calculated and stored in pSrcDst. Here i is the number of previous iterations, pSrcDst is the result of previous iteration, and (pSrc[i] * pSrc[i]) shift is the squared i-th element right-shifted by the non-negative value srcShiftRight.

The example below shows how to use the function ippsUpdatePower.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when at least one of the specified pointers is NULL.

ippStsSizeErr

Indicates an error when len is less than or equal to 0.

Using the Function ippsUpdatePower

void func_updatepower()
{    
    Ipp16s pSrc[2] = {16, 32};
    Ipp32s pSrcDst = 1;
    Ipp16s alpha = 3;
    int shift = 1;
    int srcLen = 2;

		
    ippsUpdatePower_16s32s_I(pSrc, 2, &pSrcDst, shift, alpha, ippAlgHintFast);
}
Result:  -1783

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.