Commit 6539680b authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_2273_OOB_INDEXING_IN_PIT_FR4

parent c414a1d5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -163,7 +163,6 @@
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#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_1486_INIT_OUTPUT_POINTERS                   /* FhG: always initialize pointers in renderer flush */
#define FIX_2273_OOB_INDEXING_IN_PIT_FR4                /* VA: Fix to silence clang on ptr init */
#define FIX_2249_MEMORY_LEAK_IN_SBA                     /* OR : issue 2249 : Memory leak in SBA to BINAURAL_ROOM_REVERB with memory instrumentation */
#define FIX_1483_PEAQ_VQ_ENC_MSAN_ERROR                 /* Eri: When no PVQ bands are selected in peaq_vq_enc, the number of bands is not initialized. */
#define FIX_1480_CLANG18_MSAN_UNINIT_VARIABLE           /* Eri: Initializes a variable in HQ decoder. It is not used, but is passed uninitialized to a function which is caught by clang-18 */
+0 −42
Original line number Diff line number Diff line
@@ -443,9 +443,7 @@ 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 )
@@ -486,45 +484,25 @@ 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 )
@@ -537,11 +515,7 @@ 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;
            }
@@ -580,27 +554,15 @@ 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;
@@ -611,11 +573,7 @@ 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;