Loading lib_enc/acelp_core_switch_enc_fx.c +2 −2 Original line number Diff line number Diff line Loading @@ -632,7 +632,7 @@ static void encod_gen_voic_core_switch_ivas_fx( * Find adaptive exitation *-----------------------------------------------------------------*/ pred_lt4( &exc[0], &exc[0], T0, T0_frac, L_SUBFR + 1, pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); pred_lt4_ivas_fx( &exc[0], &exc[0], T0, T0_frac, L_SUBFR + 1, L_pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); /*-----------------------------------------------------------------* * Gain clipping test to avoid unstable synthesis on frame erasure Loading Loading @@ -708,7 +708,7 @@ static void encod_gen_voic_core_switch_ivas_fx( * long term prediction on the 2nd sub frame *-----------------------------------------------------------------*/ pred_lt4( &exc[L_SUBFR], &exc[L_SUBFR], T0, T0_frac, L_SUBFR + 1, pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); pred_lt4_ivas_fx( &exc[L_SUBFR], &exc[L_SUBFR], T0, T0_frac, L_SUBFR + 1, L_pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); FOR( i = L_SUBFR; i < 2 * L_SUBFR; i++ ) { Loading lib_enc/enc_gen_voic_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -578,7 +578,7 @@ void encod_gen_voic_ivas_fx( * Find adaptive exitation *-----------------------------------------------------------------*/ pred_lt4( &exc_fx[i_subfr_fx], &exc_fx[i_subfr_fx], T0_fx, T0_frac_fx, L_SUBFR + 1, pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); pred_lt4_ivas_fx( &exc_fx[i_subfr_fx], &exc_fx[i_subfr_fx], T0_fx, T0_frac_fx, L_SUBFR + 1, L_pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); /*-----------------------------------------------------------------* * Gain clipping test to avoid unstable synthesis on frame erasure Loading lib_enc/enc_pit_exc_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -744,7 +744,7 @@ void enc_pit_exc_ivas_fx( * Find adaptive exitation *-----------------------------------------------------------------*/ pred_lt4( &exc[i_subfr], &exc[i_subfr], *T0, *T0_frac, L_subfr + 1, pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); pred_lt4_ivas_fx( &exc[i_subfr], &exc[i_subfr], *T0, *T0_frac, L_subfr + 1, L_pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); /*-----------------------------------------------------------------* * Gain clipping test to avoid unstable synthesis on frame erasure * or in case of floating point encoder & fixed p. decoder Loading lib_enc/ivas_td_low_rate_enc_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -285,7 +285,7 @@ void encod_gen_2sbfr( * Find adaptive exitation *-----------------------------------------------------------------*/ pred_lt4( &exc[i_subfr], &exc[i_subfr], T0, T0_frac, 2 * L_SUBFR + 1, inter4_2_fx_Q15, L_INTERPOL2, PIT_UP_SAMP ); pred_lt4_ivas_fx( &exc[i_subfr], &exc[i_subfr], T0, T0_frac, 2 * L_SUBFR + 1, L_pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); /*-----------------------------------------------------------------* * Gain clipping test to avoid unstable synthesis on frame erasure Loading lib_enc/tcx_utils_enc_fx.c +19 −11 Original line number Diff line number Diff line Loading @@ -1392,25 +1392,33 @@ void tcx_scalar_quantization_ivas_fx( s = sub( add( x_e, gain_e ), 15 ); } /* substract 0x8000 to affect the mac_r in the following loop so it acts like extract_h. the 0x4000 will be multiplied by 2 by the mac_r to get to 0x8000 and disable the round. */ offset = sub( offset, 0x4000 ); FOR( ; i >= 0; i-- ) { offs32 = Mpy_32_16_1( L_abs( x[i] ), gain ); /* multiply */ offs32 = Mpy_32_16_1( x[i], gain ); /* multiply */ offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ tmp16 = mac_r_sat( offs32, offset, 1 ); /* add offset and truncate */ IF( x[i] < 0 ) IF( x[i] > 0 ) { tmp16 = negate( tmp16 ); /* restore sign */ offs32 = L_add_sat( offs32, L_shl( offset, 1 ) ); tmp16 = extract_h( offs32 ); IF( GT_32( L_deposit_h( tmp16 ), offs32 ) ) { tmp16 = sub( tmp16, 1 ); } } ELSE { offs32 = L_add_sat( offs32, L_shl( negate( offset ), 1 ) ); tmp16 = extract_h( offs32 ); IF( LT_32( L_deposit_h( tmp16 ), offs32 ) ) { tmp16 = add( tmp16, 1 ); } } xq[i] = tmp16; move16(); } IF( alfe_flag == 0 ) { AdaptLowFreqEmph_fx( x, x_e, xq, gain, gain_e, Loading Loading
lib_enc/acelp_core_switch_enc_fx.c +2 −2 Original line number Diff line number Diff line Loading @@ -632,7 +632,7 @@ static void encod_gen_voic_core_switch_ivas_fx( * Find adaptive exitation *-----------------------------------------------------------------*/ pred_lt4( &exc[0], &exc[0], T0, T0_frac, L_SUBFR + 1, pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); pred_lt4_ivas_fx( &exc[0], &exc[0], T0, T0_frac, L_SUBFR + 1, L_pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); /*-----------------------------------------------------------------* * Gain clipping test to avoid unstable synthesis on frame erasure Loading Loading @@ -708,7 +708,7 @@ static void encod_gen_voic_core_switch_ivas_fx( * long term prediction on the 2nd sub frame *-----------------------------------------------------------------*/ pred_lt4( &exc[L_SUBFR], &exc[L_SUBFR], T0, T0_frac, L_SUBFR + 1, pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); pred_lt4_ivas_fx( &exc[L_SUBFR], &exc[L_SUBFR], T0, T0_frac, L_SUBFR + 1, L_pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); FOR( i = L_SUBFR; i < 2 * L_SUBFR; i++ ) { Loading
lib_enc/enc_gen_voic_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -578,7 +578,7 @@ void encod_gen_voic_ivas_fx( * Find adaptive exitation *-----------------------------------------------------------------*/ pred_lt4( &exc_fx[i_subfr_fx], &exc_fx[i_subfr_fx], T0_fx, T0_frac_fx, L_SUBFR + 1, pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); pred_lt4_ivas_fx( &exc_fx[i_subfr_fx], &exc_fx[i_subfr_fx], T0_fx, T0_frac_fx, L_SUBFR + 1, L_pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); /*-----------------------------------------------------------------* * Gain clipping test to avoid unstable synthesis on frame erasure Loading
lib_enc/enc_pit_exc_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -744,7 +744,7 @@ void enc_pit_exc_ivas_fx( * Find adaptive exitation *-----------------------------------------------------------------*/ pred_lt4( &exc[i_subfr], &exc[i_subfr], *T0, *T0_frac, L_subfr + 1, pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); pred_lt4_ivas_fx( &exc[i_subfr], &exc[i_subfr], *T0, *T0_frac, L_subfr + 1, L_pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); /*-----------------------------------------------------------------* * Gain clipping test to avoid unstable synthesis on frame erasure * or in case of floating point encoder & fixed p. decoder Loading
lib_enc/ivas_td_low_rate_enc_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -285,7 +285,7 @@ void encod_gen_2sbfr( * Find adaptive exitation *-----------------------------------------------------------------*/ pred_lt4( &exc[i_subfr], &exc[i_subfr], T0, T0_frac, 2 * L_SUBFR + 1, inter4_2_fx_Q15, L_INTERPOL2, PIT_UP_SAMP ); pred_lt4_ivas_fx( &exc[i_subfr], &exc[i_subfr], T0, T0_frac, 2 * L_SUBFR + 1, L_pitch_inter4_2, L_INTERPOL2, PIT_UP_SAMP ); /*-----------------------------------------------------------------* * Gain clipping test to avoid unstable synthesis on frame erasure Loading
lib_enc/tcx_utils_enc_fx.c +19 −11 Original line number Diff line number Diff line Loading @@ -1392,25 +1392,33 @@ void tcx_scalar_quantization_ivas_fx( s = sub( add( x_e, gain_e ), 15 ); } /* substract 0x8000 to affect the mac_r in the following loop so it acts like extract_h. the 0x4000 will be multiplied by 2 by the mac_r to get to 0x8000 and disable the round. */ offset = sub( offset, 0x4000 ); FOR( ; i >= 0; i-- ) { offs32 = Mpy_32_16_1( L_abs( x[i] ), gain ); /* multiply */ offs32 = Mpy_32_16_1( x[i], gain ); /* multiply */ offs32 = L_shl_sat( offs32, s ); /* convert to 15Q16 */ tmp16 = mac_r_sat( offs32, offset, 1 ); /* add offset and truncate */ IF( x[i] < 0 ) IF( x[i] > 0 ) { tmp16 = negate( tmp16 ); /* restore sign */ offs32 = L_add_sat( offs32, L_shl( offset, 1 ) ); tmp16 = extract_h( offs32 ); IF( GT_32( L_deposit_h( tmp16 ), offs32 ) ) { tmp16 = sub( tmp16, 1 ); } } ELSE { offs32 = L_add_sat( offs32, L_shl( negate( offset ), 1 ) ); tmp16 = extract_h( offs32 ); IF( LT_32( L_deposit_h( tmp16 ), offs32 ) ) { tmp16 = add( tmp16, 1 ); } } xq[i] = tmp16; move16(); } IF( alfe_flag == 0 ) { AdaptLowFreqEmph_fx( x, x_e, xq, gain, gain_e, Loading