Commit 959e3ae1 authored by vaclav's avatar vaclav
Browse files

accept NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING, NONBE_FIX_1297_SPAR_JBM_MEM_SAN,...

accept NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING, NONBE_FIX_1297_SPAR_JBM_MEM_SAN, NONBE_1289_STEREO_SW_TO_MONO
parent c860fc69
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -170,10 +170,7 @@
/* all switches in this category should start with "NONBE_" */

#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ 
#define NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING           /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms  in PhECU-PLC  */
#define NONBE_1293_CRASH_FIRST_FRAME_LOST               /* VA: issue 1293: fix G.192 decoder crash when first frame is lost */
#define NONBE_FIX_1297_SPAR_JBM_MEM_SAN                 /*Dolby: issue 1297, SPAR + JBM + BR switch memory sanitizer*/  
#define NONBE_1289_STEREO_SW_TO_MONO                    /* VA: issue 1289: Fix glitch when stereo signal is decoded to mono n TD->DFT switching */
#define NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX         /* FhG: Avoid JBM ignoring safety margin and setting playout delay to 0 during DTX */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define NONBE_1296_TDREND_ITD_OUT_OF_BOUNDS_ACCESS      /* Eri: issue 1296: ITD resampling can occasionally read out of bounds, especially when the requested subframes are short (1.25 ms). Seen for headtracking+JBM. */
+7 −22
Original line number Diff line number Diff line
@@ -263,9 +263,7 @@ static void trans_ana(
    const int16_t time_offs,     /* i  : Time offset                                          */
    const float est_mus_content, /* i  : 0.0=speech_like ... 1.0=Music    (==st->env_stab )   */
    const int16_t last_fec,      /* i  : signal that previous frame was concealed with fec_alg*/
#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
    const int16_t element_mode,  /* i  :  element_mode req to handle EVS_MONO specific BE path*/
#endif
    float *alpha,                /* o  : Magnitude modification factors for fade to average   */
    float *beta,                 /* o  : Magnitude modification factors for fade to average   */
    float *beta_mute,            /* o  : Factor for long-term mute                            */
@@ -419,7 +417,7 @@ static void trans_ana(
            {
                mag_chg[k] = 0;
            }
#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING

            if ( element_mode != EVS_MONO )
            {
                if ( k == 0 && burst_len > BETA_MUTE_THR ) /* beta_mute final long term attenuation adjusted only once per frame in the first sub-band, Ref   Eq(184) in 26.447 */
@@ -434,12 +432,7 @@ static void trans_ana(
                    *beta_mute *= BETA_MUTE_FAC;
                }
            }
#else
            if ( burst_len > BETA_MUTE_THR )
            {
                *beta_mute *= BETA_MUTE_FAC;
            }
#endif

            alpha[k] = mag_chg[k];
            beta[k] = (float) ( sqrt( 1.0f - SQR( alpha[k] ) ) * *beta_mute );
            if ( k >= LGW32k - 1 )
@@ -2114,11 +2107,7 @@ static void hq_phase_ecu(
            *time_offs = 0; /* IVAS reset of offset time counter, timeoffset variable later also used to calculate burst length */
        }

#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
        trans_ana( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, *last_fec, element_mode, alpha, beta, beta_mute, Xavg );
#else
        trans_ana( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, *last_fec, alpha, beta, beta_mute, Xavg );
#endif
        spec_ana( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, plocs, plocsi, num_p, X_sav, output_frame, bwidth, element_mode, &noise_fac, pcorr );

        if ( prev_bfi && *last_fec )
@@ -2146,11 +2135,7 @@ static void hq_phase_ecu(
            *time_offs = (int16_t) INT16_MAX; /* high value --> continued muting will ensure that the now saturated  seed is not creating tones */
        }

#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
        trans_ana( prevsynth + 2 * output_frame - Lprot, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, 0, element_mode, alpha, beta, beta_mute, Xavg ); /* 1.0 stable-music,  0.0 speech-like */
#else
        trans_ana( prevsynth + 2 * output_frame - Lprot, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, 0, alpha, beta, beta_mute, Xavg ); /* 1.0 stable-music,  0.0 speech-like */
#endif
    }

    mvr2r( X_sav, X, Lprot );
+4 −16
Original line number Diff line number Diff line
@@ -1533,45 +1533,33 @@ ivas_error ivas_jbm_dec_flush_renderer(
        }
        else if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
        {
#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN
            if ( ism_mode_old == ISM_SBA_MODE_DISC )
            {
#endif
                float *tc_local[MAX_TRANSPORT_CHANNELS];
                int16_t last_spar_md_idx;
                int16_t last_dirac_md_idx;
                uint16_t nSamplesAvailableNext;
#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN
                ISM_MODE ism_mode_orig;
                RENDERER_TYPE renderer_type_orig;
                int32_t ivas_total_brate;

                ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
                renderer_type_orig = st_ivas->renderer_type;
                ism_mode_orig = st_ivas->ism_mode;
                st_ivas->ism_mode = ism_mode_old;
                st_ivas->renderer_type = renderer_type_old;
                st_ivas->hDecoderConfig->ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate;
#endif

                last_spar_md_idx = st_ivas->hSpar->render_to_md_map[st_ivas->hSpar->slots_rendered - 1];
                last_dirac_md_idx = st_ivas->hSpatParamRendCom->render_to_md_map[st_ivas->hSpatParamRendCom->slots_rendered - 1];
#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN
#ifdef DEBUGGING
                assert( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV );
#endif
#else
#ifdef DEBUGGING
            assert( ism_mode_old == ISM_SBA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV );
#endif
#endif

                /* copy from ISM delay buffer to the correct place in tcs */
                for ( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ )
                {
#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN
                    tc_local[ch_idx] = &st_ivas->hTcBuffer->tc[ch_idx][hTcBuffer->n_samples_rendered];
#else
                tc_local[ch_idx] = &st_ivas->hTcBuffer->tc[ch_idx + 2][hTcBuffer->n_samples_rendered];
#endif
                    mvr2r( st_ivas->hSbaIsmData->delayBuffer[ch_idx], tc_local[ch_idx], st_ivas->hSbaIsmData->delayBuffer_size );
                }

@@ -1596,17 +1584,17 @@ ivas_error ivas_jbm_dec_flush_renderer(
                {
                    return error;
                }
#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN

                st_ivas->ism_mode = ism_mode_orig;
                st_ivas->renderer_type = renderer_type_orig;
                st_ivas->hDecoderConfig->ivas_total_brate = ivas_total_brate;
            }
#endif
        }
        else
        {
            return IVAS_ERROR( IVAS_ERR_WRONG_MODE, "Wrong IVAS format in VoIP renderer flushing!" );
        }

        hTcBuffer->n_samples_rendered = hTcBuffer->n_samples_granularity;
    }

+0 −4
Original line number Diff line number Diff line
@@ -1141,11 +1141,7 @@ void synchro_synthesis(
        /* handling of TD->DFT switching */
        for ( n = 0; n < hCPE->nchan_out; n++ )
        {
#ifdef NONBE_1289_STEREO_SW_TO_MONO
            if ( ( !use_cldfb_for_last_dft && hCPE->last_element_mode != IVAS_CPE_DFT && !sba_dirac_stereo_flag && dft_mono_brate_switch != -1 ) || dft_mono_brate_switch == 1 )
#else
            if ( ( hCPE->last_element_mode != IVAS_CPE_DFT && !sba_dirac_stereo_flag && dft_mono_brate_switch != -1 ) || dft_mono_brate_switch == 1 )
#endif
            {
                float *pPrev_synth;
                float inv_fade_len = 1.f / delay_diff;
+0 −5
Original line number Diff line number Diff line
@@ -1131,15 +1131,10 @@ ivas_error IVAS_DEC_ReadFormat(
                }
            }
#else
#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN
        if ( ( renderer_type_old != st_ivas->renderer_type && renderer_type_old != RENDERER_DISABLE ) ||
             ( st_ivas->ini_active_frame > 0 &&
               ( ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) ||
                 ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->ism_mode != ISM_SBA_MODE_DISC ) ) ) )
#else
        if ( ( renderer_type_old != st_ivas->renderer_type && renderer_type_old != RENDERER_DISABLE ) ||
             ( st_ivas->ini_active_frame > 0 && ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) )
#endif
        {
            /* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv
            render what still fits in the new granularity */