Multiple divide3232 by constant in ivas_spar_com_fx.c
There are in sum 6 occurences of this code line in this module: response_avg_fx[ch] = divide3232( response_avg_fx[ch], EPSILON_FX_THR ); // q15 Additionally, there are several IF/ELIF/ELSE constructs in order to bring the mantissa into a certain range and to save division calls. Proposal:
- convert all "division by const" into "multiplication with const"
- Option to create linear code:
- Use L_max(mant, EPSILON) to set mantissa to minimum
- Use L_min(mant, ???) to set mantissa to maximum
- Ensure correct q_norm setting in cases, where "norm_fx = EPSILON_FX;" is applied.