Loading lib_dec/hf_synth_fx.c +13 −6 Original line number Diff line number Diff line Loading @@ -176,9 +176,10 @@ static void hf_synthesis_fx( L_tmp = Dot_product12( HF_exc, HF_exc, L_SUBFR16k, &exp1 ); tmp = round_fx( L_tmp ); /* Q15 */ #ifdef FIX_BASOP_2350_HARM_0B_BWE IF( element_mode == EVS_MONO ) { #endif /* tmp = (float)(sqrt(ener/tmp)) */ /* scale is -1 if tmp > ener */ scale = shr( sub( ener, tmp ), 15 ); /* Q0 */ Loading @@ -193,10 +194,10 @@ static void hf_synthesis_fx( L_tmp = Isqrt_lc( L_tmp, &exp1 ); scale = round_fx( L_tmp ); /* Q18 when Q_exc=-1, HF_exc in Q-3 */ exp2 = sub( hBWE_zero->memExp1, exp1 ); /* moved after the else */ /* exp2 = sub( hBWE_zero->memExp1, exp1 ); hBWE_zero->memExp1 = exp1; move16(); move16(); */ /*-----------------------------------------------------------------* * calculate energy scaling factor to respect tilt of synth12k8 * (tilt: 1=voiced, -1=unvoiced) Loading Loading @@ -247,6 +248,7 @@ static void hf_synthesis_fx( /*scale *= fac;*/ tmp = mult_r( scale, tmp ); #ifdef FIX_BASOP_2350_HARM_0B_BWE } ELSE { Loading Loading @@ -321,12 +323,17 @@ static void hf_synthesis_fx( /*scale *= fac;*/ tmp = mult_r( scale, tmp ); /* Q = (15 - exp1) + Q_tmp - 15 */ Q_tmp = sub( Q_tmp, exp1 ); } } #endif /*-----------------------------------------------------------------* * modify HF excitation according to both calculated scaling factors * high pass filtering (0.94ms of delay) *-----------------------------------------------------------------*/ exp2 = sub( hBWE_zero->memExp1, exp1 ); hBWE_zero->memExp1 = exp1; move16(); filt_6k_7k_scale_fx( HF_exc, L_SUBFR16k, hBWE_zero->mem_hf_fx, tmp, exp2 ); /* i: input HF_exc is scaled in float, here scaling is done inside this filter */ Loading Loading
lib_dec/hf_synth_fx.c +13 −6 Original line number Diff line number Diff line Loading @@ -176,9 +176,10 @@ static void hf_synthesis_fx( L_tmp = Dot_product12( HF_exc, HF_exc, L_SUBFR16k, &exp1 ); tmp = round_fx( L_tmp ); /* Q15 */ #ifdef FIX_BASOP_2350_HARM_0B_BWE IF( element_mode == EVS_MONO ) { #endif /* tmp = (float)(sqrt(ener/tmp)) */ /* scale is -1 if tmp > ener */ scale = shr( sub( ener, tmp ), 15 ); /* Q0 */ Loading @@ -193,10 +194,10 @@ static void hf_synthesis_fx( L_tmp = Isqrt_lc( L_tmp, &exp1 ); scale = round_fx( L_tmp ); /* Q18 when Q_exc=-1, HF_exc in Q-3 */ exp2 = sub( hBWE_zero->memExp1, exp1 ); /* moved after the else */ /* exp2 = sub( hBWE_zero->memExp1, exp1 ); hBWE_zero->memExp1 = exp1; move16(); move16(); */ /*-----------------------------------------------------------------* * calculate energy scaling factor to respect tilt of synth12k8 * (tilt: 1=voiced, -1=unvoiced) Loading Loading @@ -247,6 +248,7 @@ static void hf_synthesis_fx( /*scale *= fac;*/ tmp = mult_r( scale, tmp ); #ifdef FIX_BASOP_2350_HARM_0B_BWE } ELSE { Loading Loading @@ -321,12 +323,17 @@ static void hf_synthesis_fx( /*scale *= fac;*/ tmp = mult_r( scale, tmp ); /* Q = (15 - exp1) + Q_tmp - 15 */ Q_tmp = sub( Q_tmp, exp1 ); } } #endif /*-----------------------------------------------------------------* * modify HF excitation according to both calculated scaling factors * high pass filtering (0.94ms of delay) *-----------------------------------------------------------------*/ exp2 = sub( hBWE_zero->memExp1, exp1 ); hBWE_zero->memExp1 = exp1; move16(); filt_6k_7k_scale_fx( HF_exc, L_SUBFR16k, hBWE_zero->mem_hf_fx, tmp, exp2 ); /* i: input HF_exc is scaled in float, here scaling is done inside this filter */ Loading