60 const float factor = float(nInputLength) / nOutputLength;
63 const int last_i = int((nInputLength - 1) / factor);
65 for (i = 0; i <= last_i; i++)
67 const int offset = int(i * factor);
68 const float w = i * factor -
offset;
70 pOutput[i] = (1 -
w) * pInput[offset] + w * pInput[offset + 1];
73 for (i = last_i + 1; i < nOutputLength; i++)
74 pOutput[i] = pInput[nInputLength - 1];
80 float min = FLT_MAX, max = -FLT_MAX;
86 for (i = 0; i < nLength; i++)
95 const float factor = 100.0f / (max - min);
97 for (i = 0; i < nLength; i++)
98 pData[i] = (pData[i] - min) * factor;
106 const float first = pData[0];
108 for (
int i = 0; i < nLength; i++)
void NormalizeStartingPoint(float *pData, int nLength)
void NormalizeAmplitude(float *pData, int nLength)
void NormalizeLength(float *pInput, int nInputLength, float *pOutput, int nOutputLength)
GLubyte GLubyte GLubyte GLubyte w