diff --git a/lib_com/options.h b/lib_com/options.h index c7cd38dd8edaf847f3fa16e5528582c5f36fced6..f1f5baa53a6e7ab92a483c080a8b178880a176de 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -107,6 +107,7 @@ #define FIX_2330_CLANG_18_WARNINGS_REND /* FhG: Fix renderer warnings */ #define FIX_BASOP_2350_HARM_0B_BWE /* VA: basop issue 2350: harmonization of the 0b BWE */ #define FIX_2349_HARM_FIND_UV /* VA: basop issue 2349: harmonization of find_uv() function */ +#define FIX_2370_UNUSED_BUFFERS_CORE_ENC /* VA: basop issue 2370: remove temporary input buffers in core-encoder */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/ivas_core_enc_fx.c b/lib_enc/ivas_core_enc_fx.c index 3a19ad1713a4bae4999ca1a5b1b5d031bf580d80..402d4085b88418dc637e73c01c1e76d537b79890 100644 --- a/lib_enc/ivas_core_enc_fx.c +++ b/lib_enc/ivas_core_enc_fx.c @@ -628,8 +628,9 @@ ivas_error ivas_core_enc_fx( * Postprocessing, BWEs and Updates *---------------------------------------------------------------------*/ +#ifndef FIX_2370_UNUSED_BUFFERS_CORE_ENC Word16 tmp_input_fx[L_FRAME48k], tmp_old_input_fx[L_FRAME48k], q_inp[2]; - +#endif FOR( n = 0; n < n_CoreChannels; n++ ) { st = sts[n]; @@ -644,6 +645,7 @@ ivas_error ivas_core_enc_fx( move16(); } +#ifndef FIX_2370_UNUSED_BUFFERS_CORE_ENC Copy( st->input_fx - input_frame, tmp_old_input_fx, input_frame ); Copy( st->input_fx, tmp_input_fx, input_frame ); q_inp[0] = st->q_old_inp; @@ -654,6 +656,7 @@ ivas_error ivas_core_enc_fx( move16(); st->q_old_inp = -1; move16(); +#endif /*---------------------------------------------------------------------* * Postprocessing for ACELP/HQ core switching @@ -694,6 +697,21 @@ ivas_error ivas_core_enc_fx( * SWB(FB) BWE encoding *---------------------------------------------------------------------*/ +#ifdef FIX_2370_UNUSED_BUFFERS_CORE_ENC + Word16 q_inp_orig; + q_inp_orig = st->q_inp; + move16(); + test(); + IF( GE_32( input_Fs, 32000 ) && st->hBWE_TD != NULL ) + { + st->q_inp = -1; + st->q_old_inp = -1; + move16(); + move16(); + Scale_sig( st->input_fx - input_frame, shl( input_frame, 1 ), sub( st->q_inp, q_inp_orig ) ); + } +#endif + new_swb_speech_fx = new_swb_speech_buffer_fx + STEREO_DFT_OVL_MAX; new_swb_speech_fx_16 = new_swb_speech_buffer_fx_16 + STEREO_DFT_OVL_MAX; set16_fx( new_swb_speech_buffer_fx_16, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); @@ -788,6 +806,15 @@ ivas_error ivas_core_enc_fx( Scale_sig( old_syn_12k8_16k_fx[n], L_FRAME16k, sub( Q1, Q_new[n] ) ); // Q0 +#ifdef FIX_2370_UNUSED_BUFFERS_CORE_ENC + IF( GE_32( input_Fs, 32000 ) && st->hBWE_TD != NULL ) + { + Scale_sig( st->input_fx, input_frame, sub( q_inp_orig, st->q_inp ) ); + st->q_inp = q_inp_orig; + move16(); + } + +#endif /*---------------------------------------------------------------------* * SWB DTX/CNG encoding *---------------------------------------------------------------------*/ @@ -842,6 +869,7 @@ ivas_error ivas_core_enc_fx( } } +#ifndef FIX_2370_UNUSED_BUFFERS_CORE_ENC Copy( tmp_old_input_fx, st->input_fx - input_frame, input_frame ); Copy( tmp_input_fx, st->input_fx, input_frame ); st->q_old_inp = q_inp[0]; @@ -849,6 +877,7 @@ ivas_error ivas_core_enc_fx( st->q_inp = q_inp[1]; move16(); +#endif /*---------------------------------------------------------------------* * Common updates *---------------------------------------------------------------------*/