Loading lib_com/deemph_fx.c +5 −0 Original line number Diff line number Diff line Loading @@ -40,8 +40,13 @@ void deemph_fx( #endif /* BASOP_NOGLOB */ L_tmp = L_deposit_h(signal[0]); #ifdef BASOP_NOGLOB L_tmp = L_mac_o(L_tmp, *mem, mu, &Overflow); signal[0] = round_fx_o(L_tmp, &Overflow); #else L_tmp = L_mac(L_tmp, *mem, mu); signal[0] = round_fx(L_tmp); #endif FOR (i = 1; i < L; i++) { Loading lib_com/hq2_noise_inject_fx.c +16 −0 Original line number Diff line number Diff line Loading @@ -575,14 +575,22 @@ void hq2_noise_inject_fx( L_tmp = Mult_32_16(Ep_fx[k],tmp); /*Q(Q_Ep_fx[k]+28-Q_speech-15 = Q_Ep_fx[k]+13-Q_speech) */ tmp = sub(Q_Ep_fx[k],Q_speech); tmp = sub(15,tmp); #ifdef BASOP_NOGLOB tmp = extract_h(L_shl_o(L_tmp,tmp, &Overflow));/*Q12 */ #else tmp = extract_h(L_shl(L_tmp,tmp));/*Q12 */ #endif } ELSE { tmp = 0x7fff;/*Q0 */ L_tmp = Mult_32_16(Ep_fx[k],tmp); /*Q(Q_Ep_fx[k]+0-15 = Q_Ep_fx[k]-15) */ tmp = sub(43,Q_Ep_fx[k]); #ifdef BASOP_NOGLOB tmp = extract_h(L_shl_o(L_tmp,tmp, &Overflow));/*Q12 */ #else tmp = extract_h(L_shl(L_tmp,tmp));/*Q12 */ #endif } fac_fx = s_max(tmp,4096);/*Q12 */ Loading @@ -594,7 +602,11 @@ void hq2_noise_inject_fx( IF(band_width[k] != 0) { Q_speech = norm_s(band_width[k]); #ifdef BASOP_NOGLOB tmp = shl_o(band_width[k],Q_speech, &Overflow);/*Q(Q_speech) */ #else tmp = shl(band_width[k],Q_speech);/*Q(Q_speech) */ #endif tmp = div_s(16384,tmp);/*Q(15+14-Q_speech) */ } ELSE Loading @@ -605,7 +617,11 @@ void hq2_noise_inject_fx( tmp1 = sub(fac_fx,4096);/*Q12 */ L_tmp = L_mult(tmp1,j);/*Q13 */ L_tmp = Mult_32_16(L_tmp,tmp);/*Q(13+29-Q_speech-15 = 27-Q_speech) */ #ifdef BASOP_NOGLOB tmp = extract_h(L_shl_o(L_tmp,add(1,Q_speech), &Overflow));/*Q12 */ #else tmp = extract_h(L_shl(L_tmp,add(1,Q_speech)));/*Q12 */ #endif tmp = sub(fac_fx,tmp);/*Q12 */ L_tmp = Mult_32_16(ni_gain_fx[k],tmp);/*Q(17+12-15=14) */ L_y2[i] = L_add(L_y2[i],L_shr(Mult_32_16(L_tmp,rand_fx),2)); Loading lib_com/pred_lt4_fx.c +12 −1 Original line number Diff line number Diff line Loading @@ -126,6 +126,9 @@ void pred_lt4_tc_fx( Word16 excO[L_SUBFR+1]; Word32 L_sum; Word16 excI[2*L_SUBFR]; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif Copy( exc + sub(i_subfr, L_SUBFR), excI, shl(L_SUBFR,1) ); test(); Loading Loading @@ -157,15 +160,23 @@ void pred_lt4_tc_fx( k += UP_SAMP; L_sum = L_mac(L_sum, x0[i], win[k]); /*Q1 */ } #ifdef BASOP_NOGLOB L_sum = L_shl_o(L_sum, 1, &Overflow); /*Q0h */ excO[j] = round_fx_o(L_sum, &Overflow); #else L_sum = L_shl(L_sum, 1); /*Q0h */ excO[j] = round_fx(L_sum); #endif x0++; } FOR (i = T0; i < L_SUBFR; i++) { #ifdef BASOP_NOGLOB exc[i+i_subfr] = add_o(exc[i+i_subfr], mult_r(PIT_SHARP_fx, excO[i]), &Overflow); #else exc[i+i_subfr] = add(exc[i+i_subfr], mult_r(PIT_SHARP_fx, excO[i])); #endif move16(); } } Loading lib_com/pvq_com_fx.c +7 −1 Original line number Diff line number Diff line Loading @@ -401,7 +401,9 @@ void NearOppSplitAdjustment_fx( Word16 qac, qboth, qskew, qavg, qmin, Midx; Word32 L_QIb, L_qnum; Word16 QIb, QIa; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif rangeCoderFinalizationFBits_fx(Qac, INTac, &qac); qboth = sub(qband, sub(qac, qzero)); /* skew calc code */ Loading @@ -425,7 +427,11 @@ void NearOppSplitAdjustment_fx( L_QIb = (Word32) intLimCDivPos_fx(L_qnum, QIa); } *qnear = qboth; #ifdef BASOP_NOGLOB QIb = extract_h(L_shl_o(L_QIb, 16, &Overflow)); /* may saturate */ #else QIb = extract_h(L_shl(L_QIb, 16)); /* may saturate */ #endif if (LE_16(QIb, qboth)) { *qnear = QIb; Loading lib_com/swb_tbe_com_fx.c +23 −3 Original line number Diff line number Diff line Loading @@ -2736,7 +2736,9 @@ void non_linearity_fx( Word16 nframes; Word32 prev_scale; Word16 length_half; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif IF ( EQ_16(L_frame, L_FRAME16k )) { Loading Loading @@ -2836,12 +2838,19 @@ void non_linearity_fx( tmp = div_s( shl(1, sub( 14, exp)), j ); /* Q(29-exp) */ /* (log2(scale / prev_scale))/length */ #ifdef BASOP_NOGLOB L_tmp = L_shl_o( Mult_32_16( L_tmp, tmp ), sub(exp, 14), &Overflow ); /* Q(16+29-exp+1-16+exp-14)->Q16 */ #else L_tmp = L_shl( Mult_32_16( L_tmp, tmp ), sub(exp, 14) ); /* Q(16+29-exp+1-16+exp-14)->Q16 */ #endif frac = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ tmp = extract_l( Pow2( 14, frac ) ); #ifdef BASOP_NOGLOB scale_step = shl_o( tmp, exp, &Overflow ); /* Q14 */ #else scale_step = shl( tmp, exp ); /* Q14 */ #endif } } Loading @@ -2865,7 +2874,11 @@ void non_linearity_fx( { exp = norm_s( max_val ); tmp = div_s( shl(1, sub( 14, exp)), max_val ); /* Q(29-exp-Q_inp) */ #ifdef BASOP_NOGLOB scale = L_shl_o( L_mult( 21955, tmp ), add(exp, sub(Q_inp, 14)), &Overflow ); /* Q31 */ #else scale = L_shl( L_mult( 21955, tmp ), add(exp, sub(Q_inp, 14)) ); /* Q31 */ #endif } ELSE { Loading Loading @@ -2914,12 +2927,19 @@ void non_linearity_fx( tmp = div_s( shl(1, sub( 14, exp)), tmp ); /* Q(29-exp) */ /* (log2(scale / prev_scale))/length */ #ifdef BASOP_NOGLOB L_tmp = L_shl_o( Mult_32_16( L_tmp, tmp ), sub(exp,14), &Overflow); /*Q(16+29-exp+1-16+exp-14)->Q16 */ #else L_tmp = L_shl( Mult_32_16( L_tmp, tmp ), sub(exp,14) ); /*Q(16+29-exp+1-16+exp-14)->Q16 */ #endif frac = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ tmp = extract_l( Pow2( 14, frac ) ); #ifdef BASOP_NOGLOB scale_step = shl_o( tmp, exp, &Overflow ); /*Q14 */ #else scale_step = shl( tmp, exp ); /*Q14 */ #endif } } Loading Loading
lib_com/deemph_fx.c +5 −0 Original line number Diff line number Diff line Loading @@ -40,8 +40,13 @@ void deemph_fx( #endif /* BASOP_NOGLOB */ L_tmp = L_deposit_h(signal[0]); #ifdef BASOP_NOGLOB L_tmp = L_mac_o(L_tmp, *mem, mu, &Overflow); signal[0] = round_fx_o(L_tmp, &Overflow); #else L_tmp = L_mac(L_tmp, *mem, mu); signal[0] = round_fx(L_tmp); #endif FOR (i = 1; i < L; i++) { Loading
lib_com/hq2_noise_inject_fx.c +16 −0 Original line number Diff line number Diff line Loading @@ -575,14 +575,22 @@ void hq2_noise_inject_fx( L_tmp = Mult_32_16(Ep_fx[k],tmp); /*Q(Q_Ep_fx[k]+28-Q_speech-15 = Q_Ep_fx[k]+13-Q_speech) */ tmp = sub(Q_Ep_fx[k],Q_speech); tmp = sub(15,tmp); #ifdef BASOP_NOGLOB tmp = extract_h(L_shl_o(L_tmp,tmp, &Overflow));/*Q12 */ #else tmp = extract_h(L_shl(L_tmp,tmp));/*Q12 */ #endif } ELSE { tmp = 0x7fff;/*Q0 */ L_tmp = Mult_32_16(Ep_fx[k],tmp); /*Q(Q_Ep_fx[k]+0-15 = Q_Ep_fx[k]-15) */ tmp = sub(43,Q_Ep_fx[k]); #ifdef BASOP_NOGLOB tmp = extract_h(L_shl_o(L_tmp,tmp, &Overflow));/*Q12 */ #else tmp = extract_h(L_shl(L_tmp,tmp));/*Q12 */ #endif } fac_fx = s_max(tmp,4096);/*Q12 */ Loading @@ -594,7 +602,11 @@ void hq2_noise_inject_fx( IF(band_width[k] != 0) { Q_speech = norm_s(band_width[k]); #ifdef BASOP_NOGLOB tmp = shl_o(band_width[k],Q_speech, &Overflow);/*Q(Q_speech) */ #else tmp = shl(band_width[k],Q_speech);/*Q(Q_speech) */ #endif tmp = div_s(16384,tmp);/*Q(15+14-Q_speech) */ } ELSE Loading @@ -605,7 +617,11 @@ void hq2_noise_inject_fx( tmp1 = sub(fac_fx,4096);/*Q12 */ L_tmp = L_mult(tmp1,j);/*Q13 */ L_tmp = Mult_32_16(L_tmp,tmp);/*Q(13+29-Q_speech-15 = 27-Q_speech) */ #ifdef BASOP_NOGLOB tmp = extract_h(L_shl_o(L_tmp,add(1,Q_speech), &Overflow));/*Q12 */ #else tmp = extract_h(L_shl(L_tmp,add(1,Q_speech)));/*Q12 */ #endif tmp = sub(fac_fx,tmp);/*Q12 */ L_tmp = Mult_32_16(ni_gain_fx[k],tmp);/*Q(17+12-15=14) */ L_y2[i] = L_add(L_y2[i],L_shr(Mult_32_16(L_tmp,rand_fx),2)); Loading
lib_com/pred_lt4_fx.c +12 −1 Original line number Diff line number Diff line Loading @@ -126,6 +126,9 @@ void pred_lt4_tc_fx( Word16 excO[L_SUBFR+1]; Word32 L_sum; Word16 excI[2*L_SUBFR]; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif Copy( exc + sub(i_subfr, L_SUBFR), excI, shl(L_SUBFR,1) ); test(); Loading Loading @@ -157,15 +160,23 @@ void pred_lt4_tc_fx( k += UP_SAMP; L_sum = L_mac(L_sum, x0[i], win[k]); /*Q1 */ } #ifdef BASOP_NOGLOB L_sum = L_shl_o(L_sum, 1, &Overflow); /*Q0h */ excO[j] = round_fx_o(L_sum, &Overflow); #else L_sum = L_shl(L_sum, 1); /*Q0h */ excO[j] = round_fx(L_sum); #endif x0++; } FOR (i = T0; i < L_SUBFR; i++) { #ifdef BASOP_NOGLOB exc[i+i_subfr] = add_o(exc[i+i_subfr], mult_r(PIT_SHARP_fx, excO[i]), &Overflow); #else exc[i+i_subfr] = add(exc[i+i_subfr], mult_r(PIT_SHARP_fx, excO[i])); #endif move16(); } } Loading
lib_com/pvq_com_fx.c +7 −1 Original line number Diff line number Diff line Loading @@ -401,7 +401,9 @@ void NearOppSplitAdjustment_fx( Word16 qac, qboth, qskew, qavg, qmin, Midx; Word32 L_QIb, L_qnum; Word16 QIb, QIa; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif rangeCoderFinalizationFBits_fx(Qac, INTac, &qac); qboth = sub(qband, sub(qac, qzero)); /* skew calc code */ Loading @@ -425,7 +427,11 @@ void NearOppSplitAdjustment_fx( L_QIb = (Word32) intLimCDivPos_fx(L_qnum, QIa); } *qnear = qboth; #ifdef BASOP_NOGLOB QIb = extract_h(L_shl_o(L_QIb, 16, &Overflow)); /* may saturate */ #else QIb = extract_h(L_shl(L_QIb, 16)); /* may saturate */ #endif if (LE_16(QIb, qboth)) { *qnear = QIb; Loading
lib_com/swb_tbe_com_fx.c +23 −3 Original line number Diff line number Diff line Loading @@ -2736,7 +2736,9 @@ void non_linearity_fx( Word16 nframes; Word32 prev_scale; Word16 length_half; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif IF ( EQ_16(L_frame, L_FRAME16k )) { Loading Loading @@ -2836,12 +2838,19 @@ void non_linearity_fx( tmp = div_s( shl(1, sub( 14, exp)), j ); /* Q(29-exp) */ /* (log2(scale / prev_scale))/length */ #ifdef BASOP_NOGLOB L_tmp = L_shl_o( Mult_32_16( L_tmp, tmp ), sub(exp, 14), &Overflow ); /* Q(16+29-exp+1-16+exp-14)->Q16 */ #else L_tmp = L_shl( Mult_32_16( L_tmp, tmp ), sub(exp, 14) ); /* Q(16+29-exp+1-16+exp-14)->Q16 */ #endif frac = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ tmp = extract_l( Pow2( 14, frac ) ); #ifdef BASOP_NOGLOB scale_step = shl_o( tmp, exp, &Overflow ); /* Q14 */ #else scale_step = shl( tmp, exp ); /* Q14 */ #endif } } Loading @@ -2865,7 +2874,11 @@ void non_linearity_fx( { exp = norm_s( max_val ); tmp = div_s( shl(1, sub( 14, exp)), max_val ); /* Q(29-exp-Q_inp) */ #ifdef BASOP_NOGLOB scale = L_shl_o( L_mult( 21955, tmp ), add(exp, sub(Q_inp, 14)), &Overflow ); /* Q31 */ #else scale = L_shl( L_mult( 21955, tmp ), add(exp, sub(Q_inp, 14)) ); /* Q31 */ #endif } ELSE { Loading Loading @@ -2914,12 +2927,19 @@ void non_linearity_fx( tmp = div_s( shl(1, sub( 14, exp)), tmp ); /* Q(29-exp) */ /* (log2(scale / prev_scale))/length */ #ifdef BASOP_NOGLOB L_tmp = L_shl_o( Mult_32_16( L_tmp, tmp ), sub(exp,14), &Overflow); /*Q(16+29-exp+1-16+exp-14)->Q16 */ #else L_tmp = L_shl( Mult_32_16( L_tmp, tmp ), sub(exp,14) ); /*Q(16+29-exp+1-16+exp-14)->Q16 */ #endif frac = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ tmp = extract_l( Pow2( 14, frac ) ); #ifdef BASOP_NOGLOB scale_step = shl_o( tmp, exp, &Overflow ); /*Q14 */ #else scale_step = shl( tmp, exp ); /*Q14 */ #endif } } Loading