MaxIndx

Returns the maximum value of a vector and the index of the maximum element.

Syntax

Intel IPP style:

IppStatus ippsqMaxIndx_32f(const Ipp32f* pSrc, Ipp32u len, Ipp32f* pMax , Ipp32u* pIndx);

IppStatus ippsqMaxIndxQ15_16s(const Ipp16s* pSrc, Ipp32u len, Ipp16s* pMax , Ipp32u* pIndx);

IppStatus ippsqMaxIndxQ31_32s(const Ipp32s* pSrc, Ipp32u len, Ipp32s* pMax , Ipp32u* pIndx);

DSP style:

void ippsq_max_f32(const float32_t* pSrc, uint32_t len, float32_t* pMax , uint32_t* pIndx);

void ippsq_max_q15(const q15_t* pSrc, uint32_t len, q15_t* pMax , uint32_t* pIndx);

void ippsq_max_q31(const q31_t* pSrc, uint32_t len, q31_t* pMax , uint32_t* pIndx);

Include Files

ippsq.h

dsp.h

Parameters

pSrc

Pointer to the source vector.

len

Number of elements in the vector.

pMax

Pointer to the maximum value.

pIndx

Pointer to the index value of the maximum element.

Description

This function does the following:

  • If pMax is not NULL, returns the maximum value of the source vector pSrc and stores the result in pMax.

  • If pIndx is not NULL, returns the index value of the maximum element and stores it in pIndx.

If there are several equal maximum elements, the first index from the beginning is returned. If len is equal to zero, pMax and pIndx values do not change.

Return Values

ippStsNoErr

Indicates no error.

ippStsSizeErr

Indicates an error when len is equal to zero.

ippStsNullPtrErr

Indicates an error when pSrc is NULL, or both pMax and pIndx are NULL.
For more complete information about compiler optimizations, see our Optimization Notice.