Loading lib_dec/er_dec_tcx_fx.c +55 −17 Original line number Diff line number Diff line Loading @@ -1056,7 +1056,11 @@ void con_tcx_ivas_fx( IF( ( EQ_16( st->nbLostCmpt, 1 ) ) || hTcxDec->tcxConceal_recalc_exc ) { /* apply pre-emphasis to the signal */ #ifndef HARMONIZE_2446_CON_TCX_FX mem = shl(synth[(-(((L_frame / 2) + hTcxDec->pit_max_TCX) + M + M) - 1)], st->Q_syn_factor); #else mem = shl_sat(synth[(-(((L_frame / 2) + hTcxDec->pit_max_TCX) + M + M) - 1)], st->Q_syn_factor); #endif // !HARMONIZE_2446_CON_TCX_FX move16(); #ifndef HARMONIZE_2446_CON_TCX_FX Q_exc = E_UTIL_f_preemph3_ivas_fx( &( synth[-( ( ( L_frame / 2 ) + hTcxDec->pit_max_TCX ) + 2 * M )] ), st->preemph_fac, add( add( shr( L_frame, 1 ), hTcxDec->pit_max_TCX ), shl( M, 1 ) ), &mem, 1 ); Loading Loading @@ -1119,12 +1123,21 @@ void con_tcx_ivas_fx( assert( ( 2 * L_subfr + Tc + 1 + M ) <= hTcxDec->old_synth_lenFB ); BASOP_SATURATE_WARNING_OFF_EVS /*saturation possible in case of spiky synthesis*/ #ifndef HARMONIZE_2446_CON_TCX_FX Residu3_fx( A_local, &(synth[-add(add(add(shl(L_subfr, 1), Tc), 1), M)]), /*Qx = Q0*/ &(exc[-add(add(add(shl(L_subfr, 1), Tc), 1), M)]), /*Qx+1 = Q1*/ add(add(add(shl(L_subfr, 1), Tc), 1), M), 1 ); #else Residu3_fx( A_local, &(synth[-add(add(add(shl_sat(L_subfr, 1), Tc), 1), M)]), /*Qx = Q0*/ &(exc[-add(add(add(shl_sat(L_subfr, 1), Tc), 1), M)]), /*Qx+1 = Q1*/ add(add(add(shl_sat(L_subfr, 1), Tc), 1), M), 1); #endif // !HARMONIZE_2446_CON_TCX_FX BASOP_SATURATE_WARNING_ON_EVS } ELSE Loading Loading @@ -1163,7 +1176,11 @@ void con_tcx_ivas_fx( } ELSE { #ifndef HARMONIZE_2446_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*/ #else Copy_Scale_sig(hTcxDec->old_excFB_fx, &(exc[-(L_subfr * 2)]), add(shl_sat(L_subfr, 1), offset), sub(Q_exc, st->Q_exc)); /*Q_exc*/ #endif // !HARMONIZE_2446_CON_TCX_FX } } Loading Loading @@ -1201,8 +1218,12 @@ void con_tcx_ivas_fx( tcxltp_pitch_tmp = L_add( L_deposit_h( hTcxLtpDec->tcxltp_pitch_int ), L_shl( L_deposit_l( div_s( hTcxLtpDec->tcxltp_pitch_fr, st->pit_res_max ) ), 1 ) ); /*15Q16*/ scale_tmp = mult_r( hTcxDec->L_frameTCX, getInvFrameLen( st->L_frame ) ); /*getInvFrameLen()->9Q6*/ tmp_shift = norm_s( scale_tmp ); #ifndef HARMONIZE_2446_CON_TCX_FX predPitchLag = L_shl(Mpy_32_16_1(tcxltp_pitch_tmp, shl(scale_tmp, tmp_shift)), sub(9, tmp_shift)); /*Q16*/ #else predPitchLag = L_shl(Mpy_32_16_1(tcxltp_pitch_tmp, shl_sat(scale_tmp, tmp_shift)), sub(9, tmp_shift)); /*Q16*/ #endif // !HARMONIZE_2446_CON_TCX_FX T0 = round_fx( predPitchLag ); /*Q0*/ Loading Loading @@ -1434,11 +1455,19 @@ void con_tcx_ivas_fx( /*step = (1.0f/(L_frame+(L_frame/2))) * (gain - alpha);*/ tmp16 = shr( imult1616( 3, L_frame ), 1 ); tmp_e = norm_s( tmp16 ); #ifndef HARMONIZE_2446_CON_TCX_FX tmp16 = shl(tmp16, tmp_e); #else tmp16 = shl_sat(tmp16, tmp_e); #endif // !HARMONIZE_2446_CON_TCX_FX tmp16 = div_s( 16384 /*1.f Q14*/, tmp16 ); /*Q15,1+tmp_e-15*/ tmp16_2 = sub( shr( gain, 1 ), alpha ) /*Q14*/; #ifndef HARMONIZE_2446_CON_TCX_FX step32 = L_shl(L_mult(tmp16, tmp16_2) /*Q30, 1+tmp_e-15*/, add(1 - 14, tmp_e)) /*Q31*/; #else step32 = L_shl_sat(L_mult(tmp16, tmp16_2) /*Q30, 1+tmp_e-15*/, add(1 - 14, tmp_e)) /*Q31*/; #endif // HARMONIZE_2446_CON_TCX_FX /* PLC: Apply fade out */ tmp_loop = shr( imult1616( L_frame, 3 ), 1 ); FOR( i = offset; i < tmp_loop; i++ ) Loading Loading @@ -1549,8 +1578,12 @@ void con_tcx_ivas_fx( } st->seed_acelp = tmpSeed; move16(); #ifndef HARMONIZE_2446_CON_TCX_FX tmp_loop = add(add(L_frame, shr(L_frame, 1)), shl((L_FIR_FER2, 1)); #else tmp_loop = add(add(L_frame, shr(L_frame, 1)), shl_sat(L_FIR_FER2, 1)); #endif // !HARMONIZE_2446_CON_TCX_FX FOR( ; i < tmp_loop; i++ ) { Random( &tmpSeed ); Loading Loading @@ -1824,7 +1857,12 @@ void con_tcx_ivas_fx( ELSE { bufferCopyFx( noise + L_FIR_FER2 / 2, exc, add( L_frame, shr( L_frame, 1 ) ), 0 /*Q_noise*/, noise_e, Q_exc, 0 /*exc_e*/ ); #ifndef HARMONIZE_2446_CON_TCX_FX Copy(exc + sub(L_frame, shl(L_subfr, 1)), hTcxDec->old_excFB_fx, add(shl(L_subfr, 1), shr(L_frame, 1))); /*Q_exc*/ #else Copy(exc + sub(L_frame, shl_sat(L_subfr, 1)), hTcxDec->old_excFB_fx, add(shl_sat(L_subfr, 1), shr(L_frame, 1))); /*Q_exc*/ #endif // !HARMONIZE_2446_CON_TCX_FX /* copy old_exc as 16kHz for acelp decoding */ IF( EQ_16( st->nbLostCmpt, 1 ) ) { Loading Loading @@ -1890,7 +1928,7 @@ void con_tcx_ivas_fx( { Q_syn = add( scf, st->Q_syn_factor ); // so that (Q_syn - st->Q_syn_factor) = scf; } tmp_deemph = shl_sat( tmp_deemph, sub( Q_syn, st->Q_syn_factor ) ); tmp_deemph = shl( tmp_deemph, sub( Q_syn, st->Q_syn_factor ) ); st->Q_syn = Q_syn; move16(); Loading @@ -1916,7 +1954,7 @@ void con_tcx_ivas_fx( { 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 ) ); tmp_deemph = shl_sat(tmp_deemph, sub(Q_syn, st->Q_syn_factor)); } ELSE { Loading Loading
lib_dec/er_dec_tcx_fx.c +55 −17 Original line number Diff line number Diff line Loading @@ -1056,7 +1056,11 @@ void con_tcx_ivas_fx( IF( ( EQ_16( st->nbLostCmpt, 1 ) ) || hTcxDec->tcxConceal_recalc_exc ) { /* apply pre-emphasis to the signal */ #ifndef HARMONIZE_2446_CON_TCX_FX mem = shl(synth[(-(((L_frame / 2) + hTcxDec->pit_max_TCX) + M + M) - 1)], st->Q_syn_factor); #else mem = shl_sat(synth[(-(((L_frame / 2) + hTcxDec->pit_max_TCX) + M + M) - 1)], st->Q_syn_factor); #endif // !HARMONIZE_2446_CON_TCX_FX move16(); #ifndef HARMONIZE_2446_CON_TCX_FX Q_exc = E_UTIL_f_preemph3_ivas_fx( &( synth[-( ( ( L_frame / 2 ) + hTcxDec->pit_max_TCX ) + 2 * M )] ), st->preemph_fac, add( add( shr( L_frame, 1 ), hTcxDec->pit_max_TCX ), shl( M, 1 ) ), &mem, 1 ); Loading Loading @@ -1119,12 +1123,21 @@ void con_tcx_ivas_fx( assert( ( 2 * L_subfr + Tc + 1 + M ) <= hTcxDec->old_synth_lenFB ); BASOP_SATURATE_WARNING_OFF_EVS /*saturation possible in case of spiky synthesis*/ #ifndef HARMONIZE_2446_CON_TCX_FX Residu3_fx( A_local, &(synth[-add(add(add(shl(L_subfr, 1), Tc), 1), M)]), /*Qx = Q0*/ &(exc[-add(add(add(shl(L_subfr, 1), Tc), 1), M)]), /*Qx+1 = Q1*/ add(add(add(shl(L_subfr, 1), Tc), 1), M), 1 ); #else Residu3_fx( A_local, &(synth[-add(add(add(shl_sat(L_subfr, 1), Tc), 1), M)]), /*Qx = Q0*/ &(exc[-add(add(add(shl_sat(L_subfr, 1), Tc), 1), M)]), /*Qx+1 = Q1*/ add(add(add(shl_sat(L_subfr, 1), Tc), 1), M), 1); #endif // !HARMONIZE_2446_CON_TCX_FX BASOP_SATURATE_WARNING_ON_EVS } ELSE Loading Loading @@ -1163,7 +1176,11 @@ void con_tcx_ivas_fx( } ELSE { #ifndef HARMONIZE_2446_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*/ #else Copy_Scale_sig(hTcxDec->old_excFB_fx, &(exc[-(L_subfr * 2)]), add(shl_sat(L_subfr, 1), offset), sub(Q_exc, st->Q_exc)); /*Q_exc*/ #endif // !HARMONIZE_2446_CON_TCX_FX } } Loading Loading @@ -1201,8 +1218,12 @@ void con_tcx_ivas_fx( tcxltp_pitch_tmp = L_add( L_deposit_h( hTcxLtpDec->tcxltp_pitch_int ), L_shl( L_deposit_l( div_s( hTcxLtpDec->tcxltp_pitch_fr, st->pit_res_max ) ), 1 ) ); /*15Q16*/ scale_tmp = mult_r( hTcxDec->L_frameTCX, getInvFrameLen( st->L_frame ) ); /*getInvFrameLen()->9Q6*/ tmp_shift = norm_s( scale_tmp ); #ifndef HARMONIZE_2446_CON_TCX_FX predPitchLag = L_shl(Mpy_32_16_1(tcxltp_pitch_tmp, shl(scale_tmp, tmp_shift)), sub(9, tmp_shift)); /*Q16*/ #else predPitchLag = L_shl(Mpy_32_16_1(tcxltp_pitch_tmp, shl_sat(scale_tmp, tmp_shift)), sub(9, tmp_shift)); /*Q16*/ #endif // !HARMONIZE_2446_CON_TCX_FX T0 = round_fx( predPitchLag ); /*Q0*/ Loading Loading @@ -1434,11 +1455,19 @@ void con_tcx_ivas_fx( /*step = (1.0f/(L_frame+(L_frame/2))) * (gain - alpha);*/ tmp16 = shr( imult1616( 3, L_frame ), 1 ); tmp_e = norm_s( tmp16 ); #ifndef HARMONIZE_2446_CON_TCX_FX tmp16 = shl(tmp16, tmp_e); #else tmp16 = shl_sat(tmp16, tmp_e); #endif // !HARMONIZE_2446_CON_TCX_FX tmp16 = div_s( 16384 /*1.f Q14*/, tmp16 ); /*Q15,1+tmp_e-15*/ tmp16_2 = sub( shr( gain, 1 ), alpha ) /*Q14*/; #ifndef HARMONIZE_2446_CON_TCX_FX step32 = L_shl(L_mult(tmp16, tmp16_2) /*Q30, 1+tmp_e-15*/, add(1 - 14, tmp_e)) /*Q31*/; #else step32 = L_shl_sat(L_mult(tmp16, tmp16_2) /*Q30, 1+tmp_e-15*/, add(1 - 14, tmp_e)) /*Q31*/; #endif // HARMONIZE_2446_CON_TCX_FX /* PLC: Apply fade out */ tmp_loop = shr( imult1616( L_frame, 3 ), 1 ); FOR( i = offset; i < tmp_loop; i++ ) Loading Loading @@ -1549,8 +1578,12 @@ void con_tcx_ivas_fx( } st->seed_acelp = tmpSeed; move16(); #ifndef HARMONIZE_2446_CON_TCX_FX tmp_loop = add(add(L_frame, shr(L_frame, 1)), shl((L_FIR_FER2, 1)); #else tmp_loop = add(add(L_frame, shr(L_frame, 1)), shl_sat(L_FIR_FER2, 1)); #endif // !HARMONIZE_2446_CON_TCX_FX FOR( ; i < tmp_loop; i++ ) { Random( &tmpSeed ); Loading Loading @@ -1824,7 +1857,12 @@ void con_tcx_ivas_fx( ELSE { bufferCopyFx( noise + L_FIR_FER2 / 2, exc, add( L_frame, shr( L_frame, 1 ) ), 0 /*Q_noise*/, noise_e, Q_exc, 0 /*exc_e*/ ); #ifndef HARMONIZE_2446_CON_TCX_FX Copy(exc + sub(L_frame, shl(L_subfr, 1)), hTcxDec->old_excFB_fx, add(shl(L_subfr, 1), shr(L_frame, 1))); /*Q_exc*/ #else Copy(exc + sub(L_frame, shl_sat(L_subfr, 1)), hTcxDec->old_excFB_fx, add(shl_sat(L_subfr, 1), shr(L_frame, 1))); /*Q_exc*/ #endif // !HARMONIZE_2446_CON_TCX_FX /* copy old_exc as 16kHz for acelp decoding */ IF( EQ_16( st->nbLostCmpt, 1 ) ) { Loading Loading @@ -1890,7 +1928,7 @@ void con_tcx_ivas_fx( { Q_syn = add( scf, st->Q_syn_factor ); // so that (Q_syn - st->Q_syn_factor) = scf; } tmp_deemph = shl_sat( tmp_deemph, sub( Q_syn, st->Q_syn_factor ) ); tmp_deemph = shl( tmp_deemph, sub( Q_syn, st->Q_syn_factor ) ); st->Q_syn = Q_syn; move16(); Loading @@ -1916,7 +1954,7 @@ void con_tcx_ivas_fx( { 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 ) ); tmp_deemph = shl_sat(tmp_deemph, sub(Q_syn, st->Q_syn_factor)); } ELSE { Loading