Loading lib_dec/FEC_HQ_core_fx.c +25 −13 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ static void Regression_Anal_fx( Word32 L_tmp1, L_tmp2; Word16 aindex_fx[MAX_PGF + 1]; // Q0 Word32 b_p_fx[MAX_PGF + 1]; // Q10 #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading Loading @@ -80,8 +80,8 @@ static void Regression_Anal_fx( { b_p_fx[0] = L_add( b_p_fx[0], L_shr( values_fx[i], 2 ) ); /*10 */ move32(); #ifdef ISSUE_1796_replace_shl_o b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl_sat( sub( num_pgf, i ), 13 ) ) ); /*10 */ #ifdef ISSUE_1866_replace_overflow_libdec b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl_sat( sub( num_pgf, i ), 13 ) ) ); /*10 */ //??sat #else b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl_o( sub( num_pgf, i ), 13, &Overflow ) ) ); /*10 */ #endif Loading Loading @@ -168,7 +168,7 @@ void HQ_FEC_processing_fx( Word16 energy_diff_fx; // Q10 HQ_NBFEC_HANDLE hHQ_nbfec; HQ_DEC_HANDLE hHQ_core; #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading Loading @@ -390,8 +390,8 @@ void HQ_FEC_processing_fx( FOR( j = 0; j < Num_bands_p[i]; j++ ) { #ifdef ISSUE_1796_replace_shl_o hHQ_nbfec->Norm_gain_fx[k] = shl_sat( tmp_fx, 1 ); #ifdef ISSUE_1866_replace_overflow_libdec hHQ_nbfec->Norm_gain_fx[k] = shl_sat( tmp_fx, 1 ); //??sat #else hHQ_nbfec->Norm_gain_fx[k] = shl_o( tmp_fx, 1, &Overflow ); #endif Loading Loading @@ -449,9 +449,11 @@ void ivas_HQ_FEC_Mem_update_fx( HQ_DEC_HANDLE hHQ_core; hHQ_nbfec = st_fx->hHQ_nbfec; hHQ_core = st_fx->hHQ_core; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif move32(); // for tmp_energy_fx IF( EQ_16( output_frame, L_FRAME8k ) ) Loading Loading @@ -530,8 +532,8 @@ void ivas_HQ_FEC_Mem_update_fx( L_tmp = L_add( L_tmp, L_shr( normq_fx[k], 3 ) ); /*11*/ k = add( k, 1 ); } #ifdef ISSUE_1796_replace_shl_o tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ #ifdef ISSUE_1866_replace_overflow_libdec tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ //??sat #else tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/ #endif Loading Loading @@ -654,7 +656,11 @@ void ivas_HQ_FEC_Mem_update_fx( exp2 = norm_l( hHQ_nbfec->ynrm_values_fx[i][0] ); tmp_fx = div_s( extract_h( L_shl( en_high_fx[i], exp1 ) ), extract_h( L_shl( hHQ_nbfec->ynrm_values_fx[i][0], exp2 ) ) ); exp = add( 15, sub( exp1, exp2 ) ); #ifdef ISSUE_1866_replace_overflow_libdec *mean_en_high_fx = add_sat( *mean_en_high_fx, shr_sat( tmp_fx, sub( exp, 5 ) ) ); //??sat #else *mean_en_high_fx = add_o( *mean_en_high_fx, shr_sat( tmp_fx, sub( exp, 5 ) ), &Overflow ); #endif move16(); } *mean_en_high_fx = mult( *mean_en_high_fx, inv_tbl_fx[sub( num_Sb, k )] ); Loading Loading @@ -736,9 +742,11 @@ void HQ_FEC_Mem_update_fx( HQ_DEC_HANDLE hHQ_core; hHQ_nbfec = st_fx->hHQ_nbfec; hHQ_core = st_fx->hHQ_core; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif move32(); // tmp_energy_fx Loading Loading @@ -819,8 +827,8 @@ void HQ_FEC_Mem_update_fx( L_tmp = L_add( L_tmp, L_shr( normq_fx[k], 3 ) ); /*11*/ k = add( k, 1 ); } #ifdef ISSUE_1796_replace_shl_o tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ #ifdef ISSUE_1866_replace_overflow_libdec tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ //??sat #else tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/ #endif Loading Loading @@ -944,7 +952,11 @@ void HQ_FEC_Mem_update_fx( exp2 = norm_l( hHQ_nbfec->ynrm_values_fx[i][0] ); tmp_fx = div_s( extract_h( L_shl( en_high_fx[i], exp1 ) ), extract_h( L_shl( hHQ_nbfec->ynrm_values_fx[i][0], exp2 ) ) ); exp = add( 15, sub( exp1, exp2 ) ); #ifdef ISSUE_1866_replace_overflow_libdec *mean_en_high_fx = add_sat( *mean_en_high_fx, shr_sat( tmp_fx, sub( exp, 5 ) ) ); //??sat #else *mean_en_high_fx = add_o( *mean_en_high_fx, shr_sat( tmp_fx, sub( exp, 5 ) ), &Overflow ); #edif move16(); } *mean_en_high_fx = mult( *mean_en_high_fx, inv_tbl_fx[sub( num_Sb, k )] ); Loading Loading @@ -1015,7 +1027,7 @@ static Word16 find_best_delay_fx( Word32 min_sq_cross_fx, min_corr_fx; Word32 accA_fx, accB_fx; Word32 Rxy_fx[MAXDELAY_FEC], Ryy_fx[MAXDELAY_FEC]; #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading Loading @@ -1086,8 +1098,8 @@ static Word16 find_best_delay_fx( L_tmp1 = L_shl( min_sq_cross_fx, exp1 ); L_tmp2 = L_shl( min_corr_fx, exp2 ); tmp = div_s( extract_h( L_tmp1 ), extract_h( L_tmp2 ) ); /*15 + exp1 - exp2 */ #ifdef ISSUE_1796_replace_shl_o tmp = shl_sat( tmp, sub( exp2, add( exp1, 1 ) ) ); /*14 */ #ifdef ISSUE_1866_replace_overflow_libdec tmp = shl_sat( tmp, sub( exp2, add( exp1, 1 ) ) ); /*14 */ //??sat #else tmp = shl_o( tmp, sub( exp2, add( exp1, 1 ) ), &Overflow ); /*14 */ #endif Loading lib_dec/FEC_HQ_phase_ecu_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -2916,13 +2916,20 @@ static Word32 mult_32_32_q( const Word32 a, const Word32 b, const Word16 q ) { Word32 hi; UWord32 lo; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif Mpy_32_32_ss( a, b, &hi, &lo ); return L_or( L_shl_o( hi, sub( 32 - 1, q ), &Overflow ), L_lshr( (Word32) lo, add( q, 1 ) ) ); #else Mpy_32_32_ss( a, b, &hi, &lo ); return L_or( L_shl_sat( hi, sub( 32 - 1, q ) ), L_lshr( (Word32) lo, add( q, 1 ) ) ); //??sat #endif } static void fir_dwn_fx( Loading lib_dec/LD_music_post_filter_fx.c +19 −6 Original line number Diff line number Diff line Loading @@ -69,8 +69,10 @@ void LD_music_post_filter_fx( Word16 mant, exp1, s_ave, tmp16, old_tmp16; Word16 diff_sc; Word16 old_tmp16_1; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif move16(); move16(); Loading Loading @@ -186,7 +188,11 @@ void LD_music_post_filter_fx( FOR( k = j; k < mfreq_bindiv_LD[i] + j; k++ ) { /*m_ave += lf_E[k];*/ #ifdef ISSUE_1866_replace_overflow_libdec Ltmp = L_add_sat( lf_E[k], Ltmp ); /*2*Qdct+10*/ //??sat #else Ltmp = L_add_o( lf_E[k], Ltmp, &Overflow ); /*2*Qdct+10*/ #endif max_val = L_max( max_val, lf_E[k] ); } Ltmp_max = L_max( Ltmp_max, max_val ); /*2*Qdct+10*/ Loading Loading @@ -442,8 +448,10 @@ static void spectrum_mod_dct_fx( Word32 Lshift; Word32 dot5_scaled; const Word32 *Lpt2; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif move16(); Loading Loading @@ -523,7 +531,11 @@ static void spectrum_mod_dct_fx( IF( music_flag != 0 ) /* prevent subtraction on clean speech */ { #ifdef ISSUE_1866_replace_overflow_libdec IF( LE_32( maxNoise, L_shl_sat( 10, scaling ) ) ) //??sat #else IF( LE_32( maxNoise, L_shl_o( 10, scaling, &Overflow ) ) ) #endif { minE = 18432 / 2; /*Q14*/ move16(); Loading Loading @@ -599,12 +611,13 @@ static void spectrum_mod_dct_fx( Ltmp = L_mult( tmpN, m_binE ); /*2*Qdct+e_binE+9*/ e_binE = sub( add( e_tmp, e_binE ), 15 ); #ifdef ISSUE_1799_replace_L_shr_o Ltmp = L_shr_sat( Ltmp, e_binE ); /*2*Qdct+9*/ #ifdef ISSUE_1866_replace_overflow_libdec Ltmp = L_shr_sat( Ltmp, e_binE ); /*2*Qdct+9*/ //??sat Lgain = L_add_sat( Ltmp, Lshift ); /*Saturation can occure here result in Q30*/ //??sat #else Ltmp = L_shr_o( Ltmp, e_binE, &Overflow ); /*2*Qdct+9*/ #endif Lgain = L_add_o( Ltmp, Lshift, &Overflow ); /*Saturation can occure here result in Q30*/ #endif } Lpt2++; Loading Loading @@ -905,7 +918,7 @@ static Word16 norm_lfe( { Word32 Ltmp; Word16 exp2, tmp16, exp3; #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif Loading @@ -929,8 +942,8 @@ static Word16 norm_lfe( exp3 = sub( exp2, 12 + 16 - 3 ); /* if exp2 < 31, means that tmp >= 1.0 */ /* Need to shl by 3 to take into account the 3 multiplications */ } #ifdef ISSUE_1796_replace_shl_o tmp16 = shl_sat( tmp16, exp3 ); /* Result in Q12 */ #ifdef ISSUE_1866_replace_overflow_libdec tmp16 = shl_sat( tmp16, exp3 ); /* Result in Q12 */ //??sat #else tmp16 = shl_o( tmp16, exp3, &Overflow ); /* Result in Q12 */ #endif Loading lib_dec/gain_dec_fx.c +6 −0 Original line number Diff line number Diff line Loading @@ -1409,10 +1409,12 @@ void gain_dec_amr_wb_fx( Word16 tmp; Word32 L_tmp; Word16 expg, exp_gcode0, fracg; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /**gain_inov = 1.0f/ (float)sqrt( ( dotp( code, code, L_SUBFR ) + 0.01f ) / L_SUBFR );*/ Loading Loading @@ -1496,7 +1498,11 @@ void gain_dec_amr_wb_fx( /* adjust gain according to energy of code */ L_tmp = Mult_32_16( *gain_code, *gain_inov ); #ifdef ISSUE_1866_replace_overflow_libdec *gain_code = L_shl_sat( L_tmp, 3 ); /* gcode_inov in Q12*/ //??sat #else *gain_code = L_shl_o( L_tmp, 3, &Overflow ); /* gcode_inov in Q12*/ #endif move32(); /*-----------------------------------------------------------------* Loading lib_dec/hf_synth_fx.c +30 −2 Original line number Diff line number Diff line Loading @@ -136,9 +136,11 @@ static void hf_synthesis_fx( Word16 tmp, ener, exp1, exp2, scale; Word32 L_tmp; Word16 Ap[M16k + 1]; #ifdef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /*-----------------------------------------------------------------* Loading Loading @@ -217,15 +219,22 @@ static void hf_synthesis_fx( /*-----------------------------------------------------------------* * modify energy of white noise according to synthesis tilt *-----------------------------------------------------------------*/ /* tmp = 1.0 - fac */ #ifdef ISSUE_1866_replace_overflow_libdec tmp = add_sat( 1, sub( 32767 /* 1 in Q15 */, tmp ) ); //??sat #else tmp = add_o( 1, sub( 32767 /* 1 in Q15 */, tmp ), &Overflow ); #endif test(); if ( core_brate == FRAME_NO_DATA || EQ_32( core_brate, SID_2k40 ) ) { /* emphasize HF noise in CNG */ /*fac *= 2.0f;*/ #ifdef ISSUE_1866_replace_overflow_libdec tmp = add_sat( tmp, tmp ); /* Q15 */ //??sat #else tmp = add_o( tmp, tmp, &Overflow ); /* Q15 */ #endif } tmp = s_max( tmp, 3277 ); /* 0.1 in Q15 */ Loading Loading @@ -523,9 +532,11 @@ static void filt_6k_7k_scale_fx( { Word16 i, x[L_FRAME48k / NB_SUBFR + ( L_FIR - 1 )]; Word32 L_tmp; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif Copy_Scale_sig( mem, x, L_FIR - 1, exp ); Loading @@ -542,10 +553,18 @@ static void filt_6k_7k_scale_fx( move32(); FOR( j = 0; j < 31; j++ ) { #ifdef ISSUE_1866_replace_overflow_libdec L_tmp = L_mac_sat( L_tmp, x[i + j], fir_6k_7k_fx[j] ); /* Q16 */ //??sat #else L_tmp = L_mac_o( L_tmp, x[i + j], fir_6k_7k_fx[j], &Overflow ); /* Q16 */ #endif } #ifdef ISSUE_1866_replace_overflow_libdec signal[i] = round_fx_sat( L_tmp ); /* Q0 */ //??sat #else signal[i] = round_fx_o( L_tmp, &Overflow ); /* Q0 */ #endif move16(); } Copy( x + lg, mem, L_FIR - 1 ); /* Qx - 2 */ Loading Loading @@ -1385,8 +1404,9 @@ static Word16 EnhanceClass_fx( Word16 unvoicing_tmp_fx; Word16 tmp, tmp1; Word32 L_tmp; #ifndef ISSUE_1866_replace_overflow_libdec Flag Overflow; #endif /* Decide (*unvoicing_flag) to allow BWE enhancement when qq>pp */ /**voice_fac_fx = add(mult_r(*voice_fac_fx, 24576), mult_r(voice_factor_fx, 8192)); //Q15 */ Loading Loading @@ -1423,13 +1443,21 @@ static Word16 EnhanceClass_fx( move16(); } #ifdef ISSUE_1866_replace_overflow_libdec if ( GT_16( sub_sat( *unvoicing_fx, *unvoicing_sm_fx ), 3277 /* 0.1 in Q15 */ ) ) //??sat #else if ( GT_16( sub_o( *unvoicing_fx, *unvoicing_sm_fx, &Overflow ), 3277 /* 0.1 in Q15 */ ) ) #endif { *unvoicing_flag = 1; move16(); } #ifdef ISSUE_1866_replace_overflow_libdec if ( LT_16( sub_sat( *unvoicing_fx, *unvoicing_sm_fx ), 1638 /* 0.05 in Q15 */ ) ) //??sat #else if ( LT_16( sub_o( *unvoicing_fx, *unvoicing_sm_fx, &Overflow ), 1638 /* 0.05 in Q15 */ ) ) #endif { *unvoicing_flag = 0; move16(); Loading Loading
lib_dec/FEC_HQ_core_fx.c +25 −13 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ static void Regression_Anal_fx( Word32 L_tmp1, L_tmp2; Word16 aindex_fx[MAX_PGF + 1]; // Q0 Word32 b_p_fx[MAX_PGF + 1]; // Q10 #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading Loading @@ -80,8 +80,8 @@ static void Regression_Anal_fx( { b_p_fx[0] = L_add( b_p_fx[0], L_shr( values_fx[i], 2 ) ); /*10 */ move32(); #ifdef ISSUE_1796_replace_shl_o b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl_sat( sub( num_pgf, i ), 13 ) ) ); /*10 */ #ifdef ISSUE_1866_replace_overflow_libdec b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl_sat( sub( num_pgf, i ), 13 ) ) ); /*10 */ //??sat #else b_p_fx[1] = L_add( b_p_fx[1], Mult_32_16( values_fx[i], shl_o( sub( num_pgf, i ), 13, &Overflow ) ) ); /*10 */ #endif Loading Loading @@ -168,7 +168,7 @@ void HQ_FEC_processing_fx( Word16 energy_diff_fx; // Q10 HQ_NBFEC_HANDLE hHQ_nbfec; HQ_DEC_HANDLE hHQ_core; #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading Loading @@ -390,8 +390,8 @@ void HQ_FEC_processing_fx( FOR( j = 0; j < Num_bands_p[i]; j++ ) { #ifdef ISSUE_1796_replace_shl_o hHQ_nbfec->Norm_gain_fx[k] = shl_sat( tmp_fx, 1 ); #ifdef ISSUE_1866_replace_overflow_libdec hHQ_nbfec->Norm_gain_fx[k] = shl_sat( tmp_fx, 1 ); //??sat #else hHQ_nbfec->Norm_gain_fx[k] = shl_o( tmp_fx, 1, &Overflow ); #endif Loading Loading @@ -449,9 +449,11 @@ void ivas_HQ_FEC_Mem_update_fx( HQ_DEC_HANDLE hHQ_core; hHQ_nbfec = st_fx->hHQ_nbfec; hHQ_core = st_fx->hHQ_core; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif move32(); // for tmp_energy_fx IF( EQ_16( output_frame, L_FRAME8k ) ) Loading Loading @@ -530,8 +532,8 @@ void ivas_HQ_FEC_Mem_update_fx( L_tmp = L_add( L_tmp, L_shr( normq_fx[k], 3 ) ); /*11*/ k = add( k, 1 ); } #ifdef ISSUE_1796_replace_shl_o tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ #ifdef ISSUE_1866_replace_overflow_libdec tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ //??sat #else tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/ #endif Loading Loading @@ -654,7 +656,11 @@ void ivas_HQ_FEC_Mem_update_fx( exp2 = norm_l( hHQ_nbfec->ynrm_values_fx[i][0] ); tmp_fx = div_s( extract_h( L_shl( en_high_fx[i], exp1 ) ), extract_h( L_shl( hHQ_nbfec->ynrm_values_fx[i][0], exp2 ) ) ); exp = add( 15, sub( exp1, exp2 ) ); #ifdef ISSUE_1866_replace_overflow_libdec *mean_en_high_fx = add_sat( *mean_en_high_fx, shr_sat( tmp_fx, sub( exp, 5 ) ) ); //??sat #else *mean_en_high_fx = add_o( *mean_en_high_fx, shr_sat( tmp_fx, sub( exp, 5 ) ), &Overflow ); #endif move16(); } *mean_en_high_fx = mult( *mean_en_high_fx, inv_tbl_fx[sub( num_Sb, k )] ); Loading Loading @@ -736,9 +742,11 @@ void HQ_FEC_Mem_update_fx( HQ_DEC_HANDLE hHQ_core; hHQ_nbfec = st_fx->hHQ_nbfec; hHQ_core = st_fx->hHQ_core; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif move32(); // tmp_energy_fx Loading Loading @@ -819,8 +827,8 @@ void HQ_FEC_Mem_update_fx( L_tmp = L_add( L_tmp, L_shr( normq_fx[k], 3 ) ); /*11*/ k = add( k, 1 ); } #ifdef ISSUE_1796_replace_shl_o tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ #ifdef ISSUE_1866_replace_overflow_libdec tmp_fx = shl_sat( inv_tbl_fx[Num_bands_p[i]], 1 ); /*16*/ //??sat #else tmp_fx = shl_o( inv_tbl_fx[Num_bands_p[i]], 1, &Overflow ); /*16*/ #endif Loading Loading @@ -944,7 +952,11 @@ void HQ_FEC_Mem_update_fx( exp2 = norm_l( hHQ_nbfec->ynrm_values_fx[i][0] ); tmp_fx = div_s( extract_h( L_shl( en_high_fx[i], exp1 ) ), extract_h( L_shl( hHQ_nbfec->ynrm_values_fx[i][0], exp2 ) ) ); exp = add( 15, sub( exp1, exp2 ) ); #ifdef ISSUE_1866_replace_overflow_libdec *mean_en_high_fx = add_sat( *mean_en_high_fx, shr_sat( tmp_fx, sub( exp, 5 ) ) ); //??sat #else *mean_en_high_fx = add_o( *mean_en_high_fx, shr_sat( tmp_fx, sub( exp, 5 ) ), &Overflow ); #edif move16(); } *mean_en_high_fx = mult( *mean_en_high_fx, inv_tbl_fx[sub( num_Sb, k )] ); Loading Loading @@ -1015,7 +1027,7 @@ static Word16 find_best_delay_fx( Word32 min_sq_cross_fx, min_corr_fx; Word32 accA_fx, accB_fx; Word32 Rxy_fx[MAXDELAY_FEC], Ryy_fx[MAXDELAY_FEC]; #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading Loading @@ -1086,8 +1098,8 @@ static Word16 find_best_delay_fx( L_tmp1 = L_shl( min_sq_cross_fx, exp1 ); L_tmp2 = L_shl( min_corr_fx, exp2 ); tmp = div_s( extract_h( L_tmp1 ), extract_h( L_tmp2 ) ); /*15 + exp1 - exp2 */ #ifdef ISSUE_1796_replace_shl_o tmp = shl_sat( tmp, sub( exp2, add( exp1, 1 ) ) ); /*14 */ #ifdef ISSUE_1866_replace_overflow_libdec tmp = shl_sat( tmp, sub( exp2, add( exp1, 1 ) ) ); /*14 */ //??sat #else tmp = shl_o( tmp, sub( exp2, add( exp1, 1 ) ), &Overflow ); /*14 */ #endif Loading
lib_dec/FEC_HQ_phase_ecu_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -2916,13 +2916,20 @@ static Word32 mult_32_32_q( const Word32 a, const Word32 b, const Word16 q ) { Word32 hi; UWord32 lo; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif Mpy_32_32_ss( a, b, &hi, &lo ); return L_or( L_shl_o( hi, sub( 32 - 1, q ), &Overflow ), L_lshr( (Word32) lo, add( q, 1 ) ) ); #else Mpy_32_32_ss( a, b, &hi, &lo ); return L_or( L_shl_sat( hi, sub( 32 - 1, q ) ), L_lshr( (Word32) lo, add( q, 1 ) ) ); //??sat #endif } static void fir_dwn_fx( Loading
lib_dec/LD_music_post_filter_fx.c +19 −6 Original line number Diff line number Diff line Loading @@ -69,8 +69,10 @@ void LD_music_post_filter_fx( Word16 mant, exp1, s_ave, tmp16, old_tmp16; Word16 diff_sc; Word16 old_tmp16_1; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif move16(); move16(); Loading Loading @@ -186,7 +188,11 @@ void LD_music_post_filter_fx( FOR( k = j; k < mfreq_bindiv_LD[i] + j; k++ ) { /*m_ave += lf_E[k];*/ #ifdef ISSUE_1866_replace_overflow_libdec Ltmp = L_add_sat( lf_E[k], Ltmp ); /*2*Qdct+10*/ //??sat #else Ltmp = L_add_o( lf_E[k], Ltmp, &Overflow ); /*2*Qdct+10*/ #endif max_val = L_max( max_val, lf_E[k] ); } Ltmp_max = L_max( Ltmp_max, max_val ); /*2*Qdct+10*/ Loading Loading @@ -442,8 +448,10 @@ static void spectrum_mod_dct_fx( Word32 Lshift; Word32 dot5_scaled; const Word32 *Lpt2; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif move16(); Loading Loading @@ -523,7 +531,11 @@ static void spectrum_mod_dct_fx( IF( music_flag != 0 ) /* prevent subtraction on clean speech */ { #ifdef ISSUE_1866_replace_overflow_libdec IF( LE_32( maxNoise, L_shl_sat( 10, scaling ) ) ) //??sat #else IF( LE_32( maxNoise, L_shl_o( 10, scaling, &Overflow ) ) ) #endif { minE = 18432 / 2; /*Q14*/ move16(); Loading Loading @@ -599,12 +611,13 @@ static void spectrum_mod_dct_fx( Ltmp = L_mult( tmpN, m_binE ); /*2*Qdct+e_binE+9*/ e_binE = sub( add( e_tmp, e_binE ), 15 ); #ifdef ISSUE_1799_replace_L_shr_o Ltmp = L_shr_sat( Ltmp, e_binE ); /*2*Qdct+9*/ #ifdef ISSUE_1866_replace_overflow_libdec Ltmp = L_shr_sat( Ltmp, e_binE ); /*2*Qdct+9*/ //??sat Lgain = L_add_sat( Ltmp, Lshift ); /*Saturation can occure here result in Q30*/ //??sat #else Ltmp = L_shr_o( Ltmp, e_binE, &Overflow ); /*2*Qdct+9*/ #endif Lgain = L_add_o( Ltmp, Lshift, &Overflow ); /*Saturation can occure here result in Q30*/ #endif } Lpt2++; Loading Loading @@ -905,7 +918,7 @@ static Word16 norm_lfe( { Word32 Ltmp; Word16 exp2, tmp16, exp3; #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif Loading @@ -929,8 +942,8 @@ static Word16 norm_lfe( exp3 = sub( exp2, 12 + 16 - 3 ); /* if exp2 < 31, means that tmp >= 1.0 */ /* Need to shl by 3 to take into account the 3 multiplications */ } #ifdef ISSUE_1796_replace_shl_o tmp16 = shl_sat( tmp16, exp3 ); /* Result in Q12 */ #ifdef ISSUE_1866_replace_overflow_libdec tmp16 = shl_sat( tmp16, exp3 ); /* Result in Q12 */ //??sat #else tmp16 = shl_o( tmp16, exp3, &Overflow ); /* Result in Q12 */ #endif Loading
lib_dec/gain_dec_fx.c +6 −0 Original line number Diff line number Diff line Loading @@ -1409,10 +1409,12 @@ void gain_dec_amr_wb_fx( Word16 tmp; Word32 L_tmp; Word16 expg, exp_gcode0, fracg; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /**gain_inov = 1.0f/ (float)sqrt( ( dotp( code, code, L_SUBFR ) + 0.01f ) / L_SUBFR );*/ Loading Loading @@ -1496,7 +1498,11 @@ void gain_dec_amr_wb_fx( /* adjust gain according to energy of code */ L_tmp = Mult_32_16( *gain_code, *gain_inov ); #ifdef ISSUE_1866_replace_overflow_libdec *gain_code = L_shl_sat( L_tmp, 3 ); /* gcode_inov in Q12*/ //??sat #else *gain_code = L_shl_o( L_tmp, 3, &Overflow ); /* gcode_inov in Q12*/ #endif move32(); /*-----------------------------------------------------------------* Loading
lib_dec/hf_synth_fx.c +30 −2 Original line number Diff line number Diff line Loading @@ -136,9 +136,11 @@ static void hf_synthesis_fx( Word16 tmp, ener, exp1, exp2, scale; Word32 L_tmp; Word16 Ap[M16k + 1]; #ifdef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /*-----------------------------------------------------------------* Loading Loading @@ -217,15 +219,22 @@ static void hf_synthesis_fx( /*-----------------------------------------------------------------* * modify energy of white noise according to synthesis tilt *-----------------------------------------------------------------*/ /* tmp = 1.0 - fac */ #ifdef ISSUE_1866_replace_overflow_libdec tmp = add_sat( 1, sub( 32767 /* 1 in Q15 */, tmp ) ); //??sat #else tmp = add_o( 1, sub( 32767 /* 1 in Q15 */, tmp ), &Overflow ); #endif test(); if ( core_brate == FRAME_NO_DATA || EQ_32( core_brate, SID_2k40 ) ) { /* emphasize HF noise in CNG */ /*fac *= 2.0f;*/ #ifdef ISSUE_1866_replace_overflow_libdec tmp = add_sat( tmp, tmp ); /* Q15 */ //??sat #else tmp = add_o( tmp, tmp, &Overflow ); /* Q15 */ #endif } tmp = s_max( tmp, 3277 ); /* 0.1 in Q15 */ Loading Loading @@ -523,9 +532,11 @@ static void filt_6k_7k_scale_fx( { Word16 i, x[L_FRAME48k / NB_SUBFR + ( L_FIR - 1 )]; Word32 L_tmp; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif Copy_Scale_sig( mem, x, L_FIR - 1, exp ); Loading @@ -542,10 +553,18 @@ static void filt_6k_7k_scale_fx( move32(); FOR( j = 0; j < 31; j++ ) { #ifdef ISSUE_1866_replace_overflow_libdec L_tmp = L_mac_sat( L_tmp, x[i + j], fir_6k_7k_fx[j] ); /* Q16 */ //??sat #else L_tmp = L_mac_o( L_tmp, x[i + j], fir_6k_7k_fx[j], &Overflow ); /* Q16 */ #endif } #ifdef ISSUE_1866_replace_overflow_libdec signal[i] = round_fx_sat( L_tmp ); /* Q0 */ //??sat #else signal[i] = round_fx_o( L_tmp, &Overflow ); /* Q0 */ #endif move16(); } Copy( x + lg, mem, L_FIR - 1 ); /* Qx - 2 */ Loading Loading @@ -1385,8 +1404,9 @@ static Word16 EnhanceClass_fx( Word16 unvoicing_tmp_fx; Word16 tmp, tmp1; Word32 L_tmp; #ifndef ISSUE_1866_replace_overflow_libdec Flag Overflow; #endif /* Decide (*unvoicing_flag) to allow BWE enhancement when qq>pp */ /**voice_fac_fx = add(mult_r(*voice_fac_fx, 24576), mult_r(voice_factor_fx, 8192)); //Q15 */ Loading Loading @@ -1423,13 +1443,21 @@ static Word16 EnhanceClass_fx( move16(); } #ifdef ISSUE_1866_replace_overflow_libdec if ( GT_16( sub_sat( *unvoicing_fx, *unvoicing_sm_fx ), 3277 /* 0.1 in Q15 */ ) ) //??sat #else if ( GT_16( sub_o( *unvoicing_fx, *unvoicing_sm_fx, &Overflow ), 3277 /* 0.1 in Q15 */ ) ) #endif { *unvoicing_flag = 1; move16(); } #ifdef ISSUE_1866_replace_overflow_libdec if ( LT_16( sub_sat( *unvoicing_fx, *unvoicing_sm_fx ), 1638 /* 0.05 in Q15 */ ) ) //??sat #else if ( LT_16( sub_o( *unvoicing_fx, *unvoicing_sm_fx, &Overflow ), 1638 /* 0.05 in Q15 */ ) ) #endif { *unvoicing_flag = 0; move16(); Loading