Loading lib_enc/scale_enc_fx.c +0 −26 Original line number Diff line number Diff line Loading @@ -86,11 +86,9 @@ void Preemph_scaled( Word16 mu, shift, QVal; Word32 L_tmp, L_maxloc; Word16 Q_min; #if !defined( ISSUE_1867_replace_overflow_libenc ) && !defined( ISSUE_1796_replace_shl_o ) #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /*---------------------------------------------------------------* Loading @@ -99,16 +97,11 @@ void Preemph_scaled( *---------------------------------------------------------------*/ BASOP_SATURATE_WARNING_OFF_EVS #ifdef ISSUE_1867_replace_overflow_libenc QVal = shl_sat( 1, sub( 15, bits ) ); //?sat #else Overflow = 0; #ifdef ISSUE_1796_replace_shl_o QVal = shl_sat( 1, sub( 15, bits ) ); #else QVal = shl_o( 1, sub( 15, bits ), &Overflow ); #endif #endif BASOP_SATURATE_WARNING_ON_EVS mu = shr( Preemph_factor, bits ); /* Q15 --> Q(15-bits) */ Loading @@ -126,11 +119,7 @@ void Preemph_scaled( /* Equivalent to tmp = max((abs(x[i] - mu*x[i-1]),tmp) * finds the max of preemphasized signal */ L_tmp = L_mult( new_speech[i], QVal ); #ifdef ISSUE_1867_replace_overflow_libenc L_tmp = L_msu_sat( L_tmp, new_speech[i - 1], mu ); //??sat #else L_tmp = L_msu_o( L_tmp, new_speech[i - 1], mu, &Overflow ); #endif L_tmp = L_abs( L_tmp ); L_maxloc = L_max( L_tmp, L_maxloc ); } Loading Loading @@ -180,11 +169,7 @@ void Preemph_scaled( FOR( i = sub( Lframe, 1 ); i > 0; i-- ) { L_tmp = L_mult( new_speech[i], QVal ); #ifdef ISSUE_1867_replace_overflow_libenc L_tmp = L_msu_sat( L_tmp, new_speech[i - 1], mu ); //??sat #else L_tmp = L_msu_o( L_tmp, new_speech[i - 1], mu, &Overflow ); #endif L_tmp = L_shl( L_tmp, *Q_new ); new_speech[i] = round_fx_sat( L_tmp ); // Q_new } Loading Loading @@ -217,10 +202,8 @@ Word32 Scale_mem_pre_proc( /* o : Min energy scaled { Word16 i; Word32 e_min_scaled; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif e_min_scaled = L_shr_r( L_add( L_shr( E_MIN_FXQ15, sub( 14, add( *Q_new, QSCALE ) ) ), 1 ), 1 ); Loading Loading @@ -250,21 +233,12 @@ Word32 Scale_mem_pre_proc( /* o : Min energy scaled /* Do scaling and valide minimum energy value */ FOR( i = 0; i < NB_BANDS; i++ ) { #ifdef ISSUE_1867_replace_overflow_libenc enrO[i] = L_max( L_shl_sat( enrO[i], Q_exp ), e_min_scaled ); //??sat bckr[i] = L_max( L_shl_sat( bckr[i], Q_exp ), e_min_scaled ); //??sat ave_enr[i] = L_max( L_shl_sat( ave_enr[i], Q_exp ), e_min_scaled ); //??sat ave_enr2[i] = L_max( L_shl_sat( ave_enr2[i], Q_exp ), e_min_scaled ); //??sat st_fr_bands1[i] = L_max( L_shl_sat( st_fr_bands1[i], Q_exp ), e_min_scaled ); //??sat st_fr_bands2[i] = L_max( L_shl_sat( st_fr_bands2[i], Q_exp ), e_min_scaled ); //??sat #else enrO[i] = L_max( L_shl_o( enrO[i], Q_exp, &Overflow ), e_min_scaled ); bckr[i] = L_max( L_shl_o( bckr[i], Q_exp, &Overflow ), e_min_scaled ); ave_enr[i] = L_max( L_shl_o( ave_enr[i], Q_exp, &Overflow ), e_min_scaled ); ave_enr2[i] = L_max( L_shl_o( ave_enr2[i], Q_exp, &Overflow ), e_min_scaled ); st_fr_bands1[i] = L_max( L_shl_o( st_fr_bands1[i], Q_exp, &Overflow ), e_min_scaled ); st_fr_bands2[i] = L_max( L_shl_o( st_fr_bands2[i], Q_exp, &Overflow ), e_min_scaled ); #endif move32(); move32(); move32(); Loading lib_enc/set_impulse_fx.c +13 −37 Original line number Diff line number Diff line Loading @@ -65,11 +65,9 @@ void set_impulse_fx( Word16 krit_fx, krit_max_fx, gain16; Word32 Lrr, Ldd, Ltmp, Ltmp1; const Word16 *pt_Glt; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif krit_max_fx = -32768; move16(); Loading Loading @@ -121,21 +119,12 @@ void set_impulse_fx( /* nominator & DEnominator row <0> */ FOR( i = 0; i < L_SUBFR; i++ ) { #ifdef ISSUE_1867_replace_overflow_libenc Lrr = L_mac_sat( Lrr, gh_fx[i], gh_fx[i] ); // Q27 //??sat Ldd = L_mac_sat( Ldd, gh_fx[i], xn_fx[i] ); // Q27 //??sat #else Lrr = L_mac_o( Lrr, gh_fx[i], gh_fx[i], &Overflow ); // Q27 Ldd = L_mac_o( Ldd, gh_fx[i], xn_fx[i], &Overflow ); // Q27 #endif } rr_fx[start1] = Lrr; move32(); #ifdef ISSUE_1867_replace_overflow_libenc dd_fx[start1] = round_fx_sat( Ldd ); // Q11 //??sat #else dd_fx[start1] = round_fx_o( Ldd, &Overflow ); // Q11 #endif rr_fx[start1] = L_max( rr_fx[start1], 1 ); FOR( i = add( start1, 1 ); i < L_IMPULSE2; i++ ) Loading @@ -149,24 +138,14 @@ void set_impulse_fx( gh_fx[j] = mac_r( L_deposit_h( gh_fx[j - 1] ), Glottal_cdbk_fx[m * L_IMPULSE + L_IMPULSE2 - i], h_orig_fx[j] ); // Q13 move16(); #ifdef ISSUE_1867_replace_overflow_libenc Lrr = L_mac_sat( Lrr, gh_fx[j], gh_fx[j] ); // Q27 //??sat Ldd = L_mac_sat( Ldd, gh_fx[j], xn_fx[j] ); // Q27 //??sat #else Lrr = L_mac_o( Lrr, gh_fx[j], gh_fx[j], &Overflow ); // Q27 Ldd = L_mac_o( Ldd, gh_fx[j], xn_fx[j], &Overflow ); // Q27 #endif } gh_fx[0] = mult_r( Glottal_cdbk_fx[m * L_IMPULSE + L_IMPULSE2 - i], h_orig_fx[0] ); // Q13 move16(); #ifdef ISSUE_1867_replace_overflow_libenc Lrr = L_mac_sat( Lrr, gh_fx[0], gh_fx[0] ); // Q27 //??sat Ldd = L_mac_sat( Ldd, gh_fx[0], xn_fx[0] ); // Q27 //??sat #else Lrr = L_mac_o( Lrr, gh_fx[0], gh_fx[0], &Overflow ); // Q27 Ldd = L_mac_o( Ldd, gh_fx[0], xn_fx[0], &Overflow ); // Q27 #endif dd_fx[i] = round_fx_sat( Ldd ); // Q11 rr_fx[i] = L_max( Lrr, 1 ); move32(); Loading Loading @@ -200,11 +179,8 @@ void set_impulse_fx( FOR( i = L_SUBFR - 2; i >= start2; i-- ) { /*rr[i] = rr[i+1] + gh[L_SUBFR+L_IMPULSE2-1-i]*gh[L_SUBFR+L_IMPULSE2-1-i];*/ #ifdef ISSUE_1867_replace_overflow_libenc rr_fx[i] = L_mac_sat( rr_fx[i + 1], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i] ); // Q27 //??sat #else rr_fx[i] = L_mac_o( rr_fx[i + 1], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i], &Overflow ); // Q27 #endif rr_fx[i] = L_mac_o( rr_fx[i + 1], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i], &Overflow ); // Q27 move32(); } /* nominator rows <L_IMPULSE2,L_SUBFR-1> */ Loading @@ -226,8 +202,8 @@ void set_impulse_fx( num = div_s( num, den ); #ifdef ISSUE_1867_replace_overflow_libenc krit_fx = shr_sat( num, sub( sub( shl_sat( exp_num, 1 ), exp_den ), 2 ) ); /* Q18 */ //??sat #ifdef ISSUE_1796_replace_shl_o krit_fx = shr_sat( num, sub( sub( shl_sat( exp_num, 1 ), exp_den ), 2 ) ); /* Q18 */ #else krit_fx = shr_sat( num, sub( sub( shl_o( exp_num, 1, &Overflow ), exp_den ), 2 ) ); /* Q18 */ #endif Loading lib_enc/sig_clas_fx.c +0 −12 Original line number Diff line number Diff line Loading @@ -56,11 +56,9 @@ Word16 signal_clas_fx( /* o : classification for current Word16 i, clas, pc, zc, lo, lo2, hi, hi2, exp_ee, frac_ee; Word16 tmp16, tmpS; const Word16 *pt1; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /*----------------------------------------------------------------* Loading Loading @@ -155,11 +153,7 @@ Word16 signal_clas_fx( /* o : classification for current Ltmp = L_mac( Ltmp, relEn, 10923 ); Ltmp = L_mac( Ltmp, pcn, 10923 ); #ifdef ISSUE_1867_replace_overflow_libenc fmerit1 = round_fx_sat( L_shl_sat( Ltmp, 16 - 10 - 1 ) ); /* fmerit1 ->Q15 */ //??sat //??sat #else fmerit1 = round_fx_o( L_shl_o( Ltmp, 16 - 10 - 1, &Overflow ), &Overflow ); /* fmerit1 ->Q15 */ #endif /*-----------------------------------------------------------------* * FEC classification Loading Loading @@ -293,11 +287,9 @@ Word16 signal_clas_ivas_fx( /* o : classification for cur Word16 tmp16, tmpS; const Word16 *pt1; Word64 tmp64; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /*----------------------------------------------------------------* Loading Loading @@ -393,11 +385,7 @@ Word16 signal_clas_ivas_fx( /* o : classification for cur Ltmp = L_mac( Ltmp, relEn, 10923 ); Ltmp = L_mac( Ltmp, pcn, 10923 ); #ifdef ISSUE_1867_replace_overflow_libenc fmerit1 = round_fx_sat( L_shl_sat( Ltmp, 16 - 10 - 1 ) ); /* fmerit1 ->Q15 */ //??sat //??sat #else fmerit1 = round_fx_o( L_shl_o( Ltmp, 16 - 10 - 1, &Overflow ), &Overflow ); /* fmerit1 ->Q15 */ #endif /*-----------------------------------------------------------------* * FEC classification Loading lib_enc/speech_music_classif_fx.c +4 −66 Original line number Diff line number Diff line Loading @@ -662,11 +662,9 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis Word16 tmp1, tmp2, exp2, scale, exp3; SP_MUS_CLAS_HANDLE hSpMusClas = st_fx->hSpMusClas; HQ_ENC_HANDLE hHQ_core = st_fx->hHQ_core; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); #endif #endif /*------------------------------------------------------------------* Loading Loading @@ -796,18 +794,10 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis sum_PS = L_deposit_l( 0 ); FOR( i = LOWEST_FBIN; i < HIGHEST_FBIN; i++ ) { #ifdef ISSUE_1867_replace_overflow_libenc sum_PS = L_add_sat( sum_PS, PS[i] ); //??sat #else sum_PS = L_add_o( sum_PS, PS[i], &Overflow ); #endif } exp1 = norm_l( sum_PS ); #ifdef ISSUE_1867_replace_overflow_libenc tmp1 = round_fx_sat( L_shl( sum_PS, exp1 ) ); //??sat #else tmp1 = round_fx_o( L_shl( sum_PS, exp1 ), &Overflow ); #endif exp1 = sub( 30, exp1 ); FOR( i = LOWEST_FBIN; i < HIGHEST_FBIN; i++ ) Loading @@ -815,11 +805,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis /*PS_norm[i] = PS[i] / sum_PS;*/ /*dPS[i] = (float)fabs(PS_norm[i] - st->past_PS[i]);*/ exp2 = norm_l( PS[i] ); #ifdef ISSUE_1867_replace_overflow_libenc tmp2 = round_fx_sat( L_shl( PS[i], exp2 ) ); //??sat #else tmp2 = round_fx_o( L_shl( PS[i], exp2 ), &Overflow ); #endif exp2 = sub( 30, exp2 ); scale = shr( sub( tmp1, tmp2 ), 15 ); Loading Loading @@ -880,11 +866,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis ELSE { exp1 = norm_l( L_add( dPS[i], 336 ) ); #ifdef ISSUE_1867_replace_overflow_libenc tmp1 = round_fx_sat( L_shl_sat( L_add( dPS[i], 336 ), exp1 ) ); //??sat //??sat #else tmp1 = round_fx_o( L_shl_o( L_add( dPS[i], 336 ), exp1, &Overflow ), &Overflow ); #endif exp1 = sub( 30, exp1 ); exp2 = norm_l( mx ); Loading Loading @@ -941,11 +923,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis FOR( i = 0; i < N_FEATURES; i++ ) { /**pFV = pSF[0] * *pFV + pSF[1];*/ #ifdef ISSUE_1867_replace_overflow_libenc *pFV = round_fx_sat( L_shl_sat( L_mac( pSF_a[i], *pFV, pSF_m[i] ), ishift[i] ) ); //??sat //??sat #else *pFV = round_fx_o( L_shl_o( L_mac( pSF_a[i], *pFV, pSF_m[i] ), ishift[i], &Overflow ), &Overflow ); #endif move16(); pFV++; } Loading Loading @@ -976,11 +954,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis FOR( p = 0; p < N_FEATURES; p++ ) { /* xm[p] = FV[p] - m_speech[k*N_FEATURES+p];*/ #ifdef ISSUE_1867_replace_overflow_libenc xm[p] = sub_sat( FV[p], m_speech_fx[k * N_FEATURES + p] ); //??sat #else xm[p] = sub_o( FV[p], m_speech_fx[k * N_FEATURES + p], &Overflow ); #endif move16(); /*Q15 */ } Loading @@ -996,11 +970,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis FOR( p = 0; p < N_FEATURES; p++ ) { /*xm[p] = FV[p] - m_noise[k*N_FEATURES+p];*/ #ifdef ISSUE_1867_replace_overflow_libenc xm[p] = sub_sat( FV[p], m_noise_fx[k * N_FEATURES + p] ); //??sat #else xm[p] = sub_o( FV[p], m_noise_fx[k * N_FEATURES + p], &Overflow ); #endif move16(); /*Q15 */ } Loading @@ -1015,11 +985,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis FOR( p = 0; p < N_FEATURES; p++ ) { /*xm[p] = FV[p] - m_music[k*N_FEATURES+p];*/ #ifdef ISSUE_1867_replace_overflow_libenc xm[p] = sub_sat( FV[p], m_music_fx[k * N_FEATURES + p] ); //??sat #else xm[p] = sub_o( FV[p], m_music_fx[k * N_FEATURES + p], &Overflow ); #endif move16(); /*Q15 */ } Loading @@ -1033,11 +999,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis /* calculate log-probability */ /*log(0.0001)-0.5f * N_FEATURES * LOG_PI2 in Q9 */ #ifdef ISSUE_1867_replace_overflow_libenc lps = extract_h( L_shl_sat( L_sub( max_s, LOG_PROB_CONST ), 16 - 1 ) ); /*Q9 */ //??sat #else lps = extract_h( L_shl_o( L_sub( max_s, LOG_PROB_CONST ), 16 - 1, &Overflow ) ); /*Q9 */ #endif lps = s_max( lps, -10832 ); lpm = extract_h( L_shl( L_sub( max_m, LOG_PROB_CONST ), 16 - 1 ) ); /*Q9 */ Loading @@ -1045,11 +1007,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis /* lpn = (float)log(pyn) - 0.5f * N_FEATURES * (float)log(2*PI); */ #ifdef ISSUE_1867_replace_overflow_libenc lpn = extract_h( L_shl_sat( L_sub( max_n, LOG_PROB_CONST ), 16 - 1 ) ); /*Q9 */ //??sat #else lpn = extract_h( L_shl_o( L_sub( max_n, LOG_PROB_CONST ), 16 - 1, &Overflow ) ); /*Q9 */ #endif lpn = s_max( lpn, -10832 ); *high_lpn_flag_ptr = 0; Loading Loading @@ -1501,11 +1459,9 @@ static Word16 attack_det_fx( /* o : attack flag Word16 i, j, tmp, tmp1, attack, exp1; Word32 L_tmp, etmp, etmp2, finc[ATT_NSEG]; Word16 att_3lsub_pos; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); #endif #endif att_3lsub_pos = ATT_3LSUB_POS; Loading @@ -1523,11 +1479,7 @@ static Word16 attack_det_fx( /* o : attack flag FOR( j = 1; j < ATT_SEG_LEN; j++ ) { #ifdef ISSUE_1867_replace_overflow_libenc L_tmp = L_mac0_sat( L_tmp, inp[i * ATT_SEG_LEN + j], inp[i * ATT_SEG_LEN + j] ); /*2*Qx */ //??sat #else L_tmp = L_mac0_o( L_tmp, inp[i * ATT_SEG_LEN + j], inp[i * ATT_SEG_LEN + j], &Overflow ); /*2*Qx */ #endif } finc[i] = L_tmp; Loading @@ -1552,11 +1504,7 @@ static Word16 attack_det_fx( /* o : attack flag FOR( i = 1; i < att_3lsub_pos; i++ ) { #ifdef ISSUE_1867_replace_overflow_libenc L_tmp = L_add_sat( L_tmp, L_shr_sat( finc[i], Qx ) ); /*Qx */ //??sat //??sat #else L_tmp = L_add_o( L_tmp, L_shr_sat( finc[i], Qx ), &Overflow ); /*Qx */ #endif } L_tmp = Mult_32_16( L_tmp, tmp ); /*Q(14-exp1+Qx) */ etmp = L_shl( L_tmp, sub( exp1, 14 ) ); /*Qx */ Loading @@ -1568,11 +1516,7 @@ static Word16 attack_det_fx( /* o : attack flag L_tmp = L_shr_sat( finc[attack], Qx ); /*Qx */ FOR( i = 1; i < tmp1; i++ ) { #ifdef ISSUE_1867_replace_overflow_libenc L_tmp = L_add_sat( L_tmp, L_shr_sat( finc[i + attack], Qx ) ); /*Qx */ //??sat //??sat #else L_tmp = L_add_o( L_tmp, L_shr_sat( finc[i + attack], Qx ), &Overflow ); /*Qx */ #endif } L_tmp = Mult_32_16( L_tmp, tmp ); /*Q(14-exp1+Qx) */ etmp2 = L_shl( L_tmp, sub( exp1, 14 ) ); /*Qx */ Loading Loading @@ -2671,11 +2615,9 @@ static Word16 attack_det_ivas_fx( /* o : attack flag Word64 W_tmp; Word16 q_diff; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif att_3lsub_pos = ATT_3LSUB_POS; Loading @@ -2693,11 +2635,7 @@ static Word16 attack_det_ivas_fx( /* o : attack flag FOR( j = 1; j < ATT_SEG_LEN; j++ ) { #ifdef ISSUE_1867_replace_overflow_libenc L_tmp = L_mac0_sat( L_tmp, inp[i * ATT_SEG_LEN + j], inp[i * ATT_SEG_LEN + j] ); /*2*Qx */ //??sat #else L_tmp = L_mac0_o( L_tmp, inp[i * ATT_SEG_LEN + j], inp[i * ATT_SEG_LEN + j], &Overflow ); /*2*Qx */ #endif } finc[i] = L_tmp; Loading lib_enc/stat_noise_uv_enc_fx.c +6 −26 Original line number Diff line number Diff line Loading @@ -50,11 +50,9 @@ void stat_noise_uv_enc_fx( Word16 noisiness = 0; move16(); Word16 num, den, expn, expd; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); #endif #endif test(); test(); Loading @@ -67,17 +65,9 @@ void stat_noise_uv_enc_fx( *-----------------------------------------------------------------*/ /* epsP[2] is located in LepsP[0] and epsP[16] in LepsP[1] */ expn = sub( norm_l( LepsP[0] ), 1 ); #ifdef ISSUE_1867_replace_overflow_libenc num = extract_h( L_shl( LepsP[0], expn ) ); /*expn-16*/ #else num = extract_h( L_shl_o( LepsP[0], expn, &Overflow ) ); /*expn-16*/ #endif expd = norm_l( LepsP[1] ); #ifdef ISSUE_1867_replace_overflow_libenc den = extract_h( L_shl( LepsP[1], expd ) ); /*expd-16*/ #else den = extract_h( L_shl_o( LepsP[1], expd, &Overflow ) ); /*expd-16*/ #endif num = div_s( num, den ); /*expn-expd+15*/ num = shr_sat( num, add( sub( expn, expd ), 5 ) ); /*Q10*/ num = sub( num, 1024 ); /*num - 1*/ Loading Loading @@ -133,11 +123,9 @@ void stat_noise_uv_enc_ivas_fx( Word16 noisiness = 0; move16(); Word16 num, den, expn, expd; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif test(); test(); Loading @@ -150,17 +138,9 @@ void stat_noise_uv_enc_ivas_fx( *-----------------------------------------------------------------*/ /* epsP[2] is located in LepsP[0] and epsP[16] in LepsP[1] */ expn = sub( norm_l( LepsP[0] ), 1 ); #ifdef ISSUE_1867_replace_overflow_libenc num = extract_h( L_shl( LepsP[0], expn ) ); /*expn-16*/ #else num = extract_h( L_shl_o( LepsP[0], expn, &Overflow ) ); /*expn-16*/ #endif expd = norm_l( LepsP[1] ); #ifdef ISSUE_1867_replace_overflow_libenc den = extract_h( L_shl( LepsP[1], expd ) ); /*expd-16*/ #else den = extract_h( L_shl_o( LepsP[1], expd, &Overflow ) ); /*expd-16*/ #endif num = div_s( num, den ); /*expn-expd+15*/ num = shr_sat( num, add( sub( expn, expd ), 5 ) ); /*Q10*/ num = sub( num, 1024 ); /*num - 1*/ Loading Loading
lib_enc/scale_enc_fx.c +0 −26 Original line number Diff line number Diff line Loading @@ -86,11 +86,9 @@ void Preemph_scaled( Word16 mu, shift, QVal; Word32 L_tmp, L_maxloc; Word16 Q_min; #if !defined( ISSUE_1867_replace_overflow_libenc ) && !defined( ISSUE_1796_replace_shl_o ) #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /*---------------------------------------------------------------* Loading @@ -99,16 +97,11 @@ void Preemph_scaled( *---------------------------------------------------------------*/ BASOP_SATURATE_WARNING_OFF_EVS #ifdef ISSUE_1867_replace_overflow_libenc QVal = shl_sat( 1, sub( 15, bits ) ); //?sat #else Overflow = 0; #ifdef ISSUE_1796_replace_shl_o QVal = shl_sat( 1, sub( 15, bits ) ); #else QVal = shl_o( 1, sub( 15, bits ), &Overflow ); #endif #endif BASOP_SATURATE_WARNING_ON_EVS mu = shr( Preemph_factor, bits ); /* Q15 --> Q(15-bits) */ Loading @@ -126,11 +119,7 @@ void Preemph_scaled( /* Equivalent to tmp = max((abs(x[i] - mu*x[i-1]),tmp) * finds the max of preemphasized signal */ L_tmp = L_mult( new_speech[i], QVal ); #ifdef ISSUE_1867_replace_overflow_libenc L_tmp = L_msu_sat( L_tmp, new_speech[i - 1], mu ); //??sat #else L_tmp = L_msu_o( L_tmp, new_speech[i - 1], mu, &Overflow ); #endif L_tmp = L_abs( L_tmp ); L_maxloc = L_max( L_tmp, L_maxloc ); } Loading Loading @@ -180,11 +169,7 @@ void Preemph_scaled( FOR( i = sub( Lframe, 1 ); i > 0; i-- ) { L_tmp = L_mult( new_speech[i], QVal ); #ifdef ISSUE_1867_replace_overflow_libenc L_tmp = L_msu_sat( L_tmp, new_speech[i - 1], mu ); //??sat #else L_tmp = L_msu_o( L_tmp, new_speech[i - 1], mu, &Overflow ); #endif L_tmp = L_shl( L_tmp, *Q_new ); new_speech[i] = round_fx_sat( L_tmp ); // Q_new } Loading Loading @@ -217,10 +202,8 @@ Word32 Scale_mem_pre_proc( /* o : Min energy scaled { Word16 i; Word32 e_min_scaled; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif #endif e_min_scaled = L_shr_r( L_add( L_shr( E_MIN_FXQ15, sub( 14, add( *Q_new, QSCALE ) ) ), 1 ), 1 ); Loading Loading @@ -250,21 +233,12 @@ Word32 Scale_mem_pre_proc( /* o : Min energy scaled /* Do scaling and valide minimum energy value */ FOR( i = 0; i < NB_BANDS; i++ ) { #ifdef ISSUE_1867_replace_overflow_libenc enrO[i] = L_max( L_shl_sat( enrO[i], Q_exp ), e_min_scaled ); //??sat bckr[i] = L_max( L_shl_sat( bckr[i], Q_exp ), e_min_scaled ); //??sat ave_enr[i] = L_max( L_shl_sat( ave_enr[i], Q_exp ), e_min_scaled ); //??sat ave_enr2[i] = L_max( L_shl_sat( ave_enr2[i], Q_exp ), e_min_scaled ); //??sat st_fr_bands1[i] = L_max( L_shl_sat( st_fr_bands1[i], Q_exp ), e_min_scaled ); //??sat st_fr_bands2[i] = L_max( L_shl_sat( st_fr_bands2[i], Q_exp ), e_min_scaled ); //??sat #else enrO[i] = L_max( L_shl_o( enrO[i], Q_exp, &Overflow ), e_min_scaled ); bckr[i] = L_max( L_shl_o( bckr[i], Q_exp, &Overflow ), e_min_scaled ); ave_enr[i] = L_max( L_shl_o( ave_enr[i], Q_exp, &Overflow ), e_min_scaled ); ave_enr2[i] = L_max( L_shl_o( ave_enr2[i], Q_exp, &Overflow ), e_min_scaled ); st_fr_bands1[i] = L_max( L_shl_o( st_fr_bands1[i], Q_exp, &Overflow ), e_min_scaled ); st_fr_bands2[i] = L_max( L_shl_o( st_fr_bands2[i], Q_exp, &Overflow ), e_min_scaled ); #endif move32(); move32(); move32(); Loading
lib_enc/set_impulse_fx.c +13 −37 Original line number Diff line number Diff line Loading @@ -65,11 +65,9 @@ void set_impulse_fx( Word16 krit_fx, krit_max_fx, gain16; Word32 Lrr, Ldd, Ltmp, Ltmp1; const Word16 *pt_Glt; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif krit_max_fx = -32768; move16(); Loading Loading @@ -121,21 +119,12 @@ void set_impulse_fx( /* nominator & DEnominator row <0> */ FOR( i = 0; i < L_SUBFR; i++ ) { #ifdef ISSUE_1867_replace_overflow_libenc Lrr = L_mac_sat( Lrr, gh_fx[i], gh_fx[i] ); // Q27 //??sat Ldd = L_mac_sat( Ldd, gh_fx[i], xn_fx[i] ); // Q27 //??sat #else Lrr = L_mac_o( Lrr, gh_fx[i], gh_fx[i], &Overflow ); // Q27 Ldd = L_mac_o( Ldd, gh_fx[i], xn_fx[i], &Overflow ); // Q27 #endif } rr_fx[start1] = Lrr; move32(); #ifdef ISSUE_1867_replace_overflow_libenc dd_fx[start1] = round_fx_sat( Ldd ); // Q11 //??sat #else dd_fx[start1] = round_fx_o( Ldd, &Overflow ); // Q11 #endif rr_fx[start1] = L_max( rr_fx[start1], 1 ); FOR( i = add( start1, 1 ); i < L_IMPULSE2; i++ ) Loading @@ -149,24 +138,14 @@ void set_impulse_fx( gh_fx[j] = mac_r( L_deposit_h( gh_fx[j - 1] ), Glottal_cdbk_fx[m * L_IMPULSE + L_IMPULSE2 - i], h_orig_fx[j] ); // Q13 move16(); #ifdef ISSUE_1867_replace_overflow_libenc Lrr = L_mac_sat( Lrr, gh_fx[j], gh_fx[j] ); // Q27 //??sat Ldd = L_mac_sat( Ldd, gh_fx[j], xn_fx[j] ); // Q27 //??sat #else Lrr = L_mac_o( Lrr, gh_fx[j], gh_fx[j], &Overflow ); // Q27 Ldd = L_mac_o( Ldd, gh_fx[j], xn_fx[j], &Overflow ); // Q27 #endif } gh_fx[0] = mult_r( Glottal_cdbk_fx[m * L_IMPULSE + L_IMPULSE2 - i], h_orig_fx[0] ); // Q13 move16(); #ifdef ISSUE_1867_replace_overflow_libenc Lrr = L_mac_sat( Lrr, gh_fx[0], gh_fx[0] ); // Q27 //??sat Ldd = L_mac_sat( Ldd, gh_fx[0], xn_fx[0] ); // Q27 //??sat #else Lrr = L_mac_o( Lrr, gh_fx[0], gh_fx[0], &Overflow ); // Q27 Ldd = L_mac_o( Ldd, gh_fx[0], xn_fx[0], &Overflow ); // Q27 #endif dd_fx[i] = round_fx_sat( Ldd ); // Q11 rr_fx[i] = L_max( Lrr, 1 ); move32(); Loading Loading @@ -200,11 +179,8 @@ void set_impulse_fx( FOR( i = L_SUBFR - 2; i >= start2; i-- ) { /*rr[i] = rr[i+1] + gh[L_SUBFR+L_IMPULSE2-1-i]*gh[L_SUBFR+L_IMPULSE2-1-i];*/ #ifdef ISSUE_1867_replace_overflow_libenc rr_fx[i] = L_mac_sat( rr_fx[i + 1], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i] ); // Q27 //??sat #else rr_fx[i] = L_mac_o( rr_fx[i + 1], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i], &Overflow ); // Q27 #endif rr_fx[i] = L_mac_o( rr_fx[i + 1], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i], gh_fx[L_SUBFR + L_IMPULSE2 - 1 - i], &Overflow ); // Q27 move32(); } /* nominator rows <L_IMPULSE2,L_SUBFR-1> */ Loading @@ -226,8 +202,8 @@ void set_impulse_fx( num = div_s( num, den ); #ifdef ISSUE_1867_replace_overflow_libenc krit_fx = shr_sat( num, sub( sub( shl_sat( exp_num, 1 ), exp_den ), 2 ) ); /* Q18 */ //??sat #ifdef ISSUE_1796_replace_shl_o krit_fx = shr_sat( num, sub( sub( shl_sat( exp_num, 1 ), exp_den ), 2 ) ); /* Q18 */ #else krit_fx = shr_sat( num, sub( sub( shl_o( exp_num, 1, &Overflow ), exp_den ), 2 ) ); /* Q18 */ #endif Loading
lib_enc/sig_clas_fx.c +0 −12 Original line number Diff line number Diff line Loading @@ -56,11 +56,9 @@ Word16 signal_clas_fx( /* o : classification for current Word16 i, clas, pc, zc, lo, lo2, hi, hi2, exp_ee, frac_ee; Word16 tmp16, tmpS; const Word16 *pt1; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /*----------------------------------------------------------------* Loading Loading @@ -155,11 +153,7 @@ Word16 signal_clas_fx( /* o : classification for current Ltmp = L_mac( Ltmp, relEn, 10923 ); Ltmp = L_mac( Ltmp, pcn, 10923 ); #ifdef ISSUE_1867_replace_overflow_libenc fmerit1 = round_fx_sat( L_shl_sat( Ltmp, 16 - 10 - 1 ) ); /* fmerit1 ->Q15 */ //??sat //??sat #else fmerit1 = round_fx_o( L_shl_o( Ltmp, 16 - 10 - 1, &Overflow ), &Overflow ); /* fmerit1 ->Q15 */ #endif /*-----------------------------------------------------------------* * FEC classification Loading Loading @@ -293,11 +287,9 @@ Word16 signal_clas_ivas_fx( /* o : classification for cur Word16 tmp16, tmpS; const Word16 *pt1; Word64 tmp64; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif /*----------------------------------------------------------------* Loading Loading @@ -393,11 +385,7 @@ Word16 signal_clas_ivas_fx( /* o : classification for cur Ltmp = L_mac( Ltmp, relEn, 10923 ); Ltmp = L_mac( Ltmp, pcn, 10923 ); #ifdef ISSUE_1867_replace_overflow_libenc fmerit1 = round_fx_sat( L_shl_sat( Ltmp, 16 - 10 - 1 ) ); /* fmerit1 ->Q15 */ //??sat //??sat #else fmerit1 = round_fx_o( L_shl_o( Ltmp, 16 - 10 - 1, &Overflow ), &Overflow ); /* fmerit1 ->Q15 */ #endif /*-----------------------------------------------------------------* * FEC classification Loading
lib_enc/speech_music_classif_fx.c +4 −66 Original line number Diff line number Diff line Loading @@ -662,11 +662,9 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis Word16 tmp1, tmp2, exp2, scale, exp3; SP_MUS_CLAS_HANDLE hSpMusClas = st_fx->hSpMusClas; HQ_ENC_HANDLE hHQ_core = st_fx->hHQ_core; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); #endif #endif /*------------------------------------------------------------------* Loading Loading @@ -796,18 +794,10 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis sum_PS = L_deposit_l( 0 ); FOR( i = LOWEST_FBIN; i < HIGHEST_FBIN; i++ ) { #ifdef ISSUE_1867_replace_overflow_libenc sum_PS = L_add_sat( sum_PS, PS[i] ); //??sat #else sum_PS = L_add_o( sum_PS, PS[i], &Overflow ); #endif } exp1 = norm_l( sum_PS ); #ifdef ISSUE_1867_replace_overflow_libenc tmp1 = round_fx_sat( L_shl( sum_PS, exp1 ) ); //??sat #else tmp1 = round_fx_o( L_shl( sum_PS, exp1 ), &Overflow ); #endif exp1 = sub( 30, exp1 ); FOR( i = LOWEST_FBIN; i < HIGHEST_FBIN; i++ ) Loading @@ -815,11 +805,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis /*PS_norm[i] = PS[i] / sum_PS;*/ /*dPS[i] = (float)fabs(PS_norm[i] - st->past_PS[i]);*/ exp2 = norm_l( PS[i] ); #ifdef ISSUE_1867_replace_overflow_libenc tmp2 = round_fx_sat( L_shl( PS[i], exp2 ) ); //??sat #else tmp2 = round_fx_o( L_shl( PS[i], exp2 ), &Overflow ); #endif exp2 = sub( 30, exp2 ); scale = shr( sub( tmp1, tmp2 ), 15 ); Loading Loading @@ -880,11 +866,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis ELSE { exp1 = norm_l( L_add( dPS[i], 336 ) ); #ifdef ISSUE_1867_replace_overflow_libenc tmp1 = round_fx_sat( L_shl_sat( L_add( dPS[i], 336 ), exp1 ) ); //??sat //??sat #else tmp1 = round_fx_o( L_shl_o( L_add( dPS[i], 336 ), exp1, &Overflow ), &Overflow ); #endif exp1 = sub( 30, exp1 ); exp2 = norm_l( mx ); Loading Loading @@ -941,11 +923,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis FOR( i = 0; i < N_FEATURES; i++ ) { /**pFV = pSF[0] * *pFV + pSF[1];*/ #ifdef ISSUE_1867_replace_overflow_libenc *pFV = round_fx_sat( L_shl_sat( L_mac( pSF_a[i], *pFV, pSF_m[i] ), ishift[i] ) ); //??sat //??sat #else *pFV = round_fx_o( L_shl_o( L_mac( pSF_a[i], *pFV, pSF_m[i] ), ishift[i], &Overflow ), &Overflow ); #endif move16(); pFV++; } Loading Loading @@ -976,11 +954,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis FOR( p = 0; p < N_FEATURES; p++ ) { /* xm[p] = FV[p] - m_speech[k*N_FEATURES+p];*/ #ifdef ISSUE_1867_replace_overflow_libenc xm[p] = sub_sat( FV[p], m_speech_fx[k * N_FEATURES + p] ); //??sat #else xm[p] = sub_o( FV[p], m_speech_fx[k * N_FEATURES + p], &Overflow ); #endif move16(); /*Q15 */ } Loading @@ -996,11 +970,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis FOR( p = 0; p < N_FEATURES; p++ ) { /*xm[p] = FV[p] - m_noise[k*N_FEATURES+p];*/ #ifdef ISSUE_1867_replace_overflow_libenc xm[p] = sub_sat( FV[p], m_noise_fx[k * N_FEATURES + p] ); //??sat #else xm[p] = sub_o( FV[p], m_noise_fx[k * N_FEATURES + p], &Overflow ); #endif move16(); /*Q15 */ } Loading @@ -1015,11 +985,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis FOR( p = 0; p < N_FEATURES; p++ ) { /*xm[p] = FV[p] - m_music[k*N_FEATURES+p];*/ #ifdef ISSUE_1867_replace_overflow_libenc xm[p] = sub_sat( FV[p], m_music_fx[k * N_FEATURES + p] ); //??sat #else xm[p] = sub_o( FV[p], m_music_fx[k * N_FEATURES + p], &Overflow ); #endif move16(); /*Q15 */ } Loading @@ -1033,11 +999,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis /* calculate log-probability */ /*log(0.0001)-0.5f * N_FEATURES * LOG_PI2 in Q9 */ #ifdef ISSUE_1867_replace_overflow_libenc lps = extract_h( L_shl_sat( L_sub( max_s, LOG_PROB_CONST ), 16 - 1 ) ); /*Q9 */ //??sat #else lps = extract_h( L_shl_o( L_sub( max_s, LOG_PROB_CONST ), 16 - 1, &Overflow ) ); /*Q9 */ #endif lps = s_max( lps, -10832 ); lpm = extract_h( L_shl( L_sub( max_m, LOG_PROB_CONST ), 16 - 1 ) ); /*Q9 */ Loading @@ -1045,11 +1007,7 @@ static Word16 sp_mus_classif_gmm_fx( /* o : decis /* lpn = (float)log(pyn) - 0.5f * N_FEATURES * (float)log(2*PI); */ #ifdef ISSUE_1867_replace_overflow_libenc lpn = extract_h( L_shl_sat( L_sub( max_n, LOG_PROB_CONST ), 16 - 1 ) ); /*Q9 */ //??sat #else lpn = extract_h( L_shl_o( L_sub( max_n, LOG_PROB_CONST ), 16 - 1, &Overflow ) ); /*Q9 */ #endif lpn = s_max( lpn, -10832 ); *high_lpn_flag_ptr = 0; Loading Loading @@ -1501,11 +1459,9 @@ static Word16 attack_det_fx( /* o : attack flag Word16 i, j, tmp, tmp1, attack, exp1; Word32 L_tmp, etmp, etmp2, finc[ATT_NSEG]; Word16 att_3lsub_pos; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); #endif #endif att_3lsub_pos = ATT_3LSUB_POS; Loading @@ -1523,11 +1479,7 @@ static Word16 attack_det_fx( /* o : attack flag FOR( j = 1; j < ATT_SEG_LEN; j++ ) { #ifdef ISSUE_1867_replace_overflow_libenc L_tmp = L_mac0_sat( L_tmp, inp[i * ATT_SEG_LEN + j], inp[i * ATT_SEG_LEN + j] ); /*2*Qx */ //??sat #else L_tmp = L_mac0_o( L_tmp, inp[i * ATT_SEG_LEN + j], inp[i * ATT_SEG_LEN + j], &Overflow ); /*2*Qx */ #endif } finc[i] = L_tmp; Loading @@ -1552,11 +1504,7 @@ static Word16 attack_det_fx( /* o : attack flag FOR( i = 1; i < att_3lsub_pos; i++ ) { #ifdef ISSUE_1867_replace_overflow_libenc L_tmp = L_add_sat( L_tmp, L_shr_sat( finc[i], Qx ) ); /*Qx */ //??sat //??sat #else L_tmp = L_add_o( L_tmp, L_shr_sat( finc[i], Qx ), &Overflow ); /*Qx */ #endif } L_tmp = Mult_32_16( L_tmp, tmp ); /*Q(14-exp1+Qx) */ etmp = L_shl( L_tmp, sub( exp1, 14 ) ); /*Qx */ Loading @@ -1568,11 +1516,7 @@ static Word16 attack_det_fx( /* o : attack flag L_tmp = L_shr_sat( finc[attack], Qx ); /*Qx */ FOR( i = 1; i < tmp1; i++ ) { #ifdef ISSUE_1867_replace_overflow_libenc L_tmp = L_add_sat( L_tmp, L_shr_sat( finc[i + attack], Qx ) ); /*Qx */ //??sat //??sat #else L_tmp = L_add_o( L_tmp, L_shr_sat( finc[i + attack], Qx ), &Overflow ); /*Qx */ #endif } L_tmp = Mult_32_16( L_tmp, tmp ); /*Q(14-exp1+Qx) */ etmp2 = L_shl( L_tmp, sub( exp1, 14 ) ); /*Qx */ Loading Loading @@ -2671,11 +2615,9 @@ static Word16 attack_det_ivas_fx( /* o : attack flag Word64 W_tmp; Word16 q_diff; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif att_3lsub_pos = ATT_3LSUB_POS; Loading @@ -2693,11 +2635,7 @@ static Word16 attack_det_ivas_fx( /* o : attack flag FOR( j = 1; j < ATT_SEG_LEN; j++ ) { #ifdef ISSUE_1867_replace_overflow_libenc L_tmp = L_mac0_sat( L_tmp, inp[i * ATT_SEG_LEN + j], inp[i * ATT_SEG_LEN + j] ); /*2*Qx */ //??sat #else L_tmp = L_mac0_o( L_tmp, inp[i * ATT_SEG_LEN + j], inp[i * ATT_SEG_LEN + j], &Overflow ); /*2*Qx */ #endif } finc[i] = L_tmp; Loading
lib_enc/stat_noise_uv_enc_fx.c +6 −26 Original line number Diff line number Diff line Loading @@ -50,11 +50,9 @@ void stat_noise_uv_enc_fx( Word16 noisiness = 0; move16(); Word16 num, den, expn, expd; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move16(); #endif #endif test(); test(); Loading @@ -67,17 +65,9 @@ void stat_noise_uv_enc_fx( *-----------------------------------------------------------------*/ /* epsP[2] is located in LepsP[0] and epsP[16] in LepsP[1] */ expn = sub( norm_l( LepsP[0] ), 1 ); #ifdef ISSUE_1867_replace_overflow_libenc num = extract_h( L_shl( LepsP[0], expn ) ); /*expn-16*/ #else num = extract_h( L_shl_o( LepsP[0], expn, &Overflow ) ); /*expn-16*/ #endif expd = norm_l( LepsP[1] ); #ifdef ISSUE_1867_replace_overflow_libenc den = extract_h( L_shl( LepsP[1], expd ) ); /*expd-16*/ #else den = extract_h( L_shl_o( LepsP[1], expd, &Overflow ) ); /*expd-16*/ #endif num = div_s( num, den ); /*expn-expd+15*/ num = shr_sat( num, add( sub( expn, expd ), 5 ) ); /*Q10*/ num = sub( num, 1024 ); /*num - 1*/ Loading Loading @@ -133,11 +123,9 @@ void stat_noise_uv_enc_ivas_fx( Word16 noisiness = 0; move16(); Word16 num, den, expn, expd; #ifndef ISSUE_1867_replace_overflow_libenc #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); #endif #endif test(); test(); Loading @@ -150,17 +138,9 @@ void stat_noise_uv_enc_ivas_fx( *-----------------------------------------------------------------*/ /* epsP[2] is located in LepsP[0] and epsP[16] in LepsP[1] */ expn = sub( norm_l( LepsP[0] ), 1 ); #ifdef ISSUE_1867_replace_overflow_libenc num = extract_h( L_shl( LepsP[0], expn ) ); /*expn-16*/ #else num = extract_h( L_shl_o( LepsP[0], expn, &Overflow ) ); /*expn-16*/ #endif expd = norm_l( LepsP[1] ); #ifdef ISSUE_1867_replace_overflow_libenc den = extract_h( L_shl( LepsP[1], expd ) ); /*expd-16*/ #else den = extract_h( L_shl_o( LepsP[1], expd, &Overflow ) ); /*expd-16*/ #endif num = div_s( num, den ); /*expn-expd+15*/ num = shr_sat( num, add( sub( expn, expd ), 5 ) ); /*Q10*/ num = sub( num, 1024 ); /*num - 1*/ Loading