Loading lib_dec/er_dec_tcx_fx.c +20 −8 Original line number Diff line number Diff line Loading @@ -191,7 +191,7 @@ void con_tcx_fx( { /* apply pre-emphasis to the signal */ #ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE mem = shl_sat( synth[( -( ( ( shr( L_frame, 2 ) + hTcxDec->pit_max_TCX ) + M + M ) ) - 1 )], st->Q_syn_factor ); /*Q0*/ mem = shl( synth[( -( ( ( shr( L_frame, 2 ) + hTcxDec->pit_max_TCX ) + M + M ) ) - 1 )], st->Q_syn_factor ); /*Q0*/ #else mem = synth[( -( ( ( ( L_frame / 2 ) + hTcxDec->pit_max_TCX ) + M + M ) ) - 1 )]; /*Q0*/ #endif Loading Loading @@ -239,7 +239,7 @@ void con_tcx_fx( { /* apply pre-emphasis to the signal */ #ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE mem = shl_sat( synth[( -L_frame - 1 )], st->Q_syn_factor ); /*Q0*/ mem = shl( synth[( -L_frame - 1 )], st->Q_syn_factor ); /*Q0*/ #else mem = synth[( -L_frame - 1 )]; /*Q0*/ #endif Loading @@ -261,10 +261,7 @@ void con_tcx_fx( Copy_Scale_sig( hTcxDec->old_excFB_fx, &( exc[-( L_subfr * 2 )] ), add( shl( L_subfr, 1 ), offset ), sub( Q_exc, st->Q_exc ) ); /*Q_exc*/ } } #ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE st->Q_syn_factor = 0; move16(); #endif /*-----------------------------------------------------------------* * PLC: Construct the harmonic part of excitation *-----------------------------------------------------------------*/ Loading Loading @@ -783,9 +780,15 @@ void con_tcx_fx( syn = buf + M; /*Q_syn*/ Copy( synth - M, buf, M ); /*Q_syn*/ #ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE Word16 scf = norm_s( tmp_deemph ); new_Q = sub( Q_exc, 4 ); new_Q = s_max( new_Q, -1 ); new_Q = s_min( new_Q, scf ); #else new_Q = sub( Q_exc, 3 ); new_Q = s_max( new_Q, -1 ); #endif tmp16 = s_min( new_Q, st->prev_Q_syn ); st->prev_Q_syn = new_Q; Loading @@ -796,8 +799,17 @@ void con_tcx_fx( move16(); Copy_Scale_sig( buf, mem_syn, M, exp_scale ); /*Q: tmp16*/ #ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE if ( GT_16( sub( Q_syn, st->Q_syn_factor ), scf ) ) { Q_syn = add( scf, st->Q_syn_factor ); // so that (Q_syn - st->Q_syn_factor) = scf; } tmp_deemph = shl( tmp_deemph, sub( Q_syn, st->Q_syn_factor ) ); st->Q_syn_factor = 0; move16(); #else tmp_deemph = shl_sat( tmp_deemph, Q_syn ); /*Q_syn*/ #endif st->Q_syn = Q_syn; move16(); Loading Loading
lib_dec/er_dec_tcx_fx.c +20 −8 Original line number Diff line number Diff line Loading @@ -191,7 +191,7 @@ void con_tcx_fx( { /* apply pre-emphasis to the signal */ #ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE mem = shl_sat( synth[( -( ( ( shr( L_frame, 2 ) + hTcxDec->pit_max_TCX ) + M + M ) ) - 1 )], st->Q_syn_factor ); /*Q0*/ mem = shl( synth[( -( ( ( shr( L_frame, 2 ) + hTcxDec->pit_max_TCX ) + M + M ) ) - 1 )], st->Q_syn_factor ); /*Q0*/ #else mem = synth[( -( ( ( ( L_frame / 2 ) + hTcxDec->pit_max_TCX ) + M + M ) ) - 1 )]; /*Q0*/ #endif Loading Loading @@ -239,7 +239,7 @@ void con_tcx_fx( { /* apply pre-emphasis to the signal */ #ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE mem = shl_sat( synth[( -L_frame - 1 )], st->Q_syn_factor ); /*Q0*/ mem = shl( synth[( -L_frame - 1 )], st->Q_syn_factor ); /*Q0*/ #else mem = synth[( -L_frame - 1 )]; /*Q0*/ #endif Loading @@ -261,10 +261,7 @@ void con_tcx_fx( Copy_Scale_sig( hTcxDec->old_excFB_fx, &( exc[-( L_subfr * 2 )] ), add( shl( L_subfr, 1 ), offset ), sub( Q_exc, st->Q_exc ) ); /*Q_exc*/ } } #ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE st->Q_syn_factor = 0; move16(); #endif /*-----------------------------------------------------------------* * PLC: Construct the harmonic part of excitation *-----------------------------------------------------------------*/ Loading Loading @@ -783,9 +780,15 @@ void con_tcx_fx( syn = buf + M; /*Q_syn*/ Copy( synth - M, buf, M ); /*Q_syn*/ #ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE Word16 scf = norm_s( tmp_deemph ); new_Q = sub( Q_exc, 4 ); new_Q = s_max( new_Q, -1 ); new_Q = s_min( new_Q, scf ); #else new_Q = sub( Q_exc, 3 ); new_Q = s_max( new_Q, -1 ); #endif tmp16 = s_min( new_Q, st->prev_Q_syn ); st->prev_Q_syn = new_Q; Loading @@ -796,8 +799,17 @@ void con_tcx_fx( move16(); Copy_Scale_sig( buf, mem_syn, M, exp_scale ); /*Q: tmp16*/ #ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE if ( GT_16( sub( Q_syn, st->Q_syn_factor ), scf ) ) { Q_syn = add( scf, st->Q_syn_factor ); // so that (Q_syn - st->Q_syn_factor) = scf; } tmp_deemph = shl( tmp_deemph, sub( Q_syn, st->Q_syn_factor ) ); st->Q_syn_factor = 0; move16(); #else tmp_deemph = shl_sat( tmp_deemph, Q_syn ); /*Q_syn*/ #endif st->Q_syn = Q_syn; move16(); Loading