diff --git a/lib_com/options.h b/lib_com/options.h index 677bbe61368dbef7f53d024e080b7fff10758a60..f4c2ab85affb0963097a3471484faeb5583423d9 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -131,6 +131,8 @@ #define FIX_746 // proposed fix to solve low bit-rate frame boundaries issues #define FIX_SATURATION_725 // Propose fix for saturation in AVQ #define FIX_737_HQ_ACELP_SWITCH_SCALING_ERROR /* Eri: Proposed fix for issue 737: scaling error in excitation memory after HQ->ACELP switch */ + +#define FIX_734_MISSING_SUBFR_LOW_RATE_ACELP /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_td_low_rate_dec.c b/lib_dec/ivas_td_low_rate_dec.c index 4b8ed6467a62947a2c3c38eefa15b9efdc46487b..2282cc30fe4f67c307e53a4d36c919b91c64834b 100644 --- a/lib_dec/ivas_td_low_rate_dec.c +++ b/lib_dec/ivas_td_low_rate_dec.c @@ -610,6 +610,12 @@ void decod_gen_2sbfr_ivas_fx( /*----------------------------------------------------------------------* * Find the total excitation *----------------------------------------------------------------------*/ +#ifdef FIX_734_MISSING_SUBFR_LOW_RATE_ACELP /* Don't need the if/else as here L_frame==L_FRAME all the time */ + + Rescale_exc( st->hMusicPF->dct_post_old_exc_fx, &exc[i_subfr], ( bwe_exc != NULL ) ? &bwe_exc[i_subfr * HIBND_ACB_L_FAC] : NULL, st->hGSCDec->last_exc_dct_in_fx, + 2 * L_SUBFR, 2 * L_SUBFR * HIBND_ACB_L_FAC, gain_code, &( st->Q_exc ), st->Q_subfr, exc2, i_subfr, st->coder_type ); + +#else IF(EQ_16(st->L_frame, L_FRAME)) { @@ -621,26 +627,34 @@ void decod_gen_2sbfr_ivas_fx( Rescale_exc(st->hMusicPF->dct_post_old_exc_fx, &exc[i_subfr], (bwe_exc != NULL) ? &bwe_exc[i_subfr * 2] : NULL, st->hGSCDec->last_exc_dct_in_fx, L_SUBFR, L_SUBFR * 2, gain_code, &(st->Q_exc), st->Q_subfr, exc2, i_subfr, st->coder_type); } - +#endif Word16 gain_code16 = round_fx(L_shl(gain_code, st->Q_exc)); /*Q_exc*/ - +#ifdef FIX_734_MISSING_SUBFR_LOW_RATE_ACELP + Acelp_dec_total_exc( exc, exc2, gain_code16, gain_pit, i_subfr, code, 2 * L_SUBFR ); +#else Acelp_dec_total_exc(exc, exc2, gain_code16, gain_pit, i_subfr, code, L_SUBFR); - +#endif /*-----------------------------------------------------------------* * Prepare TBE excitation *-----------------------------------------------------------------*/ - +#ifdef FIX_734_MISSING_SUBFR_LOW_RATE_ACELP + prep_tbe_exc_ivas_fx( L_frame, 2 * L_SUBFR, i_subfr, gain_pit, gain_code, code, voice_fac, &voice_factors[i_subfr / L_SUBFR], bwe_exc, 0, NULL, st->Q_exc, T0, T0_frac, GENERIC, st->core_brate, st->element_mode, st->idchan, st->hBWE_TD != NULL, st->tdm_LRTD_flag ); +#else // prep_tbe_exc(L_frame, L_SUBFR, i_subfr, gain_pit, gain_code, code, voice_fac, &voice_factors[i_subfr / L_SUBFR], bwe_exc, 0, NULL, T0, GENERIC, st->core_brate, st->element_mode, st->idchan, st->hBWE_TD != NULL, st->tdm_LRTD_flag); // prep_tbe_exc_fx(L_frame, /*L_SUBFR,*/ i_subfr, gain_pit, gain_code, code, voice_fac, &voice_factors[i_subfr / L_SUBFR], bwe_exc, 0, NULL, Q_exc, T0, T0_frac, GENERIC, st->core_brate/*, st->element_mode, st->idchan, st->hBWE_TD != NULL, st->tdm_LRTD_flag*/); prep_tbe_exc_ivas_fx( L_frame, L_SUBFR, i_subfr, gain_pit, gain_code, code, voice_fac, &voice_factors[i_subfr / L_SUBFR], bwe_exc, 0, NULL, st->Q_exc, T0, T0_frac, GENERIC, st->core_brate, st->element_mode, st->idchan, st->hBWE_TD != NULL, st->tdm_LRTD_flag ); - +#endif voice_factors[i_subfr / L_SUBFR + 1] = voice_factors[i_subfr / L_SUBFR]; /*----------------------------------------------------------------* * Excitation enhancements (update of total excitation signal) * called twice because adapting it to double the subfr length would need lot of modifications *----------------------------------------------------------------*/ +#if 1//def FIX_734_MISSING_SUBFR_LOW_RATE_ACELP + enhancer_fx( st->core_brate, 0, GENERIC, i_subfr, L_frame, voice_fac, st->stab_fac_fx, norm_gain_code, gain_inov, &st->gc_threshold_fx, code, exc2 , gain_pit, &st->dm_fx, st->Q_exc ); + enhancer_fx( st->core_brate, 0, GENERIC, i_subfr, L_frame, voice_fac, st->stab_fac_fx, norm_gain_code, gain_inov, &st->gc_threshold_fx, code + L_SUBFR, exc2 + L_SUBFR, gain_pit, &st->dm_fx, st->Q_exc ); +#else // enhancer(MODE1, st->core_brate, -1, 0, GENERIC, L_frame, voice_fac, st->stab_fac, norm_gain_code, gain_inov, &st->gc_threshold, code, exc2 + i_subfr, gain_pit, st->dispMem); // enhancer_fx(MODE1, st->core_brate, -1, 0, GENERIC, L_frame, voice_fac, st->stab_fac, norm_gain_code, gain_inov, &st->gc_threshold, code, exc2 + i_subfr, gain_pit, st->dispMem); enhancer_fx( st->core_brate, 0, GENERIC, i_subfr, L_frame, voice_fac, st->stab_fac_fx, norm_gain_code, gain_inov, &st->gc_threshold_fx, code, exc2, gain_pit, &st->dm_fx, st->Q_exc); @@ -648,7 +662,7 @@ void decod_gen_2sbfr_ivas_fx( // enhancer(MODE1, st->core_brate, -1, 0, GENERIC, L_frame, voice_fac, st->stab_fac, norm_gain_code, gain_inov, &st->gc_threshold, code + L_SUBFR, exc2 + i_subfr + L_SUBFR, gain_pit, st->dispMem); // enhancer_fx(MODE1, st->core_brate, -1, 0, GENERIC, L_frame, voice_fac, st->stab_fac, norm_gain_code, gain_inov, &st->gc_threshold, code + L_SUBFR, exc2 + i_subfr + L_SUBFR, gain_pit, st->dispMem); enhancer_fx( st->core_brate, 0, GENERIC, i_subfr, L_frame, voice_fac, st->stab_fac_fx, norm_gain_code, gain_inov, &st->gc_threshold_fx, code + L_SUBFR, exc2 + L_SUBFR, gain_pit, &st->dm_fx, st->Q_exc); - +#endif p_Aq += 2 * ( M + 1 ); pt_pitch++;