Texas Instruments TMS320C64X Programmer's Reference Manual page 91

Dsp little-endian dsp library
Hide thumbs Also See for TMS320C64X:
Table of Contents

Advertisement

DSP_maxidx
Function
Arguments
Description
Algorithm
Special Requirements
Index of Maximum Element of Vector
int DSP_maxidx (const short *x, int nx)
x[nx]
Pointer to input vector of size nx. Must be double-word aligned.
Length of input data vector. Must be multiple of 16 and ≥ 48.
nx
return int
Index for vector element with maximum value.
This routine finds the max value of a vector and returns the index of that value.
The input array is treated as 16 separate columns that are interleaved
throughout the array. If values in different columns are equal to the maximum
value, then the element in the leftmost column is returned. If two values within
a column are equal to the maximum, then the one with the lower index is
returned. Column takes precedence over index.
This is the C equivalent of the assembly code without restrictions. Note that
the assembly code is hand optimized and restrictions may apply.
int DSP_maxidx(short x[ ], int nx)
{
int max, index, i;
max = −32768;
for (i = 0; i < nx; i++)
if (x[i] > max) {
max = x[i];
index = i;
}
return index;
}
-
nx must be a multiple of 16 and greater than or equal to 48.
-
The input vector x[ ] must be double-word aligned.
DSP_maxidx
C64x+ DSPLIB Reference
4-63

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tms320c64x+

Table of Contents