Loading lib_com/basop_util.c +4 −0 Original line number Diff line number Diff line Loading @@ -2022,7 +2022,11 @@ void bufferCopyFx( { FOR (i = 0 ; i < length ; i++) { #ifdef BASOP_NOGLOB *(dest+i) = shr_sat(*(src+i),tmp_16); #else *(dest+i) = shr(*(src+i),tmp_16); #endif move16(); } } Loading lib_com/fft_rel_fx.c +15 −0 Original line number Diff line number Diff line Loading @@ -290,6 +290,20 @@ static void c_fft_fx( kj = add(k, jj); /* kj is butterfly bottom */ /* Butterfly computations */ #ifdef BASOP_NOGLOB tmp1 = mac_r_sat(L_mult_sat(out_ptr[kj], table_ptr[ji]), out_ptr[kj+1], table_ptr[ji + 1]); tmp2 = msu_r_sat(L_mult_sat(out_ptr[kj+1], table_ptr[ji]), out_ptr[kj], table_ptr[ji+1]); out_ptr[kj] = sub_sat(out_ptr[k], tmp1); move16(); out_ptr[kj+1] = sub_sat(out_ptr[k+1], tmp2); move16(); out_ptr[k] = add_sat(out_ptr[k], tmp1); move16(); out_ptr[k+1] = add_sat(out_ptr[k+1], tmp2); move16(); #else tmp1 = mac_r(L_mult(out_ptr[kj], table_ptr[ji]), out_ptr[kj+1], table_ptr[ji + 1]); Loading @@ -304,6 +318,7 @@ static void c_fft_fx( move16(); out_ptr[k+1] = add(out_ptr[k+1], tmp2); move16(); #endif } ji = add(ji, ii); } Loading lib_com/hp50.c +4 −0 Original line number Diff line number Diff line Loading @@ -199,7 +199,11 @@ void hp20(Word16 signal[], /* i/o: signal to filter any * { prescale = s_min(prescale, diff); } #ifdef BASOP_NOGLOB diff = norm_l(L_shl_o(mem[3], prescaleOld, &Overflow)); #else diff = norm_l(L_shl(mem[3], prescaleOld)); #endif if (mem[3] != 0) { prescale = s_min(prescale, diff); Loading lib_com/hq_tools_fx.c +9 −0 Original line number Diff line number Diff line Loading @@ -1894,7 +1894,11 @@ void hq_wb_nf_bwe_fx( FOR( i = sfm_start[sfm]; i < sfm_end[sfm]; i++ ) { fabs_coeff_out_fx = L_abs(L_coeff_out[i]); #ifdef BASOP_NOGLOB mean_fx = L_add_sat(mean_fx, fabs_coeff_out_fx);/*Q12 */ #else mean_fx = L_add(mean_fx, fabs_coeff_out_fx);/*Q12 */ #endif if(GT_32(fabs_coeff_out_fx, peak_fx)) { peak_fx = fabs_coeff_out_fx;/*Q12 */ Loading @@ -1905,8 +1909,13 @@ void hq_wb_nf_bwe_fx( IF(mean_fx != 0) { exp = norm_l(mean_fx); #ifdef BASOP_NOGLOB mean_fx = L_shl_sat(mean_fx, exp);/*Q(exp+12) */ tmp = round_fx_sat(mean_fx);/*Q(exp-4) */ #else mean_fx = L_shl(mean_fx, exp);/*Q(exp+12) */ tmp = round_fx(mean_fx);/*Q(exp-4) */ #endif tmp = div_s(16384,tmp); /*Q(15+14-exp+4 = 33-exp) */ L_tmp = Mult_32_16(peak_fx, tmp);/*Q(12+33-exp-15 = 30-exp) */ tmp = shl(sfmsize[sfm], 9);/*Q9 */ Loading lib_com/tcx_ltp.c +29 −4 Original line number Diff line number Diff line Loading @@ -149,15 +149,25 @@ static void tcx_ltp_get_zir( move16(); FOR (i = 0; i < L; i++) { #ifdef BASOP_NOGLOB s = L_mac_sat(L_mac_sat(s, w0[k], x0[i]), w1[k], x1[-i]); s2 = L_mac_sat(L_mac_sat(s2, v0[k], y0[i]), v1[k], y1[-i]); #else s = L_mac(L_mac(s, w0[k], x0[i]), w1[k], x1[-i]); s2 = L_mac(L_mac(s2, v0[k], y0[i]), v1[k], y1[-i]); #endif k = add(k, pitres); } /* s2 *= ALPHA; buf[j] = ( synth[j] - gain * s2 ) - ( synth_ltp[j] - gain * s ); */ #ifdef BASOP_NOGLOB i = sub_sat(round_fx_sat(s), mult_r_sat(round_fx_sat(s2), ALPHA)); buf[j] = add_sat(sub_sat(synth[j], synth_ltp[j]), mult_r_sat(gain, i)); #else i = sub(round_fx(s), mult_r(round_fx(s2), ALPHA)); buf[j] = add(sub(synth[j], synth_ltp[j]), mult_r(gain, i)); #endif move16(); x0++; Loading Loading @@ -259,9 +269,7 @@ static void tcx_ltp_synth_filter( const Word16 *w0, *w1; Word16 alpha, step = 0; /* initialize just to avoid compiler warning */ Word16 i, j, k, L; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif IF (gain > 0) { x0 = &synth_ltp[-pitch_int]; Loading Loading @@ -312,8 +320,13 @@ static void tcx_ltp_synth_filter( move16(); FOR(i = 0; i < L; i++) { #ifdef BASOP_NOGLOB s = L_mac_sat(L_mac_sat(s, w0[k], x0[i]), w1[k], x1[-i]); s2 = L_mac_sat(L_mac_sat(s2, v0[k], y0[i]), v1[k], y1[-i]); #else s = L_mac(L_mac(s, w0[k], x0[i]), w1[k], x1[-i]); s2 = L_mac(L_mac(s2, v0[k], y0[i]), v1[k], y1[-i]); #endif k = add(k, pitch_res); } Loading @@ -321,11 +334,23 @@ static void tcx_ltp_synth_filter( normal: synth_ltp[j] = synth[j] - gain * s2 + gain * s; zir: synth_ltp[j] = synth[j] - gain * s2 + gain * s - zir[j]; fade-in/out: synth_ltp[j] = synth[j] - alpha * gain * s2 + alpha * gain * s; */ #ifdef BASOP_NOGLOB i = sub_sat(round_fx_sat(s), mult_r_sat(round_fx_sat(s2), ALPHA)); #else i = sub(round_fx(s), mult_r(round_fx(s2), ALPHA)); #endif k = mult_r(gain, i); if (fade != 0) k = mult_r(k, alpha); #ifdef BASOP_NOGLOB k = add_sat(synth[j], k); if (zir != NULL) { k = sub_sat(k, zir[j]); } #else k = add(synth[j], k); if (zir != NULL) k = sub(k, zir[j]); #endif synth_ltp[j] = k; move16(); Loading @@ -334,7 +359,7 @@ static void tcx_ltp_synth_filter( #ifdef BASOP_NOGLOB if (fade != 0) { alpha = add_o(alpha, step, &Overflow); alpha = add_sat(alpha, step); } #else if (fade != 0) alpha = add(alpha, step); Loading Loading
lib_com/basop_util.c +4 −0 Original line number Diff line number Diff line Loading @@ -2022,7 +2022,11 @@ void bufferCopyFx( { FOR (i = 0 ; i < length ; i++) { #ifdef BASOP_NOGLOB *(dest+i) = shr_sat(*(src+i),tmp_16); #else *(dest+i) = shr(*(src+i),tmp_16); #endif move16(); } } Loading
lib_com/fft_rel_fx.c +15 −0 Original line number Diff line number Diff line Loading @@ -290,6 +290,20 @@ static void c_fft_fx( kj = add(k, jj); /* kj is butterfly bottom */ /* Butterfly computations */ #ifdef BASOP_NOGLOB tmp1 = mac_r_sat(L_mult_sat(out_ptr[kj], table_ptr[ji]), out_ptr[kj+1], table_ptr[ji + 1]); tmp2 = msu_r_sat(L_mult_sat(out_ptr[kj+1], table_ptr[ji]), out_ptr[kj], table_ptr[ji+1]); out_ptr[kj] = sub_sat(out_ptr[k], tmp1); move16(); out_ptr[kj+1] = sub_sat(out_ptr[k+1], tmp2); move16(); out_ptr[k] = add_sat(out_ptr[k], tmp1); move16(); out_ptr[k+1] = add_sat(out_ptr[k+1], tmp2); move16(); #else tmp1 = mac_r(L_mult(out_ptr[kj], table_ptr[ji]), out_ptr[kj+1], table_ptr[ji + 1]); Loading @@ -304,6 +318,7 @@ static void c_fft_fx( move16(); out_ptr[k+1] = add(out_ptr[k+1], tmp2); move16(); #endif } ji = add(ji, ii); } Loading
lib_com/hp50.c +4 −0 Original line number Diff line number Diff line Loading @@ -199,7 +199,11 @@ void hp20(Word16 signal[], /* i/o: signal to filter any * { prescale = s_min(prescale, diff); } #ifdef BASOP_NOGLOB diff = norm_l(L_shl_o(mem[3], prescaleOld, &Overflow)); #else diff = norm_l(L_shl(mem[3], prescaleOld)); #endif if (mem[3] != 0) { prescale = s_min(prescale, diff); Loading
lib_com/hq_tools_fx.c +9 −0 Original line number Diff line number Diff line Loading @@ -1894,7 +1894,11 @@ void hq_wb_nf_bwe_fx( FOR( i = sfm_start[sfm]; i < sfm_end[sfm]; i++ ) { fabs_coeff_out_fx = L_abs(L_coeff_out[i]); #ifdef BASOP_NOGLOB mean_fx = L_add_sat(mean_fx, fabs_coeff_out_fx);/*Q12 */ #else mean_fx = L_add(mean_fx, fabs_coeff_out_fx);/*Q12 */ #endif if(GT_32(fabs_coeff_out_fx, peak_fx)) { peak_fx = fabs_coeff_out_fx;/*Q12 */ Loading @@ -1905,8 +1909,13 @@ void hq_wb_nf_bwe_fx( IF(mean_fx != 0) { exp = norm_l(mean_fx); #ifdef BASOP_NOGLOB mean_fx = L_shl_sat(mean_fx, exp);/*Q(exp+12) */ tmp = round_fx_sat(mean_fx);/*Q(exp-4) */ #else mean_fx = L_shl(mean_fx, exp);/*Q(exp+12) */ tmp = round_fx(mean_fx);/*Q(exp-4) */ #endif tmp = div_s(16384,tmp); /*Q(15+14-exp+4 = 33-exp) */ L_tmp = Mult_32_16(peak_fx, tmp);/*Q(12+33-exp-15 = 30-exp) */ tmp = shl(sfmsize[sfm], 9);/*Q9 */ Loading
lib_com/tcx_ltp.c +29 −4 Original line number Diff line number Diff line Loading @@ -149,15 +149,25 @@ static void tcx_ltp_get_zir( move16(); FOR (i = 0; i < L; i++) { #ifdef BASOP_NOGLOB s = L_mac_sat(L_mac_sat(s, w0[k], x0[i]), w1[k], x1[-i]); s2 = L_mac_sat(L_mac_sat(s2, v0[k], y0[i]), v1[k], y1[-i]); #else s = L_mac(L_mac(s, w0[k], x0[i]), w1[k], x1[-i]); s2 = L_mac(L_mac(s2, v0[k], y0[i]), v1[k], y1[-i]); #endif k = add(k, pitres); } /* s2 *= ALPHA; buf[j] = ( synth[j] - gain * s2 ) - ( synth_ltp[j] - gain * s ); */ #ifdef BASOP_NOGLOB i = sub_sat(round_fx_sat(s), mult_r_sat(round_fx_sat(s2), ALPHA)); buf[j] = add_sat(sub_sat(synth[j], synth_ltp[j]), mult_r_sat(gain, i)); #else i = sub(round_fx(s), mult_r(round_fx(s2), ALPHA)); buf[j] = add(sub(synth[j], synth_ltp[j]), mult_r(gain, i)); #endif move16(); x0++; Loading Loading @@ -259,9 +269,7 @@ static void tcx_ltp_synth_filter( const Word16 *w0, *w1; Word16 alpha, step = 0; /* initialize just to avoid compiler warning */ Word16 i, j, k, L; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif IF (gain > 0) { x0 = &synth_ltp[-pitch_int]; Loading Loading @@ -312,8 +320,13 @@ static void tcx_ltp_synth_filter( move16(); FOR(i = 0; i < L; i++) { #ifdef BASOP_NOGLOB s = L_mac_sat(L_mac_sat(s, w0[k], x0[i]), w1[k], x1[-i]); s2 = L_mac_sat(L_mac_sat(s2, v0[k], y0[i]), v1[k], y1[-i]); #else s = L_mac(L_mac(s, w0[k], x0[i]), w1[k], x1[-i]); s2 = L_mac(L_mac(s2, v0[k], y0[i]), v1[k], y1[-i]); #endif k = add(k, pitch_res); } Loading @@ -321,11 +334,23 @@ static void tcx_ltp_synth_filter( normal: synth_ltp[j] = synth[j] - gain * s2 + gain * s; zir: synth_ltp[j] = synth[j] - gain * s2 + gain * s - zir[j]; fade-in/out: synth_ltp[j] = synth[j] - alpha * gain * s2 + alpha * gain * s; */ #ifdef BASOP_NOGLOB i = sub_sat(round_fx_sat(s), mult_r_sat(round_fx_sat(s2), ALPHA)); #else i = sub(round_fx(s), mult_r(round_fx(s2), ALPHA)); #endif k = mult_r(gain, i); if (fade != 0) k = mult_r(k, alpha); #ifdef BASOP_NOGLOB k = add_sat(synth[j], k); if (zir != NULL) { k = sub_sat(k, zir[j]); } #else k = add(synth[j], k); if (zir != NULL) k = sub(k, zir[j]); #endif synth_ltp[j] = k; move16(); Loading @@ -334,7 +359,7 @@ static void tcx_ltp_synth_filter( #ifdef BASOP_NOGLOB if (fade != 0) { alpha = add_o(alpha, step, &Overflow); alpha = add_sat(alpha, step); } #else if (fade != 0) alpha = add(alpha, step); Loading