Commit 7cdbd68c authored by Fabian Bauer's avatar Fabian Bauer
Browse files

synch open_decoder_LPD_fx with float and change GT(element_mode,EVS_MONO) to NE...

parent 8776e14a
Loading
Loading
Loading
Loading
+37 −48
Original line number Diff line number Diff line
@@ -1168,7 +1168,7 @@ void open_decoder_LPD_ivas_fx(
    test();
    test();
    IF( ( st->element_mode == EVS_MONO && EQ_16( st->L_frame, L_FRAME16k ) && LE_32( st->total_brate, 32000 ) ) ||
        ( st->element_mode > EVS_MONO && EQ_16( st->L_frame, L_FRAME16k ) && LE_32( total_brate, MAX_ACELP_BRATE ) ) ||
        ( NE_16(st->element_mode, EVS_MONO) && EQ_16( st->L_frame, L_FRAME16k ) && LE_32( total_brate, MAX_ACELP_BRATE ) ) ||
        ( ( st->tcxonly != 0 ) && ( EQ_32( st->sr_core, 32000 ) || EQ_32( st->sr_core, 16000 ) ) ) )
    {
        st->nb_subfr = NB_SUBFR16k;
@@ -1251,30 +1251,30 @@ void open_decoder_LPD_ivas_fx(

    test();
#ifdef HARMONIZE_2583_open_decoder_LPD
    /*TODO: CHECK THIS*/
    /*TODO ber: check this*/
    IF( EQ_16( st->element_mode, EVS_MONO ) )
    {
        st->gamma = GAMMA1;
        move16();
        st->inv_gamma = GAMMA1_INV;
        move16();
        test();
        test();
        IF( EQ_32( st->sr_core, INT_FS_16k ) ||
            ( GT_32( st->sr_core, INT_FS_16k ) && EQ_16( st->element_mode, IVAS_CPE_MDCT ) ) )
        IF( EQ_32( st->sr_core, INT_FS_16k ) )
        {
            st->gamma = GAMMA16k;
            move16();
            st->inv_gamma = GAMMA16k_INV;
            move16();
        }
        ELSE
        {
            st->gamma = GAMMA1;
            move16();
            st->inv_gamma = GAMMA1_INV;
            move16();
        }
    }
    ELSE
    {
#endif

        st->inv_gamma = GAMMA1_INV;
        move16();
        test();
        IF( EQ_32( st->sr_core, INT_FS_16k ) )
        {
@@ -1283,7 +1283,7 @@ void open_decoder_LPD_ivas_fx(
            st->inv_gamma = GAMMA16k_INV;
            move16();
        }
        ELSE IF( GT_16( st->element_mode, EVS_MONO ) && GT_32( st->sr_core, INT_FS_16k ) )
        ELSE IF( GT_32( st->sr_core, INT_FS_16k ) )
        {
            st->gamma = GAMMA16k;
            move16();
@@ -1294,6 +1294,8 @@ void open_decoder_LPD_ivas_fx(
        {
            st->gamma = GAMMA1;
            move16();
            st->inv_gamma = GAMMA1_INV;
            move16();
        }
#ifdef HARMONIZE_2583_open_decoder_LPD
    }
@@ -1346,7 +1348,6 @@ void open_decoder_LPD_ivas_fx(
        {
            st->hTcxCfg->tcx_curr_overlap_mode = st->hTcxCfg->tcx_last_overlap_mode = ALDO_WINDOW;
            move16();
            move16();
            st->hTcxCfg->last_aldo = 1;
            move16();
        }
@@ -1390,18 +1391,12 @@ void open_decoder_LPD_ivas_fx(
                set16_fx( hTcxDec->syn_Overl_TDACFB, 0, shr( L_FRAME_MAX, 1 ) ); /* hTcxDec->Q_syn_Overl_TDACFB */

                set16_fx( hTcxDec->syn_Overl, 0, shr( L_FRAME32k, 1 ) ); /* hTcxDec->Q_syn_Overl */

                set16_fx( hTcxDec->syn_OverlFB, 0, L_FRAME_MAX / 2 );      /* Qx */
                set16_fx( hTcxDec->old_synth, 0, OLD_SYNTH_INTERNAL_DEC ); /* hTcxDec->q_old_synth */
                hTcxDec->q_old_synth = 0;
                move16();
                set16_fx( hTcxDec->synth_history_fx, 0, add( L_PROT48k, L_FRAME_MAX ) ); /* hTcxDec->q_synth_history_fx */
                hTcxDec->q_synth_history_fx = 0;
                move16();
            }
            ELSE
            {
                reset_tcx_overl_buf_fx( st->hTcxDec );
            }

            set16_fx( hTcxDec->syn_OverlFB, 0, L_FRAME_MAX / 2 );      /* Qx */
            set16_fx( hTcxDec->old_synth, 0, OLD_SYNTH_INTERNAL_DEC ); /* hTcxDec->q_old_synth */
            hTcxDec->q_old_synth = 0;
@@ -1409,7 +1404,6 @@ void open_decoder_LPD_ivas_fx(
            set16_fx( hTcxDec->synth_history_fx, 0, L_PROT48k + L_FRAME_MAX ); /* hTcxDec->q_synth_history_fx */
            hTcxDec->q_synth_history_fx = 0;
            move16();
            }
#else
            reset_tcx_overl_buf_fx( st->hTcxDec );
            set16_fx( hTcxDec->syn_OverlFB, 0, L_FRAME_MAX / 2 );      /* Qx */
@@ -1490,7 +1484,7 @@ void open_decoder_LPD_ivas_fx(
#ifdef HARMONIZE_2583_open_decoder_LPD
        IF( EQ_16( st->element_mode, EVS_MONO ) )
        {
            IF( ( NE_16( st->element_mode, IVAS_CPE_DFT ) || ( EQ_16( st->element_mode, IVAS_CPE_DFT ) && st->prev_bfi ) ) && EQ_16( st->last_codec_mode, MODE1 ) && ( st->last_core == ACELP_CORE ) )
            IF( EQ_16( st->last_codec_mode, MODE1 ) && ( st->last_core == ACELP_CORE ) )
            {
                st->last_core_bfi = ACELP_CORE;
                move16();
@@ -1586,6 +1580,7 @@ void open_decoder_LPD_ivas_fx(
        test();
        test();
        test();
        test();
        IF( EQ_16( st->last_codec_mode, MODE2 ) && NE_16( st->L_frame, st->last_L_frame ) &&
            ( ( EQ_16( st->m_frame_type, SID_FRAME ) && ( st->last_core > ACELP_CORE ) ) ||
              ( ( st->last_core > ACELP_CORE ) && ( st->core > ACELP_CORE ) ) || st->prev_bfi ) )
@@ -1595,8 +1590,6 @@ void open_decoder_LPD_ivas_fx(

        /* Rate switching */
        test();
        test();
        test();
        IF( EQ_16( st->last_codec_mode, MODE1 ) && EQ_16( st->last_core, HQ_CORE ) )
        {
            /* Switching from MDCT */
@@ -1633,15 +1626,16 @@ void open_decoder_LPD_ivas_fx(

            IF( st->hTcxCfg != NULL )
            {
                Copy_Scale_sig( hHQ_core->old_out_fx + NS2SA_FX2( st->output_Fs, N_ZERO_MDCT_NS ), hTcxDec->syn_OverlFB, st->hTcxCfg->tcx_mdct_window_lengthFB, negate( add( hHQ_core->Q_old_wtda, TCX_IMDCT_HEADROOM ) ) ); /* Q_old_out */
#ifdef HARMONIZE_2583_open_decoder_LPD
                IF( GT_16( st->element_mode, EVS_MONO ) )
                if ( NE_16( st->element_mode, EVS_MONO ) )
                {
#endif
                    *Q_syn_OverlFB = *Q_old_out;
                    move16();
#ifdef HARMONIZE_2583_open_decoder_LPD
                }
#endif
                Copy_Scale_sig( hHQ_core->old_out_fx + NS2SA_FX2( st->output_Fs, N_ZERO_MDCT_NS ), hTcxDec->syn_OverlFB, st->hTcxCfg->tcx_mdct_window_lengthFB, negate( add( hHQ_core->Q_old_wtda, TCX_IMDCT_HEADROOM ) ) ); /* Q_old_out */
                move16();
                st->hTcxCfg->last_aldo = 1; /*It was previously ALDO*/
                move16();
@@ -1705,7 +1699,7 @@ void open_decoder_LPD_ivas_fx(
            Copy( st->lsp_old_fx, st->lspold_uw, M ); /* Q15 */
            Copy( st->lsf_old_fx, st->lsfold_uw, M ); /* Q2.56 */
#ifdef HARMONIZE_2583_open_decoder_LPD
            IF( GT_16( st->element_mode, EVS_MONO ) )
            IF( NE_16( st->element_mode, EVS_MONO ) )
            {
#endif
                *Q_old_Aq_12_8 = 14;
@@ -1899,7 +1893,7 @@ void open_decoder_LPD_ivas_fx(
        move16();
        st->last_concealed_gain_syn_deemph_e = 1;
        move16();
        if ( hTcxDec != NULL )
        IF ( hTcxDec != NULL )
        {
#ifdef HARMONIZE_2583_open_decoder_LPD
            IF( EQ_16( st->element_mode, EVS_MONO ) )
@@ -1931,7 +1925,7 @@ void open_decoder_LPD_ivas_fx(
        st->last_core_bfi = -1;
        move16();
#ifdef HARMONIZE_2583_open_decoder_LPD
        IF( GT_16( st->element_mode, EVS_MONO ) )
        IF( NE_16( st->element_mode, EVS_MONO ) )
        {
#endif
            if ( st->hTcxDec != NULL )
@@ -1947,7 +1941,7 @@ void open_decoder_LPD_ivas_fx(
    move16();

#ifdef HARMONIZE_2583_open_decoder_LPD
    IF( GT_16( st->element_mode, EVS_MONO ) )
    IF( NE_16( st->element_mode, EVS_MONO ) )
    {
#endif
        IF( st->hTcxDec != NULL )
@@ -2066,15 +2060,10 @@ void open_decoder_LPD_ivas_fx(
                move16();
                hTcxDec->conLastFrameLevel = PLC_MIN_CNG_LEV; /*Q15*/
                move16();
                set16_fx( hTcxDec->conNoiseLevelMemory, PLC_MIN_CNG_LEV, PLC_MIN_STAT_BUFF_SIZE ); /*Q15*/
                set16_fx( hTcxDec->conNoiseLevelMemory_e, 0, PLC_MIN_STAT_BUFF_SIZE );
                hTcxDec->conLastFrameLevel_e = 0;
                move16();
                hTcxDec->conCngLevelBackgroundTrace_e = -6;
                move16();

                hTcxDec->cummulative_damping_tcx = 32767 /*1.0f Q15*/;
                move16();
            }
#ifdef HARMONIZE_2583_open_decoder_LPD
        }
@@ -2132,7 +2121,7 @@ void open_decoder_LPD_ivas_fx(
        test();
        test();
        test();
        IF( hTcxLtpDec != NULL && ( EQ_16( st->ini_frame, 0 ) || ( EQ_16( st->last_codec_mode, MODE1 ) && st->element_mode == EVS_MONO ) ) )
        IF( hTcxLtpDec != NULL && ( EQ_16( st->ini_frame, 0 ) ||  EQ_16( st->last_codec_mode, MODE1 ) ) )
        {
            hTcxLtpDec->tcxltp_pitch_int = st->pit_max; /* Q0 */
            move16();
@@ -2174,7 +2163,7 @@ void open_decoder_LPD_ivas_fx(
            move32();
            test();
            test();
            IF( ( st->ini_frame == 0 ) || ( EQ_16( st->last_codec_mode, MODE1 ) && st->element_mode == EVS_MONO ) )
            IF( st->ini_frame == 0 )
            {
                hTcxDec->tcxltp_last_gain_unmodified = 0;
                move16();
@@ -2194,7 +2183,7 @@ void open_decoder_LPD_ivas_fx(
        st->lp_error_ener = Mpy_32_16_1( L_shl( hBPF->pst_lp_ener_fx, 8 ), 0x2a86 ); /* convert from 7Q8 10*log10 -> 15Q16, log2 */
        move32();
#ifdef HARMONIZE_2583_open_decoder_LPD
        IF( GT_16( st->element_mode, EVS_MONO ) )
        IF( NE_16( st->element_mode, EVS_MONO ) )
        {
#endif
            hBPF->pst_mem_deemp_err_fx = 0; /* Q_syn2 - 1 */
@@ -2270,7 +2259,7 @@ void open_decoder_LPD_ivas_fx(
    st->flagGuidedAcelp = 0;
    move16();
#ifdef HARMONIZE_2583_open_decoder_LPD
    IF( GT_16( st->element_mode, EVS_MONO ) )
    IF( NE_16( st->element_mode, EVS_MONO ) )
    {
#endif
        st->tonal_mdct_plc_active = 0;
@@ -2290,7 +2279,7 @@ void open_decoder_LPD_ivas_fx(
        move16();
#ifdef HARMONIZE_2583_open_decoder_LPD
        Word32 last_total_brate_condition;
        IF( GT_16( st->element_mode, EVS_MONO ) )
        IF( NE_16( st->element_mode, EVS_MONO ) )
        {
            last_total_brate_condition = LT_32( last_total_brate, HQ_48k );
        }
@@ -2316,7 +2305,7 @@ void open_decoder_LPD_ivas_fx(
    test();
    test();
    test();
    IF( st->hTonalMDCTConc != NULL && !( st->element_mode > EVS_MONO && ( st->ini_frame != 0 ) && EQ_16( st->hTonalMDCTConc->nSamples, st->hTcxDec->L_frameTCX ) ) )
    IF( st->hTonalMDCTConc != NULL && !( NE_16(st->element_mode, EVS_MONO) && ( st->ini_frame != 0 ) && EQ_16( st->hTonalMDCTConc->nSamples, st->hTcxDec->L_frameTCX ) ) )
    {
        st->hTonalMDCTConc->nScaleFactors = 0;
        move16();
@@ -2404,7 +2393,7 @@ void open_decoder_LPD_ivas_fx(
    st->dec_glr_idx = 0;
    move16();
#ifdef HARMONIZE_2583_open_decoder_LPD
    if ( GT_16( st->element_mode, EVS_MONO ) )
    if ( NE_16( st->element_mode, EVS_MONO ) )
    {
#endif
        st->VAD = 0;