Loading lib_com/cng_exc_fx.c +10 −3 Original line number Diff line number Diff line Loading @@ -249,8 +249,11 @@ void CNG_exc_fx( exp = norm_l(*Enew); L_tmp = L_shl(*Enew,exp); /* Q(exp+6) */ L_tmp = Mult_32_16(L_tmp,shl(L_frame,5)); /* Q(exp+6+5-15=exp-4) */ #ifdef BASOP_NOGLOB L_tmp = L_shr_sat( L_tmp, sub( exp, 10 ) ); /* Q6 */ #else L_tmp = L_shr( L_tmp, sub( exp, 10 ) ); /* Q6 */ #endif exp = norm_l(L_tmp); fra = Log2_norm_lc(L_shl(L_tmp,exp)); exp = sub(sub(30,exp),6); Loading Loading @@ -545,7 +548,11 @@ 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) */ #else L_tmp = L_mac0( L_tmp, *pt_fft_io, *pt_fft_io ); /* 2*(Q_exc) */ #endif pt_fft_io++; L_tmp2 = L_add(L_tmp2, L_shr(Mult_32_16(L_tmp,26214 /* 256/320, Q15 */), 7)); /* 2*(Q_exc)+15+1-16+1, divide by L_frame done here */ } Loading lib_com/enhancer_fx.c +5 −1 Original line number Diff line number Diff line Loading @@ -245,7 +245,11 @@ void enhancer_fx( L_tmp = L_msu(L_tmp, code[i + 1], tmp); tmp16 = msu_r(L_tmp, code[i - 1], tmp); L_tmp = L_shl(L_mult(gain_code_hi, tmp16), sc); #ifdef BASOP_NOGLOB pt_exc2[i] = msu_r_sat( L_tmp, -32768, pt_exc2[i] ); #else pt_exc2[i] = msu_r( L_tmp, -32768, pt_exc2[i] ); #endif move16(); /* in Q_exc */ } Loading lib_com/fd_cng_com_fx.c +17 −4 Original line number Diff line number Diff line Loading @@ -574,7 +574,11 @@ void minimum_statistics ( { /* calculate scalar with normalized msPeriodogSum[cnt], exponent -2*s1 */ s1 = norm_l(msPeriodogSum[cnt]); #ifdef BASOP_NOGLOB msPeriodogSum16 = round_fx_sat( L_shl_sat( msPeriodogSum[cnt], s1 ) ); #else msPeriodogSum16 = round_fx( L_shl( msPeriodogSum[cnt], s1 ) ); #endif scalar = L_mult(msPeriodogSum16, msPeriodogSum16); /* calculate difference, both elements in 16Q15 format, use absolute value Loading Loading @@ -2168,8 +2172,13 @@ void AnalysisSTFT ( { move32(); move32(); #ifdef BASOP_NOGLOB fftBuffer[i + len] = L_mult( shr_sat( timeDomainInput[i], Q ), mult_r( olapWin[i].v.re, 23170 /*1.4142135623730950488016887242097 Q14*/ ) ); fftBuffer[i + len + len2] = L_mult( shr_sat( timeDomainInput[i + len2], Q ), mult_r( olapWin[len2 - 1 - i].v.im, 23170 /*1.4142135623730950488016887242097 Q14*/ ) ); #else fftBuffer[i + len] = L_mult( shr( timeDomainInput[i], Q ), mult_r( olapWin[i].v.re, 23170 /*1.4142135623730950488016887242097 Q14*/ ) ); fftBuffer[i + len + len2] = L_mult( shr( timeDomainInput[i + len2], Q ), mult_r( olapWin[len2 - 1 - i].v.im, 23170 /*1.4142135623730950488016887242097 Q14*/ ) ); #endif } /* Perform FFT */ Loading @@ -2177,7 +2186,11 @@ void AnalysisSTFT ( FOR (i=0; i <len ; i++) { #ifdef BASOP_NOGLOB olapBuffer[i] = shr_sat( timeDomainInput[sub( hFdCngCom->frameSize, len ) + i], Q ); #else olapBuffer[i] = shr( timeDomainInput[sub( hFdCngCom->frameSize, len ) + i], Q ); #endif move16(); } Loading lib_com/fft_fx_evs.c +10 −1 Original line number Diff line number Diff line Loading @@ -3341,12 +3341,21 @@ void ifft3_fx(const Word16 Z[], Word16 X[], const Word16 n) pX = X; FOR (i = 0; i < m; i++) { #ifdef BASOP_NOGLOB *pX++ = shl_sat( mult_r( *y0++, FFT3_ONE_THIRD ), 1 ); move16(); *pX++ = shl_sat( mult_r( *y1++, FFT3_ONE_THIRD ), 1 ); move16(); *pX++ = shl_sat( mult_r( *y2++, FFT3_ONE_THIRD ), 1 ); move16(); #else *pX++ = shl( mult_r( *y0++, FFT3_ONE_THIRD ), 1 ); move16(); *pX++ = shl(mult_r(*y1++, FFT3_ONE_THIRD), 1); move16(); *pX++ = shl(mult_r(*y2++, FFT3_ONE_THIRD), 1); move16(); #endif } return; Loading lib_com/gs_preech.c +10 −3 Original line number Diff line number Diff line Loading @@ -186,7 +186,11 @@ void pre_echo_att_fx( etmp_fx = L_shr(etmp_fx, add(2 + 1 - 4, shl(Q_new, 1)));/*2*Q_new+1 //INV_ATT_SEG_LEN=1/4(=shr(x,2)) -> Q4 */ etmp1_fx = etmp_fx; move32(); #ifdef BASOP_NOGLOB *Last_frame_ener_fx = L_shl_sat( *Last_frame_ener_fx, 2 ); #else *Last_frame_ener_fx = L_shl( *Last_frame_ener_fx, 2 ); #endif move32(); /*2*Q_new+1 */ /* If the maximum normalized energy > last frame energy + 6dB */ Loading @@ -213,8 +217,11 @@ void pre_echo_att_fx( exp = sub(n1, n2); frac1 = round_fx(L_shl(etmp_fx, n1)); #ifdef BASOP_NOGLOB frac2 = round_fx_sat( L_shl_sat( *Last_frame_ener_fx, n2 ) ); #else frac2 = round_fx( L_shl( *Last_frame_ener_fx, n2 ) ); #endif L_tmp = L_mult0(128, div_s(frac1, frac2)); /* s = gain_out / gain_in */ L_tmp = L_shr(L_tmp, exp); /* add exponent */ Loading Loading
lib_com/cng_exc_fx.c +10 −3 Original line number Diff line number Diff line Loading @@ -249,8 +249,11 @@ void CNG_exc_fx( exp = norm_l(*Enew); L_tmp = L_shl(*Enew,exp); /* Q(exp+6) */ L_tmp = Mult_32_16(L_tmp,shl(L_frame,5)); /* Q(exp+6+5-15=exp-4) */ #ifdef BASOP_NOGLOB L_tmp = L_shr_sat( L_tmp, sub( exp, 10 ) ); /* Q6 */ #else L_tmp = L_shr( L_tmp, sub( exp, 10 ) ); /* Q6 */ #endif exp = norm_l(L_tmp); fra = Log2_norm_lc(L_shl(L_tmp,exp)); exp = sub(sub(30,exp),6); Loading Loading @@ -545,7 +548,11 @@ 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) */ #else L_tmp = L_mac0( L_tmp, *pt_fft_io, *pt_fft_io ); /* 2*(Q_exc) */ #endif pt_fft_io++; L_tmp2 = L_add(L_tmp2, L_shr(Mult_32_16(L_tmp,26214 /* 256/320, Q15 */), 7)); /* 2*(Q_exc)+15+1-16+1, divide by L_frame done here */ } Loading
lib_com/enhancer_fx.c +5 −1 Original line number Diff line number Diff line Loading @@ -245,7 +245,11 @@ void enhancer_fx( L_tmp = L_msu(L_tmp, code[i + 1], tmp); tmp16 = msu_r(L_tmp, code[i - 1], tmp); L_tmp = L_shl(L_mult(gain_code_hi, tmp16), sc); #ifdef BASOP_NOGLOB pt_exc2[i] = msu_r_sat( L_tmp, -32768, pt_exc2[i] ); #else pt_exc2[i] = msu_r( L_tmp, -32768, pt_exc2[i] ); #endif move16(); /* in Q_exc */ } Loading
lib_com/fd_cng_com_fx.c +17 −4 Original line number Diff line number Diff line Loading @@ -574,7 +574,11 @@ void minimum_statistics ( { /* calculate scalar with normalized msPeriodogSum[cnt], exponent -2*s1 */ s1 = norm_l(msPeriodogSum[cnt]); #ifdef BASOP_NOGLOB msPeriodogSum16 = round_fx_sat( L_shl_sat( msPeriodogSum[cnt], s1 ) ); #else msPeriodogSum16 = round_fx( L_shl( msPeriodogSum[cnt], s1 ) ); #endif scalar = L_mult(msPeriodogSum16, msPeriodogSum16); /* calculate difference, both elements in 16Q15 format, use absolute value Loading Loading @@ -2168,8 +2172,13 @@ void AnalysisSTFT ( { move32(); move32(); #ifdef BASOP_NOGLOB fftBuffer[i + len] = L_mult( shr_sat( timeDomainInput[i], Q ), mult_r( olapWin[i].v.re, 23170 /*1.4142135623730950488016887242097 Q14*/ ) ); fftBuffer[i + len + len2] = L_mult( shr_sat( timeDomainInput[i + len2], Q ), mult_r( olapWin[len2 - 1 - i].v.im, 23170 /*1.4142135623730950488016887242097 Q14*/ ) ); #else fftBuffer[i + len] = L_mult( shr( timeDomainInput[i], Q ), mult_r( olapWin[i].v.re, 23170 /*1.4142135623730950488016887242097 Q14*/ ) ); fftBuffer[i + len + len2] = L_mult( shr( timeDomainInput[i + len2], Q ), mult_r( olapWin[len2 - 1 - i].v.im, 23170 /*1.4142135623730950488016887242097 Q14*/ ) ); #endif } /* Perform FFT */ Loading @@ -2177,7 +2186,11 @@ void AnalysisSTFT ( FOR (i=0; i <len ; i++) { #ifdef BASOP_NOGLOB olapBuffer[i] = shr_sat( timeDomainInput[sub( hFdCngCom->frameSize, len ) + i], Q ); #else olapBuffer[i] = shr( timeDomainInput[sub( hFdCngCom->frameSize, len ) + i], Q ); #endif move16(); } Loading
lib_com/fft_fx_evs.c +10 −1 Original line number Diff line number Diff line Loading @@ -3341,12 +3341,21 @@ void ifft3_fx(const Word16 Z[], Word16 X[], const Word16 n) pX = X; FOR (i = 0; i < m; i++) { #ifdef BASOP_NOGLOB *pX++ = shl_sat( mult_r( *y0++, FFT3_ONE_THIRD ), 1 ); move16(); *pX++ = shl_sat( mult_r( *y1++, FFT3_ONE_THIRD ), 1 ); move16(); *pX++ = shl_sat( mult_r( *y2++, FFT3_ONE_THIRD ), 1 ); move16(); #else *pX++ = shl( mult_r( *y0++, FFT3_ONE_THIRD ), 1 ); move16(); *pX++ = shl(mult_r(*y1++, FFT3_ONE_THIRD), 1); move16(); *pX++ = shl(mult_r(*y2++, FFT3_ONE_THIRD), 1); move16(); #endif } return; Loading
lib_com/gs_preech.c +10 −3 Original line number Diff line number Diff line Loading @@ -186,7 +186,11 @@ void pre_echo_att_fx( etmp_fx = L_shr(etmp_fx, add(2 + 1 - 4, shl(Q_new, 1)));/*2*Q_new+1 //INV_ATT_SEG_LEN=1/4(=shr(x,2)) -> Q4 */ etmp1_fx = etmp_fx; move32(); #ifdef BASOP_NOGLOB *Last_frame_ener_fx = L_shl_sat( *Last_frame_ener_fx, 2 ); #else *Last_frame_ener_fx = L_shl( *Last_frame_ener_fx, 2 ); #endif move32(); /*2*Q_new+1 */ /* If the maximum normalized energy > last frame energy + 6dB */ Loading @@ -213,8 +217,11 @@ void pre_echo_att_fx( exp = sub(n1, n2); frac1 = round_fx(L_shl(etmp_fx, n1)); #ifdef BASOP_NOGLOB frac2 = round_fx_sat( L_shl_sat( *Last_frame_ener_fx, n2 ) ); #else frac2 = round_fx( L_shl( *Last_frame_ener_fx, n2 ) ); #endif L_tmp = L_mult0(128, div_s(frac1, frac2)); /* s = gain_out / gain_in */ L_tmp = L_shr(L_tmp, exp); /* add exponent */ Loading