Loading lib_dec/pvq_core_dec_fx.c +3 −3 Original line number Diff line number Diff line Loading @@ -477,7 +477,7 @@ static void densitySymbolIndexDecode_fx( Word32 acc; Word16 alpha = 0; move16(); #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); Loading @@ -494,8 +494,8 @@ static void densitySymbolIndexDecode_fx( sym_freq = L_deposit_l( 1 ); angle = atan2_fx( SQRT_DIM_fx[opp_sz], SQRT_DIM_fx[near_sz] ); // Q13 #ifdef ISSUE_1796_replace_shl_o angle = shl_sat( angle, 1 ); #ifdef ISSUE_1866_replace_overflow_libdec angle = shl_sat( angle, 1 ); //??sat #else angle = shl_o( angle, 1, &Overflow ); #endif Loading lib_dec/pvq_decode_fx.c +6 −3 Original line number Diff line number Diff line Loading @@ -33,9 +33,11 @@ void pvq_decode_fx( Word32 L_yy, L_isqrt, L_tmp; UWord16 u16_tmp; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); #endif #endif entry = get_size_mpvq_calc_offset_fx( dim, k_val, h_mem ); /* get size & prepare H(adaptive table for entry.size=N_MPVQ(dim,k_val) */ Loading Loading @@ -103,12 +105,13 @@ void pvq_decode_fx( Mpy_32_16_ss( L_isqrt, shl( y[i], shift_num ), &L_tmp, &u16_tmp ); /* Q31*Q(0+x) *2*/ Mpy_32_16_ss( L_tmp, neg_gain_norm, &L_tmp, &u16_tmp ); /* Q31*Q(0+x) *Q15 *2*/ #ifdef ISSUE_1799_replace_L_shr_o L_tmp = L_shr_sat( L_tmp, shift_tot ); #ifdef ISSUE_1866_replace_overflow_libdec L_tmp = L_shr_sat( L_tmp, shift_tot ); //??sat xq[i] = round_fx_sat( L_tmp ); /* Q15 , array move */ //??sat #else L_tmp = L_shr_o( L_tmp, shift_tot, &Overflow ); #endif xq[i] = round_fx_o( L_tmp, &Overflow ); /* Q15 , array move */ #endif move16(); } } Loading lib_dec/swb_tbe_dec_fx.c +26 −4 Original line number Diff line number Diff line Loading @@ -634,9 +634,11 @@ void ivas_wb_tbe_dec_fx( Word32 dummy2[HILBERT_MEM_SIZE]; Word16 f, inc; Word64 W_tmp; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif TD_BWE_DEC_HANDLE hBWE_TD; hBWE_TD = st_fx->hBWE_TD; Loading Loading @@ -962,8 +964,8 @@ void ivas_wb_tbe_dec_fx( n = norm_s( max ); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { #ifdef ISSUE_1796_replace_shl_o shaped_wb_excitation_frac[i] = shl_sat( shaped_wb_excitation[i], n ); /*Q14*/ #ifdef ISSUE_1866_replace_overflow_libdec shaped_wb_excitation_frac[i] = shl_sat( shaped_wb_excitation[i], n ); /*Q14*/ //??sat #else shaped_wb_excitation_frac[i] = shl_o( shaped_wb_excitation[i], n, &Overflow ); /*Q14*/ #endif Loading @@ -974,8 +976,13 @@ void ivas_wb_tbe_dec_fx( move32(); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { #ifdef ISSUE_1866_replace_overflow_libdec L_tmp = L_mult_sat( shaped_wb_excitation_frac[i], shaped_wb_excitation_frac[i] ); /*Q29*/ //??sat curr_frame_pow = L_add_sat( curr_frame_pow, L_shr( L_tmp, 7 ) ); /*Q22*/ //??sat #else L_tmp = L_mult_o( shaped_wb_excitation_frac[i], shaped_wb_excitation_frac[i], &Overflow ); /*Q29*/ curr_frame_pow = L_add_o( curr_frame_pow, L_shr( L_tmp, 7 ), &Overflow ); /*Q22*/ #endif } } curr_frame_pow_exp = add( n, n ); Loading Loading @@ -1169,7 +1176,11 @@ void ivas_wb_tbe_dec_fx( L_tmp = Mult_32_16( Lacc, 102 ); /* Q22 */ exp = norm_l( L_tmp ); #ifdef ISSUE_1866_replace_overflow_libdec tmp = round_fx( L_shl( L_tmp, exp ) ); #else tmp = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); #endif exp = sub( add( exp, 22 ), 30 ); tmp = div_s( 16384, tmp ); L_tmp = Isqrt_lc( L_deposit_h( tmp ), &exp ); /* Q(31-exp) */ Loading Loading @@ -1285,9 +1296,11 @@ void wb_tbe_dec_fx( move16(); Word32 dummy2[HILBERT_MEM_SIZE]; Word16 f, inc; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif TD_BWE_DEC_HANDLE hBWE_TD; hBWE_TD = st_fx->hBWE_TD; Loading Loading @@ -1609,8 +1622,8 @@ void wb_tbe_dec_fx( n = norm_s( max ); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { #ifdef ISSUE_1796_replace_shl_o shaped_wb_excitation_frac[i] = shl_sat( shaped_wb_excitation[i], n ); /*Q14*/ #ifdef ISSUE_1866_replace_overflow_libdec shaped_wb_excitation_frac[i] = shl_sat( shaped_wb_excitation[i], n ); /*Q14*/ //??sat #else shaped_wb_excitation_frac[i] = shl_o( shaped_wb_excitation[i], n, &Overflow ); /*Q14*/ #endif Loading @@ -1621,8 +1634,13 @@ void wb_tbe_dec_fx( move32(); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { #ifdef ISSUE_1866_replace_overflow_libdec L_tmp = L_mult_sat( shaped_wb_excitation_frac[i], shaped_wb_excitation_frac[i] ); /*Q29*/ //??sat curr_frame_pow = L_add_sat( curr_frame_pow, L_shr( L_tmp, 7 ) ); /*Q22*/ //??sat #else L_tmp = L_mult_o( shaped_wb_excitation_frac[i], shaped_wb_excitation_frac[i], &Overflow ); /*Q29*/ curr_frame_pow = L_add_o( curr_frame_pow, L_shr( L_tmp, 7 ), &Overflow ); /*Q22*/ #endif } } curr_frame_pow_exp = add( n, n ); Loading Loading @@ -1818,7 +1836,11 @@ void wb_tbe_dec_fx( L_tmp = Mult_32_16( Lacc, 102 ); /* Q22 */ exp = norm_l( L_tmp ); #ifdef ISSUE_1866_replace_overflow_libdec tmp = round_fx_sat( L_shl( L_tmp, exp ) ); //??sat #else tmp = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); #endif exp = sub( add( exp, 22 ), 30 ); tmp = div_s( 16384, tmp ); L_tmp = Isqrt_lc( L_deposit_h( tmp ), &exp ); /* Q(31-exp) */ Loading lib_dec/syn_outp_fx.c +3 −3 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ void unscale_AGC( { Word16 i, fac, tmp, frame_fac, max_val; Word32 L_tmp; #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading @@ -84,8 +84,8 @@ void unscale_AGC( max_val = s_max( max_val, abs_s( x[i] ) ); } BASOP_SATURATE_WARNING_OFF_EVS #ifdef ISSUE_1796_replace_shl_o tmp = shl_sat( 30000, Qx ); /* saturation can occur here */ #ifdef ISSUE_1866_replace_overflow_libdec tmp = shl_sat( 30000, Qx ); /* saturation can occur here */ //??sat #else tmp = shl_o( 30000, Qx, &Overflow ); /* saturation can occur here */ #endif Loading lib_dec/tonalMDCTconcealment_fx.c +12 −0 Original line number Diff line number Diff line Loading @@ -724,9 +724,11 @@ static void ivas_CalcPowerSpecAndDetectTonalComponents_fx( Word16 invScaleFactors[FDNS_NPTS]; Word16 invScaleFactors_exp[FDNS_NPTS]; Word16 powerSpectrum_exp, tmp_exp, old_exp; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif Word16 nBands; Loading Loading @@ -857,7 +859,11 @@ static void ivas_CalcPowerSpecAndDetectTonalComponents_fx( /* 16 bits are now enough for storing the power spectrum */ FOR( i = 0; i < nSamples; i++ ) { #ifdef ISSUE_1866_replace_overflow_libdec hTonalMDCTConc->secondLastPowerSpectrum[i] = round_fx_sat( powerSpectrum[i] ); // Q31 - powerSpectrum_exp //??sat #else hTonalMDCTConc->secondLastPowerSpectrum[i] = round_fx_o( powerSpectrum[i], &Overflow ); // Q31 - powerSpectrum_exp #endif move32(); } Loading @@ -882,10 +888,12 @@ static void CalcPowerSpecAndDetectTonalComponents( Word16 invScaleFactors[FDNS_NPTS]; Word16 invScaleFactors_exp[FDNS_NPTS]; Word16 powerSpectrum_exp, tmp_exp, old_exp; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif nSamples = hTonalMDCTConc->nNonZeroSamples; Loading Loading @@ -975,7 +983,11 @@ static void CalcPowerSpecAndDetectTonalComponents( /* 16 bits are now enough for storing the power spectrum */ FOR( i = 0; i < nSamples; i++ ) { #ifdef ISSUE_1866_replace_overflow_libdec hTonalMDCTConc->secondLastPowerSpectrum[i] = round_fx_sat( powerSpectrum[i] ); // Q31-powerSpectrum_exp //??sat #else hTonalMDCTConc->secondLastPowerSpectrum[i] = round_fx_o( powerSpectrum[i], &Overflow ); // Q31-powerSpectrum_exp #endif move32(); } Loading Loading
lib_dec/pvq_core_dec_fx.c +3 −3 Original line number Diff line number Diff line Loading @@ -477,7 +477,7 @@ static void densitySymbolIndexDecode_fx( Word32 acc; Word16 alpha = 0; move16(); #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); Loading @@ -494,8 +494,8 @@ static void densitySymbolIndexDecode_fx( sym_freq = L_deposit_l( 1 ); angle = atan2_fx( SQRT_DIM_fx[opp_sz], SQRT_DIM_fx[near_sz] ); // Q13 #ifdef ISSUE_1796_replace_shl_o angle = shl_sat( angle, 1 ); #ifdef ISSUE_1866_replace_overflow_libdec angle = shl_sat( angle, 1 ); //??sat #else angle = shl_o( angle, 1, &Overflow ); #endif Loading
lib_dec/pvq_decode_fx.c +6 −3 Original line number Diff line number Diff line Loading @@ -33,9 +33,11 @@ void pvq_decode_fx( Word32 L_yy, L_isqrt, L_tmp; UWord16 u16_tmp; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); #endif #endif entry = get_size_mpvq_calc_offset_fx( dim, k_val, h_mem ); /* get size & prepare H(adaptive table for entry.size=N_MPVQ(dim,k_val) */ Loading Loading @@ -103,12 +105,13 @@ void pvq_decode_fx( Mpy_32_16_ss( L_isqrt, shl( y[i], shift_num ), &L_tmp, &u16_tmp ); /* Q31*Q(0+x) *2*/ Mpy_32_16_ss( L_tmp, neg_gain_norm, &L_tmp, &u16_tmp ); /* Q31*Q(0+x) *Q15 *2*/ #ifdef ISSUE_1799_replace_L_shr_o L_tmp = L_shr_sat( L_tmp, shift_tot ); #ifdef ISSUE_1866_replace_overflow_libdec L_tmp = L_shr_sat( L_tmp, shift_tot ); //??sat xq[i] = round_fx_sat( L_tmp ); /* Q15 , array move */ //??sat #else L_tmp = L_shr_o( L_tmp, shift_tot, &Overflow ); #endif xq[i] = round_fx_o( L_tmp, &Overflow ); /* Q15 , array move */ #endif move16(); } } Loading
lib_dec/swb_tbe_dec_fx.c +26 −4 Original line number Diff line number Diff line Loading @@ -634,9 +634,11 @@ void ivas_wb_tbe_dec_fx( Word32 dummy2[HILBERT_MEM_SIZE]; Word16 f, inc; Word64 W_tmp; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif TD_BWE_DEC_HANDLE hBWE_TD; hBWE_TD = st_fx->hBWE_TD; Loading Loading @@ -962,8 +964,8 @@ void ivas_wb_tbe_dec_fx( n = norm_s( max ); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { #ifdef ISSUE_1796_replace_shl_o shaped_wb_excitation_frac[i] = shl_sat( shaped_wb_excitation[i], n ); /*Q14*/ #ifdef ISSUE_1866_replace_overflow_libdec shaped_wb_excitation_frac[i] = shl_sat( shaped_wb_excitation[i], n ); /*Q14*/ //??sat #else shaped_wb_excitation_frac[i] = shl_o( shaped_wb_excitation[i], n, &Overflow ); /*Q14*/ #endif Loading @@ -974,8 +976,13 @@ void ivas_wb_tbe_dec_fx( move32(); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { #ifdef ISSUE_1866_replace_overflow_libdec L_tmp = L_mult_sat( shaped_wb_excitation_frac[i], shaped_wb_excitation_frac[i] ); /*Q29*/ //??sat curr_frame_pow = L_add_sat( curr_frame_pow, L_shr( L_tmp, 7 ) ); /*Q22*/ //??sat #else L_tmp = L_mult_o( shaped_wb_excitation_frac[i], shaped_wb_excitation_frac[i], &Overflow ); /*Q29*/ curr_frame_pow = L_add_o( curr_frame_pow, L_shr( L_tmp, 7 ), &Overflow ); /*Q22*/ #endif } } curr_frame_pow_exp = add( n, n ); Loading Loading @@ -1169,7 +1176,11 @@ void ivas_wb_tbe_dec_fx( L_tmp = Mult_32_16( Lacc, 102 ); /* Q22 */ exp = norm_l( L_tmp ); #ifdef ISSUE_1866_replace_overflow_libdec tmp = round_fx( L_shl( L_tmp, exp ) ); #else tmp = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); #endif exp = sub( add( exp, 22 ), 30 ); tmp = div_s( 16384, tmp ); L_tmp = Isqrt_lc( L_deposit_h( tmp ), &exp ); /* Q(31-exp) */ Loading Loading @@ -1285,9 +1296,11 @@ void wb_tbe_dec_fx( move16(); Word32 dummy2[HILBERT_MEM_SIZE]; Word16 f, inc; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif TD_BWE_DEC_HANDLE hBWE_TD; hBWE_TD = st_fx->hBWE_TD; Loading Loading @@ -1609,8 +1622,8 @@ void wb_tbe_dec_fx( n = norm_s( max ); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { #ifdef ISSUE_1796_replace_shl_o shaped_wb_excitation_frac[i] = shl_sat( shaped_wb_excitation[i], n ); /*Q14*/ #ifdef ISSUE_1866_replace_overflow_libdec shaped_wb_excitation_frac[i] = shl_sat( shaped_wb_excitation[i], n ); /*Q14*/ //??sat #else shaped_wb_excitation_frac[i] = shl_o( shaped_wb_excitation[i], n, &Overflow ); /*Q14*/ #endif Loading @@ -1621,8 +1634,13 @@ void wb_tbe_dec_fx( move32(); FOR( i = 0; i < L_FRAME16k / 4; i++ ) { #ifdef ISSUE_1866_replace_overflow_libdec L_tmp = L_mult_sat( shaped_wb_excitation_frac[i], shaped_wb_excitation_frac[i] ); /*Q29*/ //??sat curr_frame_pow = L_add_sat( curr_frame_pow, L_shr( L_tmp, 7 ) ); /*Q22*/ //??sat #else L_tmp = L_mult_o( shaped_wb_excitation_frac[i], shaped_wb_excitation_frac[i], &Overflow ); /*Q29*/ curr_frame_pow = L_add_o( curr_frame_pow, L_shr( L_tmp, 7 ), &Overflow ); /*Q22*/ #endif } } curr_frame_pow_exp = add( n, n ); Loading Loading @@ -1818,7 +1836,11 @@ void wb_tbe_dec_fx( L_tmp = Mult_32_16( Lacc, 102 ); /* Q22 */ exp = norm_l( L_tmp ); #ifdef ISSUE_1866_replace_overflow_libdec tmp = round_fx_sat( L_shl( L_tmp, exp ) ); //??sat #else tmp = round_fx_o( L_shl_o( L_tmp, exp, &Overflow ), &Overflow ); #endif exp = sub( add( exp, 22 ), 30 ); tmp = div_s( 16384, tmp ); L_tmp = Isqrt_lc( L_deposit_h( tmp ), &exp ); /* Q(31-exp) */ Loading
lib_dec/syn_outp_fx.c +3 −3 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ void unscale_AGC( { Word16 i, fac, tmp, frame_fac, max_val; Word32 L_tmp; #ifndef ISSUE_1796_replace_shl_o #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); Loading @@ -84,8 +84,8 @@ void unscale_AGC( max_val = s_max( max_val, abs_s( x[i] ) ); } BASOP_SATURATE_WARNING_OFF_EVS #ifdef ISSUE_1796_replace_shl_o tmp = shl_sat( 30000, Qx ); /* saturation can occur here */ #ifdef ISSUE_1866_replace_overflow_libdec tmp = shl_sat( 30000, Qx ); /* saturation can occur here */ //??sat #else tmp = shl_o( 30000, Qx, &Overflow ); /* saturation can occur here */ #endif Loading
lib_dec/tonalMDCTconcealment_fx.c +12 −0 Original line number Diff line number Diff line Loading @@ -724,9 +724,11 @@ static void ivas_CalcPowerSpecAndDetectTonalComponents_fx( Word16 invScaleFactors[FDNS_NPTS]; Word16 invScaleFactors_exp[FDNS_NPTS]; Word16 powerSpectrum_exp, tmp_exp, old_exp; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif Word16 nBands; Loading Loading @@ -857,7 +859,11 @@ static void ivas_CalcPowerSpecAndDetectTonalComponents_fx( /* 16 bits are now enough for storing the power spectrum */ FOR( i = 0; i < nSamples; i++ ) { #ifdef ISSUE_1866_replace_overflow_libdec hTonalMDCTConc->secondLastPowerSpectrum[i] = round_fx_sat( powerSpectrum[i] ); // Q31 - powerSpectrum_exp //??sat #else hTonalMDCTConc->secondLastPowerSpectrum[i] = round_fx_o( powerSpectrum[i], &Overflow ); // Q31 - powerSpectrum_exp #endif move32(); } Loading @@ -882,10 +888,12 @@ static void CalcPowerSpecAndDetectTonalComponents( Word16 invScaleFactors[FDNS_NPTS]; Word16 invScaleFactors_exp[FDNS_NPTS]; Word16 powerSpectrum_exp, tmp_exp, old_exp; #ifndef ISSUE_1866_replace_overflow_libdec #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif nSamples = hTonalMDCTConc->nNonZeroSamples; Loading Loading @@ -975,7 +983,11 @@ static void CalcPowerSpecAndDetectTonalComponents( /* 16 bits are now enough for storing the power spectrum */ FOR( i = 0; i < nSamples; i++ ) { #ifdef ISSUE_1866_replace_overflow_libdec hTonalMDCTConc->secondLastPowerSpectrum[i] = round_fx_sat( powerSpectrum[i] ); // Q31-powerSpectrum_exp //??sat #else hTonalMDCTConc->secondLastPowerSpectrum[i] = round_fx_o( powerSpectrum[i], &Overflow ); // Q31-powerSpectrum_exp #endif move32(); } Loading