Commit 5b149758 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH

parent 5bf157cf
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -85,7 +85,6 @@
#define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK       /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/
#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_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH         /* FhG: fix OOB index USAN error in TCX LTP pitch search */
#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 */
+0 −53
Original line number Diff line number Diff line
@@ -89,9 +89,7 @@ static void tcx_ltp_pitch_search(
    Word16 pitres )
{
    Word16 i, t, t0, t1, step, fraction, t0_min, t0_max, t_min, t_max, delta, temp_m, temp_e, s, s_wsp;
#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
    Word16 cor_idx_ini, cor_idx;
#endif
    Word32 cor_max, cor[256], *pt_cor, temp;
    Word16 wsp2[L_FRAME_PLUS + PIT_MAX_MAX + L_INTERPOL1];

@@ -206,11 +204,7 @@ static void tcx_ltp_pitch_search(
     * the interpolated normalized correlation.
     *-----------------------------------------------------------------*/

#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
    cor_idx_ini = sub( L_INTERPOL1, t0_min );
#else
    pt_cor = cor + sub( L_INTERPOL1, t0_min );
#endif
    t0 = t1;
    move16();

@@ -226,34 +220,20 @@ static void tcx_ltp_pitch_search(

    IF( EQ_16( t0, t0_min ) ) /* Limit case */
    {
#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
        cor_idx = add( cor_idx_ini, t0 );
#endif
        fraction = 0;
        move16();
#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
        cor_max = interpolate_corr( &cor[cor_idx], fraction, pitres );
#else
        cor_max = interpolate_corr( &pt_cor[t0], fraction, pitres );
#endif
    }
    ELSE /* Process negative fractions */
    {
        t0 = sub( t0, 1 );
#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
        cor_idx = add( cor_idx_ini, t0 );
        cor_max = interpolate_corr( &cor[cor_idx], fraction, pitres );
#else
        cor_max = interpolate_corr( &pt_cor[t0], fraction, pitres );
#endif

        FOR( i = fraction + step; i < pitres; i += step )
        {
#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
            temp = interpolate_corr( &cor[cor_idx], i, pitres );
#else
            temp = interpolate_corr( &pt_cor[t0], i, pitres );
#endif

            IF( GT_32( temp, cor_max ) )
            {
@@ -264,16 +244,10 @@ static void tcx_ltp_pitch_search(
        }
    }

#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
    cor_idx = add( cor_idx_ini, t1 );
#endif
    FOR( i = 0; i < pitres; i += step ) /* Process positive fractions */
    {
#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
        temp = interpolate_corr( &cor[cor_idx], i, pitres );
#else
        temp = interpolate_corr( &pt_cor[t1], i, pitres );
#endif

        IF( GT_32( temp, cor_max ) )
        {
@@ -321,9 +295,7 @@ static void tcx_ltp_pitch_search_ivas_fx(
    Word16 *border_case )
{
    Word16 i, t, t0, t1, step, fraction, t0_min, t0_max, t_min, t_max, delta, temp_m, temp_e, s, s_wsp;
#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
    Word16 cor_idx_ini, cor_idx;
#endif
    Word32 cor_max, cor[256], *pt_cor, temp;
    Word16 wsp2[L_FRAME_PLUS + PIT_MAX_MAX + L_INTERPOL1];

@@ -449,12 +421,7 @@ static void tcx_ltp_pitch_search_ivas_fx(
     * search the fractions around t0 and choose the one which maximizes
     * the interpolated normalized correlation.
     *-----------------------------------------------------------------*/
#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
    cor_idx_ini = sub( L_INTERPOL1, t0_min );
#else

    pt_cor = cor + sub( L_INTERPOL1, t0_min );
#endif
    t0 = t1;
    move16();

@@ -470,34 +437,20 @@ static void tcx_ltp_pitch_search_ivas_fx(

    IF( EQ_16( t0, t0_min ) ) /* Limit case */
    {
#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
        cor_idx = add( cor_idx_ini, t0 );
#endif
        fraction = 0;
        move16();
#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
        cor_max = interpolate_corr( &cor[cor_idx], fraction, pitres );
#else
        cor_max = interpolate_corr( &pt_cor[t0], fraction, pitres );
#endif
    }
    ELSE /* Process negative fractions */
    {
        t0 = sub( t0, 1 );
#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
        cor_idx = add( cor_idx_ini, t0 );
        cor_max = interpolate_corr( &cor[cor_idx], fraction, pitres );
#else
        cor_max = interpolate_corr( &pt_cor[t0], fraction, pitres );
#endif

        FOR( i = fraction + step; i < pitres; i += step )
        {
#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
            temp = interpolate_corr( &cor[cor_idx], i, pitres );
#else
            temp = interpolate_corr( &pt_cor[t0], i, pitres );
#endif

            IF( GT_32( temp, cor_max ) )
            {
@@ -508,16 +461,10 @@ static void tcx_ltp_pitch_search_ivas_fx(
        }
    }

#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
    cor_idx = add( cor_idx_ini, t1 );
#endif
    FOR( i = 0; i < pitres; i += step ) /* Process positive fractions */
    {
#ifdef FIX_2272_OOB_INDEXING_IN_LTP_PIT_SEARCH
        temp = interpolate_corr( &cor[cor_idx], i, pitres );
#else
        temp = interpolate_corr( &pt_cor[t1], i, pitres );
#endif

        IF( GT_32( temp, cor_max ) )
        {