Commit 99c4fecd authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

Merge branch 'main' into Dolby/test_vlad_isar

parents 4a88a5d2 6941acb1
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -161,6 +161,7 @@

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define FIX_1466_EXTREND                                /* FhG: issue 1466: enable rendering of mono/stereo to other formats in the external renderer */
#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 FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER /* FhG: fix CLANG18 MSAN error in decoder init */
#define FIX_1481_CLANG18_MSAN_INIT_LAST_ELEM_BRATE      /* FhG: initialize last_element_brate to avoid CLANG18 MSAN complaint */
@@ -170,6 +171,8 @@
#define FIX_2274_OOB_INDEXING_IN_CORRMATRIX             /* FhG: fix OOB indexing complaint */
#define FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH /* FhG: fix oob indexing USAN complaint */
#define FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE       /* FhG: correct allocation size for STEREO_MDCT_DEC_DATA struct */
#define FIX_2271_OOB_INDEXING_IN_PIT_OL2                /* VA: Fix for issue 2271, to silence clang18 */
#define FIX_2273_OOB_INDEXING_IN_PIT_FR4                /* VA: Fix to silence clang on ptr init */

#define FIX_VE

@@ -185,6 +188,7 @@
#define FIX_1461_CNG_BW_SWITCHING                       /* Eri: issue 1461: Stereo parameters are not updated when SID/NODATA forces BW to stay the same */
#define FIX_2252_LP_CNG_STARTS_SID                      /* VA: issues 2251 and 2252: fix LP CNG uninitialized value in bitstream that starts with an SID */
#define FIX_1381_BWD                                    /* VA: issue 1381: apply no hysteresis in BWD at higher bitrates also in mono MASA and OMASA */
#define FIX_2285_CODE_DECODER_INIT_BW                   /* VA: basop issue 2285: fix core-decoder initialization bandwidth */

/* ##################### End NON-BE switches ########################### */

