Description
Algorithm
Special Requirements errCoefs must be double-word aligned.
Implementation Notes
Benchmarks
Performs a dot product on 256 pairs of 9 element vectors and searches for the
pair of vectors which produces the maximum dot product result. This is a large
part of the VSELP vocoder codebook search. The function stores the index to
the first element of the 9-element vector that resulted in the maximum dot prod-
uct in the memory location Pointed by max_index. The maximum dot product
value is returned by the function.
This is the C equivalent for the assembly code. Note that the assembly code
is hand optimized and restrictions may apply.
float DSPF_sp_minerr(const float* GSP0_TABLE, const float*
errCoefs,
int *restrict max_index)
{
float val, maxVal = -50;
int i, j;
for (i = 0; i < GSP0_NUM; i++)
{
for (val = 0, j = 0; j < GSP0_TERMS; j++)
val += GSP0_TABLE[i*GSP0_TERMS+j] * errCoefs[j];
if (val > maxVal)
{
maxVal = val;
*max_index = i*GSP0_TERMS;
}
}
return (maxVal);
}
-
The inner loop is totally unrolled.
-
Endianess: This code is little endian.
-
Interruptibility: This code is interrupt-tolerant but not interruptible.
Cycles
1188
Code size
736
(in bytes)
DSPF_sp_minerr
DSPLIB Reference
4-77
Need help?
Do you have a question about the TMS320C67 DSP Series and is the answer not in the manual?
Questions and answers