Commit 5d6d71ab authored by Jan Kiene's avatar Jan Kiene
Browse files

accept FIX_575_LOW_OVERLAP_PLC_RECOVERY

parent 9f8407bf
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -158,7 +158,6 @@
#define FIX_559_EXTL_IGF_MISMATCH                       /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */
#define FIX_571_REVERB_NOT_ACTIVATED_ISM                /* Philips: Issue 571: Reverb not activated for discrete and parametric ISM */
#define FIX_QMETA_SID_5k2                               /* Nokia: Issue 137: enable using full 5.2k bitrate in MASA SID */
#define FIX_575_LOW_OVERLAP_PLC_RECOVERY                /* FhG: Issue 575 fix for PLC and transistion to TCX5*/
#define FIX_550_FIRST_FRAME_ACCESS                      /* Eri: Issue 550: TD Object renderer: first frame accesses wrong transport channel offsets */
#define FIX_550_FIRST_FRAME_ACCESS_ALT                  /* Eri: Issue 550: Should be merged with FIX_550_FIRST_FRAME_ACCESS above, or accepted at the same time */
#define FIX_569_TD_FILTER_LENGTH                        /* Eri: Issue 569: If an HRTF binary file exceeds the SFX_SPAT_BIN_MAX_FILTER_LENGTH the decoder crashes. This truncates the filter when generated from the model.  */
+0 −28
Original line number Diff line number Diff line
@@ -377,11 +377,7 @@ void IMDCT(
                    TCX_MDCT_Inverse( x + w * L_spec_TCX5, win, L_ola, L_win - L_ola, L_ola, st->element_mode );
                }

#ifndef FIX_575_LOW_OVERLAP_PLC_RECOVERY
                tcx_windowing_synthesis_current_frame( win, tcx_aldo_window_2, tcx_mdct_window_half, tcx_mdct_window_minimum, L_ola, tcx_mdct_window_half_length, tcx_mdct_window_min_length, ( w > 0 ) ? 0 : left_rect, ( w > 0 ) || ( w == 0 && index == 2 ) ? MIN_OVERLAP : hTcxCfg->tcx_last_overlap_mode, acelp_zir, hTcxDec->old_syn_Overl, syn_Overl_TDAC, st->old_Aq_12_8, tcx_mdct_window_trans, L_win, tcx_offset < 0 ? -tcx_offset : 0, ( w > 0 ) || ( frame_cnt > 0 ) ? 1 : st->last_core_bfi, ( w > 0 ) || ( frame_cnt > 0 ) ? 0 : st->last_is_cng, fullbandScale );
#else
                tcx_windowing_synthesis_current_frame( win, tcx_aldo_window_2, tcx_mdct_window_half, tcx_mdct_window_minimum, L_ola, tcx_mdct_window_half_length, tcx_mdct_window_min_length, ( w > 0 ) ? 0 : left_rect, ( w > 0 ) || ( w == 0 && index == 2 ) ? MIN_OVERLAP : hTcxCfg->tcx_last_overlap_mode, acelp_zir, hTcxDec->old_syn_Overl, syn_Overl_TDAC, st->old_Aq_12_8, tcx_mdct_window_trans, L_win, tcx_offset < 0 ? -tcx_offset : 0, ( w > 0 ) || ( frame_cnt > 0 ) ? 1 : st->last_core, ( w > 0 ) || ( frame_cnt > 0 ) ? 0 : st->last_is_cng, fullbandScale );
