Loading lib_com/basop_util.c +13 −0 Original line number Diff line number Diff line Loading @@ -370,7 +370,11 @@ static Word32 Sqrt32_common(Word32 m, if (m != 0) { BASOP_SATURATE_WARNING_OFF_EVS; #ifdef BASOP_NOGLOB m = L_mac_sat( SqrtTable[index], SqrtDiffTable[index], frac ); #else m = L_mac(SqrtTable[index], SqrtDiffTable[index], frac); #endif BASOP_SATURATE_WARNING_ON_EVS; } Loading Loading @@ -654,8 +658,13 @@ void BASOP_Util_Sqrt_InvSqrt_MantExp(Word16 mantissa, /*!< mantissa */ /* interpolate */ BASOP_SATURATE_WARNING_OFF_EVS; #ifdef BASOP_NOGLOB m = mac_r_sat( SqrtTable[index], SqrtDiffTable[index], frac ); mi = msu_r_sat(ISqrtTable[index], ISqrtDiffTable[index], frac); #else m = mac_r(SqrtTable[index], SqrtDiffTable[index], frac); mi = msu_r(ISqrtTable[index], ISqrtDiffTable[index], frac); #endif BASOP_SATURATE_WARNING_ON_EVS; /* handle even/odd exponents */ Loading Loading @@ -2040,7 +2049,11 @@ Word16 BASOP_Util_Cmp_Mant32Exp /*!< o: flag: result of compari } BASOP_SATURATE_WARNING_OFF_EVS #ifdef BASOP_NOGLOB diff_m = L_sub_sat( a_m, b_m ); #else diff_m = L_sub(a_m, b_m); #endif BASOP_SATURATE_WARNING_ON_EVS diff_e = sub(a_e, b_e); Loading lib_com/bitalloc_fx.c +5 −2 Original line number Diff line number Diff line Loading @@ -371,8 +371,11 @@ Word16 BitAllocF_fx ( exp1 = sub(norm_l(L_tmp1), 1); exp2 = norm_s(n); tmp = div_s(extract_h(L_shl(L_tmp1, exp1)), shl(n, exp2));/*15 + 15 + exp1 - 16 - exp2*/ #ifdef BASOP_NOGLOB m_fx = shl_sat( tmp, sub( exp2, exp1 ) ); /*Q14*/ #else m_fx = shl( tmp, sub( exp2, exp1 ) ); /*Q14*/ #endif t_fx = L_deposit_l(0); n = 0; move16(); Loading lib_com/cldfb_evs.c +18 −0 Original line number Diff line number Diff line Loading @@ -505,7 +505,11 @@ void cldfbAnalysisFiltering( HANDLE_CLDFB_FILTER_BANK cldfbBank, /* move and scale filter states */ FOR (i=0; i<offset; i++) { #ifdef BASOP_NOGLOB pStates[i] = shl_sat( pStates[i + nSamplesUpd], scale ); #else pStates[i] = shl(pStates[i+nSamplesUpd], scale); #endif move16(); } Loading @@ -513,7 +517,11 @@ void cldfbAnalysisFiltering( HANDLE_CLDFB_FILTER_BANK cldfbBank, scale = sub(timeIn_e, cldfbBank->FilterStates_eg); FOR (i=0; i<nSamples; i++) { #ifdef BASOP_NOGLOB pStates[offset + i] = shl_sat( *timeIn, scale ); #else pStates[offset+i] = shl(*timeIn, scale); #endif move16(); timeIn = timeIn + stride; } Loading Loading @@ -1163,8 +1171,13 @@ AnalysisPostSpectrumScaling_Fx (HANDLE_CLDFB_FILTER_BANK cldfbBank, /*!< Handle { FOR (j=0; j < cldfbBank->no_channels; j++) { #ifdef BASOP_NOGLOB rSubband16[i][j] = round_fx_sat( L_shl_sat( rSubband32[i][j], headRoom ) ); iSubband16[i][j] = round_fx_sat(L_shl_sat(iSubband32[i][j], headRoom)); #else rSubband16[i][j] = round_fx(L_shl(rSubband32[i][j], headRoom)); iSubband16[i][j] = round_fx(L_shl(iSubband32[i][j], headRoom)); #endif } } Loading Loading @@ -1404,8 +1417,13 @@ GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) | p sm = sub(s_min(s, 44), 1); BASOP_SATURATE_WARNING_OFF_EVS /* nrg + 6.1e-5f => value 0x40000000, scale 44 */ #ifdef BASOP_NOGLOB *energyLookahead = L_add_sat( L_shr_sat( nrg, sub( s, sm ) ), L_shr_sat(0x40000000, s_max(-31, s_min(31, sub(44, sm))))); #else *energyLookahead = L_add(L_shr(nrg, sub(s, sm)), L_shr(0x40000000, s_max(-31, s_min(31, sub(44, sm))))); #endif move32(); BASOP_SATURATE_WARNING_ON_EVS *sf_energyLookahead = sm; Loading lib_com/cng_exc_fx.c +24 −0 Original line number Diff line number Diff line Loading @@ -199,7 +199,11 @@ void CNG_exc_fx( *------------------------------------------------------------*/ L_tmp = Mult_32_16(*lp_ener, Random(cng_ener_seed)); L_tmp = Mult_32_16(L_tmp, GAIN_VAR); #ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, *lp_ener ); #else L_tmp = L_add(L_tmp, *lp_ener); #endif L_tmp = L_max(L_tmp, 1); /* enr = dot_product( exc2, exc2, L_SUBFR ) + 0.01f */ Loading Loading @@ -327,7 +331,11 @@ void CNG_exc_fx( #endif L_tmp = L_shr(L_tmp,1);/* 2*Q_exc+6 */ tmp = add(Q_exc,Q_exc); #ifdef BASOP_NOGLOB env[i] = L_shr_sat( L_tmp, tmp ); #else env[i] = L_shr(L_tmp,tmp); #endif move32();/* Q6 */ ptR++; ptI--; Loading @@ -336,8 +344,13 @@ void CNG_exc_fx( FOR ( i=0; i<NUM_ENV_CNG; i++ ) { /* denv[i] = lp_env[i] + 2*(*lp_ener) - env[i]; */ #ifdef BASOP_NOGLOB L_tmp = L_add_sat( *lp_ener, *lp_ener ); denv[i] = L_sub_sat(L_add_sat(lp_env[i],L_tmp),env[i]); #else L_tmp = L_add(*lp_ener,*lp_ener); denv[i] = L_sub(L_add(lp_env[i],L_tmp),env[i]); #endif move32();/* Q6 */ if ( denv[i] < 0 ) Loading Loading @@ -371,8 +384,13 @@ void CNG_exc_fx( /* itmp[i] += own_random( cng_ener_seed1 )*denv[i]*0.000011f + denv[i]; */ L_tmp = Mult_32_16(denv[i], Random(cng_ener_seed1)); L_tmp = Mult_32_16(L_tmp, GAIN_VAR); #ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, denv[i] ); itmp[i] = L_add_sat(L_tmp, itmp[i]); #else L_tmp = L_add(L_tmp, denv[i]); itmp[i] = L_add(L_tmp, itmp[i]); #endif move32();/* Q6 */ if (itmp[i] < 0) Loading Loading @@ -538,9 +556,15 @@ void CNG_exc_fx( { L_tmp = L_mult0(*pt_fft_io, *pt_fft_io); pt_fft_io++; #ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, *pt_fft_io, *pt_fft_io ); /* 2*(Q_exc) */ pt_fft_io++; L_tmp2 = L_add_sat(L_tmp2, L_shr(L_tmp, 7)); /* 2*(Q_exc)+1, divide by L_frame done here */ #else L_tmp = L_mac0(L_tmp, *pt_fft_io, *pt_fft_io); /* 2*(Q_exc) */ pt_fft_io++; L_tmp2 = L_add(L_tmp2, L_shr(L_tmp, 7)); /* 2*(Q_exc)+1, divide by L_frame done here */ #endif } } ELSE /* L_FRAME16k */ Loading lib_com/codec_tcx_common.c +8 −0 Original line number Diff line number Diff line Loading @@ -41,7 +41,11 @@ Word16 tcxGetNoiseFillingTilt( Copy_Scale_sig(A, As, lpcorder + 1, sub(norm_s(A[0]),2)); tmp = get_gain(As + 1, As, lpcorder); BASOP_SATURATE_WARNING_OFF_EVS; #ifdef BASOP_NOGLOB *noiseTiltFactor = add_sat( round_fx_sat( L_shl_sat( tmp, 15 ) ), 3072 /*0.09375f Q15*/ ); #else *noiseTiltFactor = add(round_fx(L_shl(tmp, 15)), 3072/*0.09375f Q15*/); #endif move16(); BASOP_SATURATE_WARNING_ON_EVS; } Loading Loading @@ -186,7 +190,11 @@ void tcxFormantEnhancement( { fac = add(fac0, mult(d, extract_l(L_mult0(j, inv_int[n])))); BASOP_SATURATE_WARNING_OFF_EVS; #ifdef BASOP_NOGLOB xn_buf[l + j] = s_min( xn_one, shl_sat( mult( xn_buf[l + j], fac ), fac_e ) ); #else xn_buf[l + j] = s_min(xn_one, shl(mult(xn_buf[l + j], fac), fac_e)); #endif move16(); BASOP_SATURATE_WARNING_ON_EVS; } Loading Loading
lib_com/basop_util.c +13 −0 Original line number Diff line number Diff line Loading @@ -370,7 +370,11 @@ static Word32 Sqrt32_common(Word32 m, if (m != 0) { BASOP_SATURATE_WARNING_OFF_EVS; #ifdef BASOP_NOGLOB m = L_mac_sat( SqrtTable[index], SqrtDiffTable[index], frac ); #else m = L_mac(SqrtTable[index], SqrtDiffTable[index], frac); #endif BASOP_SATURATE_WARNING_ON_EVS; } Loading Loading @@ -654,8 +658,13 @@ void BASOP_Util_Sqrt_InvSqrt_MantExp(Word16 mantissa, /*!< mantissa */ /* interpolate */ BASOP_SATURATE_WARNING_OFF_EVS; #ifdef BASOP_NOGLOB m = mac_r_sat( SqrtTable[index], SqrtDiffTable[index], frac ); mi = msu_r_sat(ISqrtTable[index], ISqrtDiffTable[index], frac); #else m = mac_r(SqrtTable[index], SqrtDiffTable[index], frac); mi = msu_r(ISqrtTable[index], ISqrtDiffTable[index], frac); #endif BASOP_SATURATE_WARNING_ON_EVS; /* handle even/odd exponents */ Loading Loading @@ -2040,7 +2049,11 @@ Word16 BASOP_Util_Cmp_Mant32Exp /*!< o: flag: result of compari } BASOP_SATURATE_WARNING_OFF_EVS #ifdef BASOP_NOGLOB diff_m = L_sub_sat( a_m, b_m ); #else diff_m = L_sub(a_m, b_m); #endif BASOP_SATURATE_WARNING_ON_EVS diff_e = sub(a_e, b_e); Loading
lib_com/bitalloc_fx.c +5 −2 Original line number Diff line number Diff line Loading @@ -371,8 +371,11 @@ Word16 BitAllocF_fx ( exp1 = sub(norm_l(L_tmp1), 1); exp2 = norm_s(n); tmp = div_s(extract_h(L_shl(L_tmp1, exp1)), shl(n, exp2));/*15 + 15 + exp1 - 16 - exp2*/ #ifdef BASOP_NOGLOB m_fx = shl_sat( tmp, sub( exp2, exp1 ) ); /*Q14*/ #else m_fx = shl( tmp, sub( exp2, exp1 ) ); /*Q14*/ #endif t_fx = L_deposit_l(0); n = 0; move16(); Loading
lib_com/cldfb_evs.c +18 −0 Original line number Diff line number Diff line Loading @@ -505,7 +505,11 @@ void cldfbAnalysisFiltering( HANDLE_CLDFB_FILTER_BANK cldfbBank, /* move and scale filter states */ FOR (i=0; i<offset; i++) { #ifdef BASOP_NOGLOB pStates[i] = shl_sat( pStates[i + nSamplesUpd], scale ); #else pStates[i] = shl(pStates[i+nSamplesUpd], scale); #endif move16(); } Loading @@ -513,7 +517,11 @@ void cldfbAnalysisFiltering( HANDLE_CLDFB_FILTER_BANK cldfbBank, scale = sub(timeIn_e, cldfbBank->FilterStates_eg); FOR (i=0; i<nSamples; i++) { #ifdef BASOP_NOGLOB pStates[offset + i] = shl_sat( *timeIn, scale ); #else pStates[offset+i] = shl(*timeIn, scale); #endif move16(); timeIn = timeIn + stride; } Loading Loading @@ -1163,8 +1171,13 @@ AnalysisPostSpectrumScaling_Fx (HANDLE_CLDFB_FILTER_BANK cldfbBank, /*!< Handle { FOR (j=0; j < cldfbBank->no_channels; j++) { #ifdef BASOP_NOGLOB rSubband16[i][j] = round_fx_sat( L_shl_sat( rSubband32[i][j], headRoom ) ); iSubband16[i][j] = round_fx_sat(L_shl_sat(iSubband32[i][j], headRoom)); #else rSubband16[i][j] = round_fx(L_shl(rSubband32[i][j], headRoom)); iSubband16[i][j] = round_fx(L_shl(iSubband32[i][j], headRoom)); #endif } } Loading Loading @@ -1404,8 +1417,13 @@ GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead) | p sm = sub(s_min(s, 44), 1); BASOP_SATURATE_WARNING_OFF_EVS /* nrg + 6.1e-5f => value 0x40000000, scale 44 */ #ifdef BASOP_NOGLOB *energyLookahead = L_add_sat( L_shr_sat( nrg, sub( s, sm ) ), L_shr_sat(0x40000000, s_max(-31, s_min(31, sub(44, sm))))); #else *energyLookahead = L_add(L_shr(nrg, sub(s, sm)), L_shr(0x40000000, s_max(-31, s_min(31, sub(44, sm))))); #endif move32(); BASOP_SATURATE_WARNING_ON_EVS *sf_energyLookahead = sm; Loading
lib_com/cng_exc_fx.c +24 −0 Original line number Diff line number Diff line Loading @@ -199,7 +199,11 @@ void CNG_exc_fx( *------------------------------------------------------------*/ L_tmp = Mult_32_16(*lp_ener, Random(cng_ener_seed)); L_tmp = Mult_32_16(L_tmp, GAIN_VAR); #ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, *lp_ener ); #else L_tmp = L_add(L_tmp, *lp_ener); #endif L_tmp = L_max(L_tmp, 1); /* enr = dot_product( exc2, exc2, L_SUBFR ) + 0.01f */ Loading Loading @@ -327,7 +331,11 @@ void CNG_exc_fx( #endif L_tmp = L_shr(L_tmp,1);/* 2*Q_exc+6 */ tmp = add(Q_exc,Q_exc); #ifdef BASOP_NOGLOB env[i] = L_shr_sat( L_tmp, tmp ); #else env[i] = L_shr(L_tmp,tmp); #endif move32();/* Q6 */ ptR++; ptI--; Loading @@ -336,8 +344,13 @@ void CNG_exc_fx( FOR ( i=0; i<NUM_ENV_CNG; i++ ) { /* denv[i] = lp_env[i] + 2*(*lp_ener) - env[i]; */ #ifdef BASOP_NOGLOB L_tmp = L_add_sat( *lp_ener, *lp_ener ); denv[i] = L_sub_sat(L_add_sat(lp_env[i],L_tmp),env[i]); #else L_tmp = L_add(*lp_ener,*lp_ener); denv[i] = L_sub(L_add(lp_env[i],L_tmp),env[i]); #endif move32();/* Q6 */ if ( denv[i] < 0 ) Loading Loading @@ -371,8 +384,13 @@ void CNG_exc_fx( /* itmp[i] += own_random( cng_ener_seed1 )*denv[i]*0.000011f + denv[i]; */ L_tmp = Mult_32_16(denv[i], Random(cng_ener_seed1)); L_tmp = Mult_32_16(L_tmp, GAIN_VAR); #ifdef BASOP_NOGLOB L_tmp = L_add_sat( L_tmp, denv[i] ); itmp[i] = L_add_sat(L_tmp, itmp[i]); #else L_tmp = L_add(L_tmp, denv[i]); itmp[i] = L_add(L_tmp, itmp[i]); #endif move32();/* Q6 */ if (itmp[i] < 0) Loading Loading @@ -538,9 +556,15 @@ void CNG_exc_fx( { L_tmp = L_mult0(*pt_fft_io, *pt_fft_io); pt_fft_io++; #ifdef BASOP_NOGLOB L_tmp = L_mac0_sat( L_tmp, *pt_fft_io, *pt_fft_io ); /* 2*(Q_exc) */ pt_fft_io++; L_tmp2 = L_add_sat(L_tmp2, L_shr(L_tmp, 7)); /* 2*(Q_exc)+1, divide by L_frame done here */ #else L_tmp = L_mac0(L_tmp, *pt_fft_io, *pt_fft_io); /* 2*(Q_exc) */ pt_fft_io++; L_tmp2 = L_add(L_tmp2, L_shr(L_tmp, 7)); /* 2*(Q_exc)+1, divide by L_frame done here */ #endif } } ELSE /* L_FRAME16k */ Loading
lib_com/codec_tcx_common.c +8 −0 Original line number Diff line number Diff line Loading @@ -41,7 +41,11 @@ Word16 tcxGetNoiseFillingTilt( Copy_Scale_sig(A, As, lpcorder + 1, sub(norm_s(A[0]),2)); tmp = get_gain(As + 1, As, lpcorder); BASOP_SATURATE_WARNING_OFF_EVS; #ifdef BASOP_NOGLOB *noiseTiltFactor = add_sat( round_fx_sat( L_shl_sat( tmp, 15 ) ), 3072 /*0.09375f Q15*/ ); #else *noiseTiltFactor = add(round_fx(L_shl(tmp, 15)), 3072/*0.09375f Q15*/); #endif move16(); BASOP_SATURATE_WARNING_ON_EVS; } Loading Loading @@ -186,7 +190,11 @@ void tcxFormantEnhancement( { fac = add(fac0, mult(d, extract_l(L_mult0(j, inv_int[n])))); BASOP_SATURATE_WARNING_OFF_EVS; #ifdef BASOP_NOGLOB xn_buf[l + j] = s_min( xn_one, shl_sat( mult( xn_buf[l + j], fac ), fac_e ) ); #else xn_buf[l + j] = s_min(xn_one, shl(mult(xn_buf[l + j], fac), fac_e)); #endif move16(); BASOP_SATURATE_WARNING_ON_EVS; } Loading