Commit 0887cf97 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

Merge branch 'main' into 579-bandwidth-in-1ism-at-16-4-kbps

parents 6ca77538 0a80080c
Loading
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -953,7 +953,7 @@ sanitizer-test-ism3:
    - if: $SANITIZER_SCHEDULE_A
      when: delayed
      start_in: 11 hours
  timeout: 3 hour
  timeout: 4 hour
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py ISM3 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS
@@ -963,8 +963,8 @@ sanitizer-test-ism4:
  rules:
    - if: $SANITIZER_SCHEDULE_A
      when: delayed
      start_in: 14 hours
  timeout: 4 hours
      start_in: 15 hours
  timeout: 6 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py ISM4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS
@@ -974,7 +974,7 @@ sanitizer-test-masa:
  rules:
    - if: $SANITIZER_SCHEDULE_A
      when: delayed
      start_in: 18 hours
      start_in: 21 hours
  timeout: 3 hours
  script:
    - *update-ltv-repo
@@ -1092,7 +1092,7 @@ sanitizer-test-ism+3:
    - if: $SANITIZER_SCHEDULE_D
      when: delayed
      start_in: 5 hours
  timeout: 3 hour
  timeout: 4 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py ISM+3 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS
@@ -1102,8 +1102,8 @@ sanitizer-test-ism+4:
  rules:
    - if: $SANITIZER_SCHEDULE_D
      when: delayed
      start_in: 8 hours
  timeout: 4 hours
      start_in: 9 hours
  timeout: 6 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py ISM+4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS
+1 −0
Original line number Diff line number Diff line
@@ -157,6 +157,7 @@
#define FIX_578_PARAMMC_ILD_BS                          /* FhG: Issue 578: transmitt also center ILD in band 0 when LFE is active in 3TC ParamMC */
#define FIX_UNCLR_ISSUE                                 /* VoiceAge: issue 574: Fix UNCLR mis-classifications in noisy speech stereo */
#define FIX_TCX_LOWRATE_LIMITATION                      /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */
#define FIX_575_LOW_OVERLAP_PLC_RECOVERY                /* FhG: Issue 575 fix for PLC and transistion to TCX5*/


#define ISM_FB_16k4 // VA: experimental change for issue 579
+65 −0
Original line number Diff line number Diff line
@@ -377,7 +377,11 @@ 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 )
                {
@@ -393,6 +397,14 @@ 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 ) )

@@ -1240,28 +1252,81 @@ 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 )
                        {
                            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];
                        }
                    }
                    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];
                        }
                    }
#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 )
                            {
                                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];
                            }
                        }
#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 )
                            {
                                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];
                            }
                        }
#else
                        for ( i = 0; i < infoIGFStartLine; i = i + 2 )
                        {
                            st->hTonalMDCTConc->lastBlockData.spectralData[i + 1] = st->hTonalMDCTConc->lastBlockData.spectralData[i];
                        }
#endif
                    }
                }

                noiseTiltFactor = 1.0f;