+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ ivas_error init_decoder(
    }
    else
    {
#if 0 // keep deactivated for the moment to keep BE
#ifdef FIX_2285_CODE_DECODER_INIT_BW
        st->bwidth = WB;
        st->last_bwidth = WB;
#else
+15 −0
Original line number Diff line number Diff line
@@ -228,9 +228,17 @@ void ivas_renderer_select(
     * Non-binaural rendering configurations
     *-----------------------------------------------------------------*/

#ifdef FIX_1435_MOVE_STEREO_PANNING
    else if ( st_ivas->ivas_format == MONO_FORMAT || st_ivas->ivas_format == STEREO_FORMAT )
#else
    else if ( st_ivas->ivas_format == MONO_FORMAT )
#endif
    {
#ifdef FIX_1435_MOVE_STEREO_PANNING
        if ( st_ivas->ivas_format == MONO_FORMAT && output_config == IVAS_AUDIO_CONFIG_STEREO )
#else
        if ( output_config == IVAS_AUDIO_CONFIG_STEREO )
#endif
        {
            *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX;
        }
@@ -238,6 +246,13 @@ void ivas_renderer_select(
        {
            *renderer_type = RENDERER_MC;
        }
#ifdef FIX_1435_MOVE_STEREO_PANNING
        else if ( st_ivas->ivas_format == STEREO_FORMAT &&
                  ( output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) )
        {
            *renderer_type = RENDERER_SBA_LINEAR_ENC;
        }
#endif
    }
    else if ( st_ivas->ivas_format == ISM_FORMAT )
    {
+45 −0
Original line number Diff line number Diff line
@@ -443,6 +443,9 @@ int16_t pitch_fr4(
    int16_t t0, t1, t_min, t_max, pit_min;
    float cor_max, max_val, temp;
    float *corr, corr_v[15 + 2 * L_INTERPOL1 + 1];
#ifdef FIX_2273_OOB_INDEXING_IN_PIT_FR4
    int16_t corr_off;
#endif

    /* initialization */
    if ( limit_flag == 0 )
@@ -482,24 +485,46 @@ int16_t pitch_fr4(

    t_min = t0_min - L_INTERPOL1;
    t_max = t0_max + L_INTERPOL1;

#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4
    corr = &corr_v[0] - t_min; /* corr[t_min..t_max] */
#else
    corr = corr_v;
    corr_off = -t_min;
#endif

#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4
    norm_corr( exc, xn, h, t_min, t_max, corr, L_subfr );
#else
    norm_corr( exc, xn, h, t_min, t_max, corr + corr_off, L_subfr );
#endif

    /*-----------------------------------------------------------------*
     * Find integer pitch
     *-----------------------------------------------------------------*/

#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4
    max_val = corr[t0_min];
#else
    max_val = corr[t0_min + corr_off];
#endif
    t0 = t0_min;

    for ( i = t0_min + 1; i <= t0_max; i++ )
    {
#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4
        if ( corr[i] >= max_val )
        {
            max_val = corr[i];
            t0 = i;
        }
#else
        if ( corr[i + corr_off] >= max_val )
        {
            max_val = corr[i + corr_off];
            t0 = i;
        }
#endif
    }

    if ( t0_fr1 == pit_min )
@@ -512,7 +537,11 @@ int16_t pitch_fr4(
            {
                i -= 2;
            }
#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4
            if ( corr[i] > corr[i + 2] )
#else
            if ( corr[i + corr_off] > corr[i + 2 + corr_off] )
#endif
            {
                t0 = i;
            }
@@ -551,15 +580,27 @@ int16_t pitch_fr4(
    if ( t0 == t0_min ) /* Limit case */
    {
        fraction = 0;
#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4
        cor_max = interpolation( &corr[t0], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 );
#else
        cor_max = interpolation( &corr[t0 + corr_off], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 );
#endif
    }
    else /* Process negative fractions */
    {
        t0--;
#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4
        cor_max = interpolation( &corr[t0], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 );
#else
        cor_max = interpolation( &corr[t0 + corr_off], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 );
#endif
        for ( i = ( fraction + step ); i <= 3; i = i + step )
        {
#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4
            temp = interpolation( &corr[t0], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 );
#else
            temp = interpolation( &corr[t0 + corr_off], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 );
#endif
            if ( temp > cor_max )
            {
                cor_max = temp;
@@ -570,7 +611,11 @@ int16_t pitch_fr4(

    for ( i = 0; i <= 3; i = i + step ) /* Process positive fractions */
    {
#ifndef FIX_2273_OOB_INDEXING_IN_PIT_FR4
        temp = interpolation( &corr[t1], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 );
#else
        temp = interpolation( &corr[t1 + corr_off], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 );
#endif
        if ( temp > cor_max )
        {
            cor_max = temp;
+24 −2
Original line number Diff line number Diff line
@@ -72,7 +72,9 @@ void pitch_ol2(
    int16_t i, t, t0, t1, step, fraction, t0_min, t0_max, t_min, t_max;
    float temp, cor_max, enr_wsp, enr_old, cor[COR_BUF_LEN], *pt_cor, wsp_fr[L_SUBFR];
    const float *pt_wsp;

#ifdef FIX_2271_OOB_INDEXING_IN_PIT_OL2
    int16_t base_idx;
#endif
    t0_min = pitch_ol - delta;
    t0_max = pitch_ol + delta - 1;

@@ -114,24 +116,40 @@ void pitch_ol2(
     * the interpolated normalized correlation.
     *-----------------------------------------------------------------*/

#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2
    pt_cor = cor + L_INTERPOL1 - t0_min;
#endif
    t0 = t1;

#ifdef FIX_2271_OOB_INDEXING_IN_PIT_OL2
    base_idx = L_INTERPOL1 - t0_min;
#endif
    step = 1; /* 1/4 subsample resolution */
    fraction = 1;

    if ( t0 == t0_min ) /* Limit case */
    {
        fraction = 0;
#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2
        cor_max = interpolation( &pt_cor[t0], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 );
#else
        cor_max = interpolation( &cor[t0 + base_idx], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 );
#endif
    }
    else /* Process negative fractions */
    {
        t0--;
#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2
        cor_max = interpolation( &pt_cor[t0], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 );
#else
        cor_max = interpolation( &cor[t0 + base_idx], E_ROM_inter4_1, fraction, PIT_UP_SAMP, 4 );
#endif
        for ( i = ( fraction + step ); i <= 3; i = i + step )
        {
#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2
            temp = interpolation( &pt_cor[t0], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 );
#else
            temp = interpolation( &cor[t0 + base_idx], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 );
#endif
            if ( temp > cor_max )
            {
                cor_max = temp;
@@ -142,7 +160,11 @@ void pitch_ol2(

    for ( i = 0; i <= 3; i = i + step ) /* Process positive fractions */
    {
#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2
        temp = interpolation( &pt_cor[t1], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 );
#else
        temp = interpolation( &cor[t1 + base_idx], E_ROM_inter4_1, i, PIT_UP_SAMP, 4 );
#endif
        if ( temp > cor_max )
        {
            cor_max = temp;
Loading