diff --git a/lib_com/options.h b/lib_com/options.h index 19707c016d094a7c22d90b2dd64ac87410be5be8..b584b6931635ad178abfed1de4261fbdae27545a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -117,6 +117,7 @@ #define FIX_2338_HARM_GSC_GAIN_COMP /* VA: basop issue 2338: harmonization of band gain computation for both EVS and IVAS */ #define FIX_BASOP_2317_UNINIT_VALUE_IN_STEREO_CNG /* Eri: Basop issue 2317: Uninitialized value read in case of DTX and BW switching */ #define FIX_1283_STEREO_DFT_COLLAPSE /* FhG: float issue 1283: fix for critical issue with DFT stereo core coder */ +#define FIX_2379_REMOVE_previoussynth_fx_32 /* VA: basop issue 2379: remove duplicated buffer st->previoussynth_fx_32[] */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index bbf4a85149c6745a123b235c4940c9edf75fc0d3..5dcc848ade5ef21ec0c3ac49eba9c3fb24e7add3 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -2112,7 +2112,11 @@ ivas_error acelp_core_dec_fx( } /* save synthesis - needed in case of core switching */ +#ifdef FIX_2379_REMOVE_previoussynth_fx_32 + Copy_Scale_sig_32_16( synth_fx, st->previoussynth_fx, output_frame, 0 ); // Q0 +#else Copy32( synth_fx, st->previoussynth_fx_32, output_frame ); // Q0 +#endif } ELSE { diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 3bfcb453ddf4780a3bfe1a9934d003b529ec6168..9d36d2c5e2f4d8f57f27efe347b5676afd9a2859 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -1598,7 +1598,13 @@ ivas_error core_switching_pre_dec_fx( } ELSE { +#ifdef FIX_2379_REMOVE_previoussynth_fx_32 + Word32 previoussynth_fx_32[L_FRAME48k]; + Copy_Scale_sig_16_32_no_sat( st->previoussynth_fx, previoussynth_fx_32, output_frame, 0 ); + fer_energy_fx( output_frame, UNVOICED_CLAS, previoussynth_fx_32, 0, -1, &st->enr_old_fx, 1 ); /*Q0*/ +#else fer_energy_fx( output_frame, UNVOICED_CLAS, st->previoussynth_fx_32, 0, -1, &st->enr_old_fx, 1 ); /*Q-0*/ +#endif st->lp_gainp_fx = 0; move16(); st->lp_gainc_fx = extract_h( Sqrt32( st->lp_ener_fx, &exp ) ); /*Q=15-exp*/ @@ -1681,7 +1687,13 @@ ivas_error core_switching_pre_dec_fx( set16_fx( st->dm_fx.prev_gain_pit, 0, 6 ); st->last_coder_type = GENERIC; move16(); - fer_energy_fx( output_frame, UNVOICED_CLAS, st->previoussynth_fx_32, 0, -1, &st->enr_old_fx, 1 ); /*Q-0*/ +#ifdef FIX_2379_REMOVE_previoussynth_fx_32 + Word32 previoussynth_fx_32[L_FRAME48k]; + Copy_Scale_sig_16_32_no_sat( st->previoussynth_fx, previoussynth_fx_32, output_frame, 0 ); + fer_energy_fx( output_frame, UNVOICED_CLAS, previoussynth_fx_32, 0, -1, &st->enr_old_fx, 1 ); /*Q0*/ +#else + fer_energy_fx( output_frame, UNVOICED_CLAS, st->previoussynth_fx_32, 0, -1, &st->enr_old_fx, 1 ); /*Q-0*/ +#endif st->lp_gainp_fx = 0; move16(); diff --git a/lib_dec/init_dec_fx.c b/lib_dec/init_dec_fx.c index e031fd6967fa66ef306b5461df725750f9fe0c1f..a3e2c48e3092886d8f82f7425aa8db9ab0004d3a 100644 --- a/lib_dec/init_dec_fx.c +++ b/lib_dec/init_dec_fx.c @@ -436,7 +436,9 @@ ivas_error init_decoder_fx( set16_fx( st_fx->previoussynth_fx, 0, L_FRAME48k ); set32_fx( st_fx->delay_buf_out32_fx, 0, HQ_DELTA_MAX * HQ_DELAY_COMP ); +#ifndef FIX_2379_REMOVE_previoussynth_fx_32 set32_fx( st_fx->previoussynth_fx_32, 0, L_FRAME48k ); +#endif IF( st_fx->element_mode == EVS_MONO ) { diff --git a/lib_dec/ivas_core_dec_fx.c b/lib_dec/ivas_core_dec_fx.c index 9838195ccaecf9eb9fed068d5a9c6eaa296dd75c..a412ff27d789fbdf3e0967d8916e51e8769e424c 100644 --- a/lib_dec/ivas_core_dec_fx.c +++ b/lib_dec/ivas_core_dec_fx.c @@ -446,8 +446,9 @@ ivas_error ivas_core_dec_fx( move16(); move16(); +#ifndef FIX_2379_REMOVE_previoussynth_fx_32 Copy_Scale_sig_16_32_DEPREC( st->previoussynth_fx, st->previoussynth_fx_32, L_FRAME48k, 0 ); // Q0 - +#endif IF( NE_32( ( error = core_switching_pre_dec_fx( st, output_frame, sts[0]->last_core_brate, nchan_out, last_element_mode, last_element_brate, st->Q_syn, &Q_olapBufferSynth, &Q_olapBufferSynth2 ) ), IVAS_ERR_OK ) ) { return error; @@ -557,8 +558,9 @@ ivas_error ivas_core_dec_fx( } } +#ifndef FIX_2379_REMOVE_previoussynth_fx_32 Copy_Scale_sig_32_16( st->previoussynth_fx_32, st->previoussynth_fx, L_FRAME48k, 0 ); // Q0 - +#endif test(); test(); IF( ( EQ_16( st->core, TCX_20_CORE ) || EQ_16( st->core, TCX_10_CORE ) ) && NE_16( st->element_mode, IVAS_CPE_MDCT ) ) diff --git a/lib_dec/stat_dec.h b/lib_dec/stat_dec.h index 429070d857cc7466dd50c49caa36e1435ec5945c..a1646e82ebb470b219fcbd964e451b1e5d3f69f2 100644 --- a/lib_dec/stat_dec.h +++ b/lib_dec/stat_dec.h @@ -1258,7 +1258,9 @@ typedef struct Decoder_State Word16 last_L_frame_ori; Word16 previoussynth_fx[L_FRAME48k]; +#ifndef FIX_2379_REMOVE_previoussynth_fx_32 Word32 previoussynth_fx_32[L_FRAME48k]; +#endif Word16 old_synth_sw_fx[NS2SA( 48000, FRAME_SIZE_NS - ACELP_LOOK_NS - DELAY_BWE_TOTAL_NS )]; Word16 delay_buf_out_fx[HQ_DELTA_MAX * HQ_DELAY_COMP]; /*Q0*/ Word32 delay_buf_out32_fx[HQ_DELTA_MAX * HQ_DELAY_COMP]; /*Q11*/