#endif

                if ( w > 0 )
                {
@@ -398,13 +394,11 @@ void IMDCT(
            /* To assure that no garbage values are passed to overlap */
            set_zero( xn_buf + L_frame + tcx_offset + ( L_ola >> 1 ), overlap - tcx_offset - ( L_ola >> 1 ) );

#ifdef FIX_575_LOW_OVERLAP_PLC_RECOVERY
            if ( st->prev_bfi && frame_cnt == 0 && st->last_core != st->last_core_bfi && st->last_core_bfi == ACELP_CORE )
            {
                tcx_windowing_synthesis_past_frame( old_syn_overl, tcx_aldo_window_1_trunc, tcx_mdct_window_half, tcx_mdct_window_minimum, overlap, tcx_mdct_window_half_length, tcx_mdct_window_min_length, hTcxCfg->tcx_last_overlap_mode );
                v_add( xn_buf, old_syn_overl, xn_buf, overlap );
            }
#endif
        }
        else if ( !bfi && ( frame_cnt == 0 ) && ( hTcxCfg->tcx_curr_overlap_mode == FULL_OVERLAP ) )

@@ -1252,7 +1246,6 @@ void decoder_tcx_noisefilling(
                if ( ( frame_cnt == 0 ) && ( L_frameTCX == hTcxDec->L_frameTCX >> 1 ) && ( st->tcxonly ) && ( !st->tonal_mdct_plc_active ) && ( st->nbLostCmpt == 1 ) && ( hTcxCfg->tcx_last_overlap_mode != FULL_OVERLAP ) && ( hTcxCfg->tcx_curr_overlap_mode != FULL_OVERLAP ) )
                {
                    E_2ndlast = E_last = EPSILON;
#ifdef FIX_575_LOW_OVERLAP_PLC_RECOVERY
                    if ( st->element_mode > EVS_MONO )
                    {
                        for ( i = 0; i < L_frameTCX; i = i + 2 )
@@ -1269,19 +1262,11 @@ void decoder_tcx_noisefilling(
                            E_last += st->hTonalMDCTConc->lastBlockData.spectralData[i + 1] * st->hTonalMDCTConc->lastBlockData.spectralData[i + 1];
                        }
                    }
#else
                    for ( i = 0; i < infoIGFStartLine; i = i + 2 )
                    {
                        E_2ndlast += st->hTonalMDCTConc->lastBlockData.spectralData[i] * st->hTonalMDCTConc->lastBlockData.spectralData[i];
                        E_last += st->hTonalMDCTConc->lastBlockData.spectralData[i + 1] * st->hTonalMDCTConc->lastBlockData.spectralData[i + 1];
                    }
#endif
                    tmp2 = E_2ndlast / E_last;

                    /* replace higher energy TCX5 frame by lower one to avoid energy fluctuation */
                    if ( tmp2 > 2 )
                    {
#ifdef FIX_575_LOW_OVERLAP_PLC_RECOVERY
                        if ( st->element_mode > EVS_MONO )
                        {
                            for ( i = 0; i < L_frameTCX; i = i + 2 )
@@ -1296,16 +1281,9 @@ void decoder_tcx_noisefilling(
                                st->hTonalMDCTConc->lastBlockData.spectralData[i] = st->hTonalMDCTConc->lastBlockData.spectralData[i + 1];
                            }
                        }
#else
                        for ( i = 0; i < infoIGFStartLine; i = i + 2 )
                        {
                            st->hTonalMDCTConc->lastBlockData.spectralData[i] = st->hTonalMDCTConc->lastBlockData.spectralData[i + 1];
                        }
#endif
                    }
                    else if ( tmp2 < 0.5 )
                    {
#ifdef FIX_575_LOW_OVERLAP_PLC_RECOVERY
                        if ( st->element_mode > EVS_MONO )
                        {
                            for ( i = 0; i < L_frameTCX; i = i + 2 )
@@ -1320,12 +1298,6 @@ void decoder_tcx_noisefilling(
                                st->hTonalMDCTConc->lastBlockData.spectralData[i + 1] = st->hTonalMDCTConc->lastBlockData.spectralData[i];
                            }
                        }
#else
                        for ( i = 0; i < infoIGFStartLine; i = i + 2 )
                        {
                            st->hTonalMDCTConc->lastBlockData.spectralData[i + 1] = st->hTonalMDCTConc->lastBlockData.spectralData[i];
                        }
#endif
                    }
                }