L_tmp=Mpy_32_32(output_t60_fx[idx],ln_1e6_inverted_fx);// L_tmp in Q26 // exp = pRt60_e[bin_idx] + 0
L_tmp=Mpy_32_32(output_t60_fx[idx],ln_1e6_inverted_fx);// L_tmp in Q26
exp_argument_fx=BASOP_Util_Divide3232_Scale_newton(delay_diff_fx,L_tmp,&tmp_exp);//exp_argument_L_fx in Q30 (not alwys, because tmp_exp values are not constant) //Scale() returns values in the highest possible precision
exp_argument_fx=L_shr_sat(exp_argument_fx,sub(6,tmp_exp));//exp_argument_L_fx in Q26
tmp=Mpy_32_32(96817114,exp_argument_fx);//Q21 -> multiplication of Q26 by Q26 // x * 1/ln(2) it is ensured that exp_argument_fx is always in Q26
L_tmp=BASOP_util_Pow2(tmp,10,&pow_exp);//Q28 -> not always, because pow_exp is not fixed
// tmp is a 32-bit signed integer in Q21, therefore expoenent to the power function is 10
//L_tmp = L_shl_sat( L_tmp, pow_exp );// Q28??
//L_tmp = L_shl( L_tmp, add( 1, pow_exp ) );
//L_tmp = L_shl( L_tmp, pow_exp );
L_tmp=Mpy_32_32(L_tmp,output_ene_fx[idx]);// Q27. Q28 multiplied by Q30 gives Q27 -> Finally, energy should be in Q31 ( this is mandatory for further computations)
L_tmp=L_shl_sat(L_tmp,add(1,pow_exp));//
L_tmp=Mpy_32_32(L_tmp,output_ene_fx[idx]);//Q27 if result of previous step is in Q28
L_tmp=L_shl_sat(L_tmp,add(1,pow_exp));//L_tmp in Q31
// Step 3 : multiply temp variable by gain, with appropriate scaling for Q31 and Q16 multiplication
tmp_ene=Mpy_32_32(tmp_ene,dmx_gain_2_fx);// Mpy_32_32_ss multiplies two 32 bit numberrs in 64-bit with saturation or L_mult -> outputs word16 // Qfactor of tmp_ene?? dmx_gain_2_fx is in Q16
// incomplete implentation
// Step 4 : multiply step 3 result with output energy
pOutput_ene[idx]=Mpy_32_32(pOutput_ene[idx],tmp_ene);//result seems to be correct, but in Q13. This should be scaled to Q31 for correct output.