Commit 0452ac80 authored by vaclav's avatar vaclav
Browse files

port MR

parent d1f8daad
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -207,6 +207,7 @@
#define FIX_1101_CLEANING_JBM_CALL                      /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */
#define NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND /* Eri: issue 1337: Missing directivity setting and distance attenuation in external renderer IVAS_rend */
#define FIX_1348_OVERFLOW                               /* FhG: fix BASOP overflow in hq_lr_dec(), brings floating-point code inline with FX */
#define FIX_1298_MEMORY_OPT_IVAS_CORE_ENC               /* VA: issue 1298: Memory saving in ivas_core_enc() */

/* #################### End BASOP porting switches ############################ */

+15 −1
Original line number Diff line number Diff line
@@ -90,8 +90,13 @@ ivas_error ivas_core_enc(
    float *inp[CPE_CHANNELS];
    float new_inp_resamp16k[CPE_CHANNELS][L_FRAME16k]; /* new input signal @16kHz, non pre-emphasised, used by the WB TBE/BWE */
    float old_syn_12k8_16k[CPE_CHANNELS][L_FRAME16k];  /* ACELP core synthesis at 12.8kHz or 16kHz to be used by the SWB BWE */
#ifdef FIX_1298_MEMORY_OPT_IVAS_CORE_ENC
    float *shb_speech;
    float *hb_speech;
#else
    float shb_speech[L_FRAME16k];
    float hb_speech[L_FRAME16k / 4];
#endif
    float *new_swb_speech;
    float new_swb_speech_buffer[L_FRAME48k + STEREO_DFT_OVL_MAX];
    float bwe_exc_extended[CPE_CHANNELS][L_FRAME32k + NL_BUFF_OFFSET];
@@ -158,8 +163,9 @@ ivas_error ivas_core_enc(

    input_Fs = sts[0]->input_Fs;
    input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC );

#ifndef FIX_1298_MEMORY_OPT_IVAS_CORE_ENC
    set_f( new_swb_speech_buffer, 0, L_FRAME48k + STEREO_DFT_OVL_MAX );
#endif

    for ( n = 0; n < n_CoreChannels; n++ )
    {
@@ -348,6 +354,10 @@ ivas_error ivas_core_enc(
         * WB BWE encoding
         *---------------------------------------------------------------------*/

#ifdef FIX_1298_MEMORY_OPT_IVAS_CORE_ENC
        hb_speech = new_swb_speech_buffer; /* reuse existing buffer: hb_speech[L_FRAME16k/4]; */
#endif

        if ( input_Fs >= 16000 && st->bwidth < SWB && st->hBWE_TD != NULL )
        {
            /* Common pre-processing for WB TBE and WB BWE */
@@ -371,6 +381,10 @@ ivas_error ivas_core_enc(
         *---------------------------------------------------------------------*/

        new_swb_speech = new_swb_speech_buffer + STEREO_DFT_OVL_MAX;
#ifdef FIX_1298_MEMORY_OPT_IVAS_CORE_ENC
        set_f( new_swb_speech_buffer, 0, L_FRAME48k + STEREO_DFT_OVL_MAX );
        shb_speech = new_inp_resamp16k[n]; /* reuse existing buffer: shb_speech[L_FRAME16k] */
#endif

        if ( !st->Opt_SC_VBR && input_Fs >= 32000 && st->hBWE_TD != NULL )
        {