Change of strategy and and reuse Ittiam approache for the first computation of...
Change of strategy and and reuse Ittiam approache for the first computation of gains and Q_exc adjutement (for the second run, it not necessary as both excitation vectors have the same dynamic
constWord16ReUseGain,/* i : Reuse the gain in Ener_per_bd_yQ */
#ifdef FIX_2380_HARM_GSC_GAIN_COMP_FX
constWord16max_target_ener,/* i : max_target_ener of Ener_per_bd_iQ */
constWord16Flag_adj_q_exc,/* i : Flag allowing Q_exc adjustment */
#endif
Word16Qexc_diff,
Word16Q_exc)
@@ -92,6 +92,8 @@ void Comp_and_apply_gain_fx(
Word16L16,frac,exp1,tmp_exp;
#ifdef FIX_2380_HARM_GSC_GAIN_COMP_FX
Word16Q_adapt;
Word16Q_exc_diffQ[L_FRAME16k];
Word32exc_diffQ32[L_FRAME16k];
#endif
Word32L32;
@@ -102,16 +104,7 @@ void Comp_and_apply_gain_fx(
move16();
tmp_exp=add(14,sub(Q_exc,Qexc_diff));/* In case of reuse, it can be computed outside the loop*/
#ifdef FIX_2380_HARM_GSC_GAIN_COMP_FX
Q_adapt=0;
move16();
test();
test();
IF(GT_16(Q_exc,3)&&EQ_16(ReUseGain,0)&>_16(max_target_ener,12))/* When target energy is high, Q_exc shouldn't be high too, addresses cases when switching from CNG or from almos*/
{
Q_adapt=sub(3-1,Q_exc);/* add extra 1 bit headroom */