Loading lib_com/options.h +4 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,10 @@ #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_1464_UBSAN_RC_CONTEXT_MAP /* FhG: BE UBSAN fix for float issue 1464 in the TCX range coder */ #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 */ /* #################### End BE switches ################################## */ Loading lib_dec/ivas_mct_dec_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -699,7 +699,11 @@ ivas_error mct_dec_reconfigure_fx( move16(); /* MDCT stereo initialization */ #ifdef FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE IF( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) #else IF( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) #endif { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } Loading lib_enc/enc_acelp_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -997,7 +997,14 @@ void E_ACELP_corrmatrix_fx( p3 = &rrixiy[2][pos]; /* Q9 */ p2 = &rrixiy[1][pos]; p1 = &rrixiy[0][pos]; #ifdef FIX_2274_OOB_INDEXING_IN_CORRMATRIX p0 = &rrixiy[3][pos]; /* decrement pointer instead of indexing the array to avoid CLANG Usan complaint */ /* for last loop iteration, this points to rrixiy[3][-1], but is not actually accessed in later loop (k = 15 then, so inner loop will not run) */ p0 -= 16; #else p0 = &rrixiy[3][pos - 16]; #endif cor = L_deposit_h( 0 ); ptr_h1 = h; /*Q12*/ Loading lib_enc/enc_gain_fx.c +51 −6 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ #include <assert.h> #include <stdint.h> #include "options.h" #include "stl.h" #include "cnst.h" #include "rom_com.h" #include "rom_enc.h" Loading Loading @@ -253,7 +254,11 @@ Word16 E_GAIN_closed_loop_search_fx( Word16 exc[], /*Q_new*/ { Word16 corr_v[32 + 2 * L_INTERPOL1 + 1]; Word16 cor_max, max, temp; #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH Word16 corr_idx; #else Word16 *corr; #endif Word16 i, fraction, frac1, frac2, step; Word16 t0, t_min, t_max; Loading @@ -269,27 +274,48 @@ Word16 E_GAIN_closed_loop_search_fx( Word16 exc[], /*Q_new*/ move16(); move16(); #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH corr_idx = negate( t_min ); #else /* allocate memory to normalized correlation vector */ corr = &corr_v[negate( t_min )]; /* corr[t_min..t_max] */ #endif /* Compute normalized correlation between target and filtered excitation */ E_GAIN_norm_corr_fx( exc, xn, h, t_min, t_max, corr_v, L_subfr ); /* find integer pitch */ #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH max = corr_v[add( t0_min, corr_idx )]; /*(Q15+(Q_new+shift-1)+scale)*/ #else max = corr[t0_min]; /*(Q15+(Q_new+shift-1)+scale)*/ #endif move16(); t0 = t0_min; /*Q0*/ move16(); FOR( i = t0_min + 1; i <= t0_max; i++ ) { #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH Word16 corr_tmp; corr_tmp = corr_v[add( corr_idx, i )]; #endif BASOP_SATURATE_WARNING_OFF_EVS; #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH if ( GE_16( corr_tmp, max ) ) #else if ( GE_16( corr[i], max ) ) #endif { t0 = i; move16(); } #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH max = s_max( max, corr_tmp ); #else max = s_max( max, corr[i] ); #endif BASOP_SATURATE_WARNING_ON_EVS; } Loading Loading @@ -354,15 +380,26 @@ Word16 E_GAIN_closed_loop_search_fx( Word16 exc[], /*Q_new*/ } assert( frac1 <= 0 && frac2 >= 0 && frac2 > frac1 ); #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH corr_idx = add( corr_idx, t0 ); #endif IF( EQ_16( pit_res_max, 6 ) ) { #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH cor_max = E_GAIN_norm_corr_interpolate6_fx( &corr_v[corr_idx], frac1 ); /*(Q15+(Q_new+shift-1)+scale)*/ #else cor_max = E_GAIN_norm_corr_interpolate6_fx( &corr[t0], frac1 ); /*(Q15+(Q_new+shift-1)+scale)*/ #endif fraction = frac1; /*Q0*/ move16(); FOR( i = ( frac1 + step ); i <= frac2; i += step ) { #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH temp = E_GAIN_norm_corr_interpolate6_fx( &corr_v[corr_idx], i ); /*(Q15+(Q_new+shift-1)+scale)*/ #else temp = E_GAIN_norm_corr_interpolate6_fx( &corr[t0], i ); /*(Q15+(Q_new+shift-1)+scale)*/ #endif IF( GT_16( temp, cor_max ) ) { cor_max = temp; /*(Q15+(Q_new+shift-1)+scale)*/ Loading @@ -374,13 +411,21 @@ Word16 E_GAIN_closed_loop_search_fx( Word16 exc[], /*Q_new*/ } ELSE { #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH cor_max = E_GAIN_norm_corr_interpolate_fx( &corr_v[corr_idx], frac1 ); /*(Q15+(Q_new+shift-1)+scale)*/ #else cor_max = E_GAIN_norm_corr_interpolate_fx( &corr[t0], frac1 ); /*(Q15+(Q_new+shift-1)+scale)*/ #endif fraction = frac1; /*Q0*/ move16(); FOR( i = ( frac1 + step ); i <= frac2; i += step ) { #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH temp = E_GAIN_norm_corr_interpolate_fx( &corr_v[corr_idx], i ); /*(Q15+(Q_new+shift-1)+scale)*/ #else temp = E_GAIN_norm_corr_interpolate_fx( &corr[t0], i ); /*(Q15+(Q_new+shift-1)+scale)*/ #endif IF( GT_16( temp, cor_max ) ) { cor_max = temp; /*(Q15+(Q_new+shift-1)+scale)*/ Loading lib_enc/tcx_ltp_enc_fx.c +61 −3 Original line number Diff line number Diff line Loading @@ -89,6 +89,9 @@ 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]; Loading Loading @@ -203,7 +206,11 @@ 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(); Loading @@ -219,18 +226,34 @@ 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 ) ) { Loading @@ -241,11 +264,16 @@ static void tcx_ltp_pitch_search( } } i = 0; move16(); #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 ) ) { Loading Loading @@ -293,6 +321,9 @@ 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]; Loading Loading @@ -418,8 +449,12 @@ 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(); Loading @@ -435,18 +470,34 @@ 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 ) ) { Loading @@ -457,9 +508,16 @@ 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 ) ) { Loading Loading
lib_com/options.h +4 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,10 @@ #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_1464_UBSAN_RC_CONTEXT_MAP /* FhG: BE UBSAN fix for float issue 1464 in the TCX range coder */ #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 */ /* #################### End BE switches ################################## */ Loading
lib_dec/ivas_mct_dec_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -699,7 +699,11 @@ ivas_error mct_dec_reconfigure_fx( move16(); /* MDCT stereo initialization */ #ifdef FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE IF( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) #else IF( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) #endif { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } Loading
lib_enc/enc_acelp_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -997,7 +997,14 @@ void E_ACELP_corrmatrix_fx( p3 = &rrixiy[2][pos]; /* Q9 */ p2 = &rrixiy[1][pos]; p1 = &rrixiy[0][pos]; #ifdef FIX_2274_OOB_INDEXING_IN_CORRMATRIX p0 = &rrixiy[3][pos]; /* decrement pointer instead of indexing the array to avoid CLANG Usan complaint */ /* for last loop iteration, this points to rrixiy[3][-1], but is not actually accessed in later loop (k = 15 then, so inner loop will not run) */ p0 -= 16; #else p0 = &rrixiy[3][pos - 16]; #endif cor = L_deposit_h( 0 ); ptr_h1 = h; /*Q12*/ Loading
lib_enc/enc_gain_fx.c +51 −6 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ #include <assert.h> #include <stdint.h> #include "options.h" #include "stl.h" #include "cnst.h" #include "rom_com.h" #include "rom_enc.h" Loading Loading @@ -253,7 +254,11 @@ Word16 E_GAIN_closed_loop_search_fx( Word16 exc[], /*Q_new*/ { Word16 corr_v[32 + 2 * L_INTERPOL1 + 1]; Word16 cor_max, max, temp; #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH Word16 corr_idx; #else Word16 *corr; #endif Word16 i, fraction, frac1, frac2, step; Word16 t0, t_min, t_max; Loading @@ -269,27 +274,48 @@ Word16 E_GAIN_closed_loop_search_fx( Word16 exc[], /*Q_new*/ move16(); move16(); #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH corr_idx = negate( t_min ); #else /* allocate memory to normalized correlation vector */ corr = &corr_v[negate( t_min )]; /* corr[t_min..t_max] */ #endif /* Compute normalized correlation between target and filtered excitation */ E_GAIN_norm_corr_fx( exc, xn, h, t_min, t_max, corr_v, L_subfr ); /* find integer pitch */ #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH max = corr_v[add( t0_min, corr_idx )]; /*(Q15+(Q_new+shift-1)+scale)*/ #else max = corr[t0_min]; /*(Q15+(Q_new+shift-1)+scale)*/ #endif move16(); t0 = t0_min; /*Q0*/ move16(); FOR( i = t0_min + 1; i <= t0_max; i++ ) { #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH Word16 corr_tmp; corr_tmp = corr_v[add( corr_idx, i )]; #endif BASOP_SATURATE_WARNING_OFF_EVS; #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH if ( GE_16( corr_tmp, max ) ) #else if ( GE_16( corr[i], max ) ) #endif { t0 = i; move16(); } #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH max = s_max( max, corr_tmp ); #else max = s_max( max, corr[i] ); #endif BASOP_SATURATE_WARNING_ON_EVS; } Loading Loading @@ -354,15 +380,26 @@ Word16 E_GAIN_closed_loop_search_fx( Word16 exc[], /*Q_new*/ } assert( frac1 <= 0 && frac2 >= 0 && frac2 > frac1 ); #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH corr_idx = add( corr_idx, t0 ); #endif IF( EQ_16( pit_res_max, 6 ) ) { #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH cor_max = E_GAIN_norm_corr_interpolate6_fx( &corr_v[corr_idx], frac1 ); /*(Q15+(Q_new+shift-1)+scale)*/ #else cor_max = E_GAIN_norm_corr_interpolate6_fx( &corr[t0], frac1 ); /*(Q15+(Q_new+shift-1)+scale)*/ #endif fraction = frac1; /*Q0*/ move16(); FOR( i = ( frac1 + step ); i <= frac2; i += step ) { #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH temp = E_GAIN_norm_corr_interpolate6_fx( &corr_v[corr_idx], i ); /*(Q15+(Q_new+shift-1)+scale)*/ #else temp = E_GAIN_norm_corr_interpolate6_fx( &corr[t0], i ); /*(Q15+(Q_new+shift-1)+scale)*/ #endif IF( GT_16( temp, cor_max ) ) { cor_max = temp; /*(Q15+(Q_new+shift-1)+scale)*/ Loading @@ -374,13 +411,21 @@ Word16 E_GAIN_closed_loop_search_fx( Word16 exc[], /*Q_new*/ } ELSE { #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH cor_max = E_GAIN_norm_corr_interpolate_fx( &corr_v[corr_idx], frac1 ); /*(Q15+(Q_new+shift-1)+scale)*/ #else cor_max = E_GAIN_norm_corr_interpolate_fx( &corr[t0], frac1 ); /*(Q15+(Q_new+shift-1)+scale)*/ #endif fraction = frac1; /*Q0*/ move16(); FOR( i = ( frac1 + step ); i <= frac2; i += step ) { #ifdef FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH temp = E_GAIN_norm_corr_interpolate_fx( &corr_v[corr_idx], i ); /*(Q15+(Q_new+shift-1)+scale)*/ #else temp = E_GAIN_norm_corr_interpolate_fx( &corr[t0], i ); /*(Q15+(Q_new+shift-1)+scale)*/ #endif IF( GT_16( temp, cor_max ) ) { cor_max = temp; /*(Q15+(Q_new+shift-1)+scale)*/ Loading
lib_enc/tcx_ltp_enc_fx.c +61 −3 Original line number Diff line number Diff line Loading @@ -89,6 +89,9 @@ 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]; Loading Loading @@ -203,7 +206,11 @@ 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(); Loading @@ -219,18 +226,34 @@ 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 ) ) { Loading @@ -241,11 +264,16 @@ static void tcx_ltp_pitch_search( } } i = 0; move16(); #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 ) ) { Loading Loading @@ -293,6 +321,9 @@ 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]; Loading Loading @@ -418,8 +449,12 @@ 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(); Loading @@ -435,18 +470,34 @@ 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 ) ) { Loading @@ -457,9 +508,16 @@ 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 ) ) { Loading