Commit 7e124cb4 authored by norvell's avatar norvell
Browse files

Fix for EVS mono BE

parent 50e723e4
Loading
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -148,7 +148,6 @@

#define SPAR_SCALING_HARMONIZATION                      /* Issue 80: Changes to harmonize scaling in spar */
#define SBA_INTERN_CONFIG_FIX_HOA2                      /* Issue 99 : Fix for incorrect internal_config when output format is HOA2 or FOA*/
#define FIX_I102_SWB_TBE_SWITCH                         /* Issue 102: avoid IO->SWB switching code for IVAS, generate SHB ACB mem with lerp in case of switch */
#define FIX_I98_HANDLES_TO_NULL                         /* Issue 98: do the setting of all handles to NULL in one place */
#define FIX_I102_SWB_TBE_SWITCH                         /* Issue 102: avoid IO->SWB switching code for IVAS, generate SHB ACB mem with lerp in case of switch */

+58 −45
Original line number Diff line number Diff line
@@ -681,8 +681,11 @@ void swb_pre_proc(
    }
    else
    {
#ifndef FIX_I102_SWB_TBE_SWITCH
#ifdef FIX_I102_SWB_TBE_SWITCH
        if ( ( st->bwidth == FB || st->core == ACELP_CORE ) && ( st->element_mode == EVS_MONO ) )
#else
        if ( st->bwidth == FB || st->core == ACELP_CORE || ( st->element_mode == IVAS_CPE_DFT && input_Fs == 48000 ) )
#endif
        {
            set_f( hBWE_TD->old_speech_shb, 0, L_LOOK_16k + L_SUBFR16k );
            set_f( shb_speech, 0, L_FRAME16k ); /* shb_speech for FB/SWB BWE_HIGHRATE is not used at 64kbps */
@@ -702,7 +705,9 @@ void swb_pre_proc(
        }
        else
        {
#else
#ifdef FIX_I102_SWB_TBE_SWITCH
            if ( st->element_mode == IVAS_CPE_DFT )
            {
                if ( st->L_frame == L_FRAME )
                {
                    L_resamp = 560; /* 6.4 kHz core -> 6 - 14 kHz band target -> 560 samples in 28 kHz sample rate */
@@ -725,8 +730,18 @@ void swb_pre_proc(
                /* Dirty upsampling to match Nyquist to lower frequency limit of target (reversed spectrum)*/
                lerp( spchTmp, spchTmp2, L_FRAME32k, L_resamp );
                mvr2r( spchTmp2, spchTmp, L_FRAME32k );
#endif
#ifndef FIX_I102_SWB_TBE_SWITCH
            }
            else
            {
                /* flip the spectrum */
                mvr2r( new_swb_speech, spchTmp, L_FRAME32k );

                for ( i = 0; i < L_FRAME32k; i = i + 2 )
                {
                    spchTmp[i] = -spchTmp[i];
                }
            }
#else
            /* flip the spectrm */
            mvr2r( new_swb_speech, spchTmp, L_FRAME32k );

@@ -747,9 +762,7 @@ void swb_pre_proc(
                    hCPE->hStereoDft->output_mem_dmx_16k_shb[i] = shb_speech[20 + i] * hCPE->hStereoDft->win_ana_16k[STEREO_DFT_OVL_16k - 1 - i] * hCPE->hStereoDft->win_ana_16k[STEREO_DFT_OVL_16k - 1 - i];
                }
            }
#ifndef FIX_I102_SWB_TBE_SWITCH
        }
#endif

        if ( st->element_mode != IVAS_CPE_DFT )
        {