9.3. COMPILER OPTIONS 133
(float)coefficients[i];
}
return newFIR;
}
void computeFIR(FIRFilter* fir, float* input) {
int i, j;
float temp;
for(i=0; i<fir->numCoefficients; i++) {
fir->window[i] = fir->window[fir->frameSize + i];
}
for(i=0; i<fir->frameSize; i++) {
temp = 0;
fir->window[fir->numCoefficients + i] = input[i];
for(j=0; j<fir->numCoefficients; j++) {
temp += fir->window[i + j + 1] * fir->coefficients[j];
}
fir->result[i] = temp;
}
}
Note that during the initialization, the array describing the coefficients which will be applied
during the linear convolution are being flipped into reverse order so that access to the window
and coefficients arrays are made using increasing address indices. e data type conversion from
short to floating-point is done elsewhere.
9.3 COMPILER OPTIONS
e simplest but an effective optimization step involves specifying the optimization options
provided by the compiler. e Android NDK toolchain and Xcode IDE are based on the GCC
compiler. us, the optimization options provided by GCC can be used when generating native
libraries for Android and iOS apps. A complete list of the optimization options can be found
on the GNU GCC documentation website:
http://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Optimize-Options.html
e compiler allows applying different optimization levels. ese levels refer to different
optimization flags that the builder enables, and are explained in detail at the above link. e
optimization levels considered here are O{0-3}, Os, and Ofast. e builder asserts many
compilation options by default; among these is the Os flag which denotes optimization for
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.159.150