Commit a7a09591 authored by vaillancour's avatar vaillancour
Browse files

Fix for 2271 to silence clang18

parent d3508f9d
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@
#define FIX_2252_SCALING_SAVE_HB_SYNTH                  /* VA: issue 2252: fix use-of-uninit-value in save_hb_synth_fx[] scaling in FOA decoding with bitstream that starts with an SID */
#define FIX_2248_EVS_ASSERT                             /* VA: Include _sat in an EVS related part of the code */
#define FIX_2254_IMPROV_COMPLEXITY_BE                   /* VA: BE small complexity reduction  */

#define FIX_2271_OOB_INDEXING_IN_PIT_OL2
/* #################### End BE switches ################################## */

/* #################### Start NON-BE switches ############################ */
+24 −2
Original line number Diff line number Diff line
@@ -50,7 +50,9 @@ void pitch_ol2_fx(
    Word32 R1, R2;
    Word16 R0, exp_R0, exp_R1, exp_R2, j;
    Word16 pit_max;

#ifdef FIX_2271_OOB_INDEXING_IN_PIT_OL2
    Word16 base_idx;
#endif
    /* initialization */
    pit_max = PIT_MAX;
    move16();
@@ -104,9 +106,14 @@ void pitch_ol2_fx(
     * search the fractions around t0 and choose the one which maximizes
     * the interpolated normalized correlation.
     *----------------------------------------------------------------*/
#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2
    pt_cor_fx = cor_fx + sub( L_INTERPOL1, t0_min );
#endif
    t0s = t1s;
    move16();
#ifdef FIX_2271_OOB_INDEXING_IN_PIT_OL2
    base_idx = sub( L_INTERPOL1, t0_min );
#endif

    step = 1;
    move16(); /* 1/4 subsample resolution */
@@ -116,10 +123,18 @@ void pitch_ol2_fx(
    IF( NE_16( t0s, t0_min ) ) /* Process negative fractions */
    {
        t0s = sub( t0s, 1 );
#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2
        cor_max_fx = Interpol_4( &pt_cor_fx[t0s], fraction );
#else
        cor_max_fx = Interpol_4( &cor_fx[t0s + base_idx], fraction );
#endif
        FOR( i = fraction + step; i <= 3; i += step )
        {
#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2
            temp_fx = Interpol_4( &pt_cor_fx[t0s], i );
#else
            temp_fx = Interpol_4( &cor_fx[t0s + base_idx], i );
#endif
            if ( GT_16( temp_fx, cor_max_fx ) )
            {
                fraction = i;
@@ -132,13 +147,20 @@ void pitch_ol2_fx(
    {
        fraction = 0;
        move16();
#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2
        cor_max_fx = Interpol_4( &pt_cor_fx[t0s], fraction );
#else
        cor_max_fx = Interpol_4( &cor_fx[t0s + base_idx], fraction );
#endif
        move16();
    }
    FOR( i = 0; i <= 3; i += step ) /* Process positive fractions */
    {
#ifndef FIX_2271_OOB_INDEXING_IN_PIT_OL2
        temp_fx = Interpol_4( &pt_cor_fx[t1s], i );

#else
        temp_fx = Interpol_4( &cor_fx[t1s + base_idx], i );
#endif
        IF( GT_16( temp_fx, cor_max_fx ) )
        {
            cor_max_fx = temp_fx;