Commit 519e435e authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge remote-tracking branch 'origin/ivas-float-update' into...

Merge remote-tracking branch 'origin/ivas-float-update' into 1892_ref_port_mr_1787_low_rt_cldfb_reverb_fix
parents 57f2c3dc 3423bb61
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -202,6 +202,7 @@
#define NONBE_SVD_OPTIMIZATION                          /* FhG: port-2211-svd-optimization */
#define FIX_1135_EXT_RENDERER_HANDLES                   /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */
#define FIX_1209_SID_SIGNALING                          /* VA: issue 1209: remove dead code in IVAS SID signaling */
#define NONBE_1250_MCMASA_LS_OUTPUT                     /* VA: issue 1250: fix crash in McMASA to custom LS output decoding */
#define FIX_1158_FASTCONV_REVERB_HRTF                   /* Philips: issue 1158: Rendering with FastConv to BINAURAL_ROOM_REVERB uses BRIR convolution instead of HRTF */
#define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR       /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */
#define NONBE_1131_ACELP_OOB                            /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */
@@ -210,10 +211,12 @@
#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_VOIP_FUNCTIONS                              /* VA: fix data type mismatch in IVAS_DEC_VoIP_SetScale() + add sanity checks to API functions */
#define FIX_1298_MEMORY_OPT_IVAS_CORE_ENC               /* VA: issue 1298: Memory saving in ivas_core_enc() */
#define FIX_587_DEFAULT_REVERB                          /* Philips: issue 587: inconsistent default reverb parameters across renderers */
#define NONBE_1214_PLC_LSF_MEMORY                       /* VA: issue 1224: reset ACELP PLC FEC memory in case of switching from MDCT stereo to TD/DFT stereo */
#define NONBE_1293_SR_HRTF                              /* VA: issue 1293: add support of external HRTFs in split rendering */
#define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH             /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */
#define FIX_1369_HQ_LR_OVERFLOW                         /* FhG: fix BASOP overflow in hq_lr_enc(), brings floating-point code inline with FX */
#define FIX_1139_REV_COLORATION_SHORT_T60               /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */

/* #################### End BASOP porting switches ############################ */
+7 −0
Original line number Diff line number Diff line
@@ -2449,7 +2449,14 @@ void ivas_dirac_dec_render_sf(

            /* Move the separated and the LFE channels to temporary variables as spatial synthesis may overwrite current channels */
            mvr2r( &( output_f[st_ivas->hOutSetup.separateChannelIndex][subframe_start_sample] ), tmp_separated, num_samples_subframe );
#ifdef NONBE_1250_MCMASA_LS_OUTPUT
            if ( hDirACRend->hOutSetup.num_lfe > 0 )
            {
                mvr2r( &( output_f[LFE_CHANNEL][subframe_start_sample] ), tmp_lfe, num_samples_subframe );
            }
#else
            mvr2r( &( output_f[LFE_CHANNEL][subframe_start_sample] ), tmp_lfe, num_samples_subframe );
#endif

            for ( ch = 0; ch < outchannels; ch++ )
            {
+8 −0
Original line number Diff line number Diff line
@@ -334,7 +334,15 @@ void hq_lr_enc(
        frac1 = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */
        L_tmp = Pow2( 30, frac1 );
        exp = sub( exp, 30 );
#ifdef FIX_1369_HQ_LR_OVERFLOW
#ifdef BASOP_NOGLOB
        Ep_fx[i] = L_shl_o( L_tmp, s_max( sub( exp, 6 ), -31 ), &Overflow ); /* Q -6 */
#else
        Ep_fx[i] = L_shl( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */
#endif
#else
        Ep_fx[i] = L_shl( L_tmp, sub( exp, 6 ) ); /* Q -6 */
#endif
        Ep[i] = (float) ( Ep_fx[i] / pow( 2.0, -6 ) );
    }

+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 )
        {