Loading lib_com/frame_ener_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -164,7 +164,11 @@ Word16 frame_energy_fx( /* o : Frame energy in /* len = (0.5f * (pitch[2]/64.0 + pitch[3]/64.0) + 0.5f) */ #ifdef BASOP_NOGLOB len = mult_r(add_o(pitch[2], pitch[3], &Overflow), 256); #else len = mult_r(add(pitch[2], pitch[3]), 256); #endif if(LT_16(len,L_SUBFR)) { Loading lib_dec/LD_music_post_filter_fx.c +22 −0 Original line number Diff line number Diff line Loading @@ -402,6 +402,10 @@ static void spectrum_mod_dct_fx( Word32 Lshift; Word32 dot5_scaled; const Word32 *Lpt2; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif gain = 0; move16(); Loading Loading @@ -539,12 +543,22 @@ static void spectrum_mod_dct_fx( Ltmp = L_mult(tmpN, m_binE); e_binE = sub(add(e_tmp, e_binE),15); #ifdef BASOP_NOGLOB Ltmp = L_shr_o(Ltmp, e_binE, &Overflow); Lgain = L_add_o(Ltmp, Lshift, &Overflow); /*Saturation can occure here result in Q30*/ #else Ltmp = L_shr(Ltmp, e_binE); Lgain = L_add(Ltmp, Lshift); /*Saturation can occure here result in Q30*/ #endif } Lpt2++; #ifdef BASOP_NOGLOB gain = round_fx_o(Lgain, &Overflow); /*gain in Q30-16 = Q14*/ #else gain = round_fx(Lgain); /*gain in Q30-16 = Q14*/ #endif /*if (gain < minE)gain = minE;*/ gain = s_max(gain,minE); /*if (gain > 1.0f+MAX_GN)gain = 1.0f+MAX_GN;*/ Loading Loading @@ -829,6 +843,10 @@ static Word16 norm_lfe( { Word32 Ltmp; Word16 exp2, tmp16, exp3 ; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif Ltmp = Mult_32_16(Lfe, m_norm); Ltmp = L_add(Ltmp, L_shl(BET_Q15_FX, sub(e_norm,15))); /* Ltmp -> e_norm*/ Loading @@ -846,7 +864,11 @@ static Word16 norm_lfe( exp3 = sub(exp2, 12+16-3); /* if exp2 < 31, means that tmp >= 1.0 */ /* Need to shl by 3 to take into account the 3 multiplications */ } #ifdef BASOP_NOGLOB tmp16 = shl_o(tmp16, exp3, &Overflow); /* Result in Q12 */ #else tmp16 = shl(tmp16, exp3); /* Result in Q12 */ #endif return tmp16; } Loading lib_dec/bass_psfilter_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -456,7 +456,11 @@ void bass_psfilter_fx( { /*syn2_fx[i] = alpha*(syn_fx[i]-syn2_fx[i]); */ tmp = sub(syn_fx[i],syn2_fx[i]); #ifdef BASOP_NOGLOB syn2_fx[i] = mult_o(alpha, shl_o(tmp, 1, &Overflow), &Overflow); #else syn2_fx[i] = mult(alpha,shl(tmp,1)); #endif move16();/*Q_syn2 */ } Loading lib_dec/gain_dec_fx.c +12 −0 Original line number Diff line number Diff line Loading @@ -866,8 +866,16 @@ void lp_gain_updt_fx( ) { Word16 tmp; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif #ifdef BASOP_NOGLOB tmp = extract_h(L_shl_o(norm_gain_code, 3, &Overflow)); /*(16+3)-16 -> Q3*/ #else tmp = extract_h(L_shl(norm_gain_code,3)); /*(16+3)-16 -> Q3*/ #endif IF( EQ_16(L_frame,L_FRAME)) { IF(i_subfr == 0) Loading Loading @@ -895,7 +903,11 @@ void lp_gain_updt_fx( { *lp_gainp = add( *lp_gainp, mult(13107, gain_pit)); move16(); /*Q14 (0.4 in Q15 = 13107)*/ #ifdef BASOP_NOGLOB *lp_gainc = mac_ro(L_deposit_h(*lp_gainc), 13107, tmp, &Overflow); #else *lp_gainc = mac_r(L_deposit_h(*lp_gainc), 13107, tmp); #endif move16(); /*Q3*/ } } Loading lib_dec/hf_synth_fx.c +44 −1 Original line number Diff line number Diff line Loading @@ -515,6 +515,10 @@ void hf_synth_amr_wb_fx( Word32 exc32[L_FRAME], dct_exc32[L_FRAME], dct_hb32[L_FRAME16k], exc16k32[L_FRAME16k]; Word16 q_tmp; Word16 gamma; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif Scale_sig(synth, L_FRAME, -3); Loading Loading @@ -595,7 +599,11 @@ void hf_synth_amr_wb_fx( fmerit_w = shr(fmerit_w, 1); /*Q14; */ } #ifdef BASOP_NOGLOB L_tmp = L_mult(fmerit_w, add_o(16384, voice_fac, &Overflow)); #else L_tmp = L_mult(fmerit_w, add(16384, voice_fac)); #endif fmerit_w = extract_l(L_shr(L_tmp, 15)); /*Q14 */ /**fmerit_w_sm = add(mult_r(*fmerit_w_sm, 29491), mult_r(fmerit_w, 3277)); //Q14 */ hAmrwb_IO->fmerit_w_sm_fx = round_fx(L_mac(L_mult(hAmrwb_IO->fmerit_w_sm_fx, 29491), fmerit_w, 3277)); /*Q14 */ Loading Loading @@ -732,7 +740,11 @@ void hf_synth_amr_wb_fx( pt4 = &dct_hb[240]; FOR (j=0; j<fn; j++) { #ifdef BASOP_NOGLOB tmp = add_o(tmp, shr(*pt4++, 2), &Overflow); /*qdct-2 */ #else tmp = add(tmp, shr(*pt4++,2)); /*qdct-2 */ #endif } *pt1 = round_fx(L_shl(L_mult(tmp, tmp1),2)); /*qdct */ *pt2 = sub(*pt3, *pt1); Loading @@ -753,7 +765,11 @@ void hf_synth_amr_wb_fx( pt4 = &dct_hb[fb+240]; FOR (j=fb; j<fn; j++) { #ifdef BASOP_NOGLOB tmp = add_o(tmp, shr(*pt4++, 2), &Overflow); /*qdct-2 */ #else tmp = add(tmp, shr(*pt4++,2)); /*qdct-2 */ #endif } *pt1 = mult_r(tmp, 8738); move16(); /* 8738 = 1/15 in Q17 qdct */ Loading @@ -777,7 +793,11 @@ void hf_synth_amr_wb_fx( pt4 = &dct_hb[fb+240]; FOR (j=fb; j<L_SUBFR16k; j++) { #ifdef BASOP_NOGLOB tmp = add_o(tmp, shr(*pt4++, 2), &Overflow); /*qdct-2 */ #else tmp = add(tmp, shr(*pt4++,2)); /*qdct-2 */ #endif } *pt1 = round_fx(L_shl(L_mult(tmp, tmp1),2)); /*qdct */ *pt2 = sub(*pt3, *pt1); Loading Loading @@ -1179,6 +1199,10 @@ static Word16 EnhanceClass_fx( Word16 unvoicing_tmp_fx; Word16 tmp, tmp1; Word32 L_tmp; #ifdef BASOP_NOGLOB Flag Overflow; #endif /* Decide (*unvoicing_flag) to allow BWE enhancement when qq>pp */ /**voice_fac_fx = add(mult_r(*voice_fac_fx, 24576), mult_r(voice_factor_fx, 8192)); //Q15 */ Loading Loading @@ -1211,12 +1235,20 @@ static Word16 EnhanceClass_fx( *unvoicing_sm_fx = round_fx(L_mac(L_mult(32440, *unvoicing_sm_fx), 328, *unvoicing_fx)); /*Q15 */ } #ifdef BASOP_NOGLOB if (GT_16(sub_o(*unvoicing_fx, *unvoicing_sm_fx, &Overflow), 3277)) #else if ( GT_16(sub(*unvoicing_fx, *unvoicing_sm_fx),3277)) #endif { *unvoicing_flag = 1; } #ifdef BASOP_NOGLOB if (LT_16(sub_o(*unvoicing_fx, *unvoicing_sm_fx, &Overflow), 1638)) #else if ( LT_16(sub(*unvoicing_fx, *unvoicing_sm_fx),1638)) #endif { *unvoicing_flag = 0; } Loading Loading @@ -1246,6 +1278,9 @@ static void envelope_fx( Word16 *pt1; const Word16 *pt2, *pt3; Word16 Aq[M+1]; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif /* Aq has dynamic scaling Loading Loading @@ -1310,7 +1345,11 @@ static void envelope_fx( pt3 = exp_tab_q_fx; FOR ( i = 0; i <= M; i++ ) { #ifdef BASOP_NOGLOB L_tmp = L_mac_o(L_tmp, *pt2++, *pt3++, &Overflow); #else L_tmp = L_mac(L_tmp, *pt2++, *pt3++); #endif } q2 = norm_l(L_tmp); L_tmp = L_shl(L_tmp, q2);/*Q(27+q2)*/ Loading Loading @@ -1454,7 +1493,11 @@ static void envelope_fx( { IF ( GT_16(rr, (hAmrwb_IO->prev_r_fx))) { #ifdef BASOP_NOGLOB rr = shr(add_o(rr, (hAmrwb_IO->prev_r_fx), &Overflow), 1); #else rr = shr(add(rr, (hAmrwb_IO->prev_r_fx)), 1); #endif } hAmrwb_IO->prev_r_fx = rr; Loading Loading
lib_com/frame_ener_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -164,7 +164,11 @@ Word16 frame_energy_fx( /* o : Frame energy in /* len = (0.5f * (pitch[2]/64.0 + pitch[3]/64.0) + 0.5f) */ #ifdef BASOP_NOGLOB len = mult_r(add_o(pitch[2], pitch[3], &Overflow), 256); #else len = mult_r(add(pitch[2], pitch[3]), 256); #endif if(LT_16(len,L_SUBFR)) { Loading
lib_dec/LD_music_post_filter_fx.c +22 −0 Original line number Diff line number Diff line Loading @@ -402,6 +402,10 @@ static void spectrum_mod_dct_fx( Word32 Lshift; Word32 dot5_scaled; const Word32 *Lpt2; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif gain = 0; move16(); Loading Loading @@ -539,12 +543,22 @@ static void spectrum_mod_dct_fx( Ltmp = L_mult(tmpN, m_binE); e_binE = sub(add(e_tmp, e_binE),15); #ifdef BASOP_NOGLOB Ltmp = L_shr_o(Ltmp, e_binE, &Overflow); Lgain = L_add_o(Ltmp, Lshift, &Overflow); /*Saturation can occure here result in Q30*/ #else Ltmp = L_shr(Ltmp, e_binE); Lgain = L_add(Ltmp, Lshift); /*Saturation can occure here result in Q30*/ #endif } Lpt2++; #ifdef BASOP_NOGLOB gain = round_fx_o(Lgain, &Overflow); /*gain in Q30-16 = Q14*/ #else gain = round_fx(Lgain); /*gain in Q30-16 = Q14*/ #endif /*if (gain < minE)gain = minE;*/ gain = s_max(gain,minE); /*if (gain > 1.0f+MAX_GN)gain = 1.0f+MAX_GN;*/ Loading Loading @@ -829,6 +843,10 @@ static Word16 norm_lfe( { Word32 Ltmp; Word16 exp2, tmp16, exp3 ; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif Ltmp = Mult_32_16(Lfe, m_norm); Ltmp = L_add(Ltmp, L_shl(BET_Q15_FX, sub(e_norm,15))); /* Ltmp -> e_norm*/ Loading @@ -846,7 +864,11 @@ static Word16 norm_lfe( exp3 = sub(exp2, 12+16-3); /* if exp2 < 31, means that tmp >= 1.0 */ /* Need to shl by 3 to take into account the 3 multiplications */ } #ifdef BASOP_NOGLOB tmp16 = shl_o(tmp16, exp3, &Overflow); /* Result in Q12 */ #else tmp16 = shl(tmp16, exp3); /* Result in Q12 */ #endif return tmp16; } Loading
lib_dec/bass_psfilter_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -456,7 +456,11 @@ void bass_psfilter_fx( { /*syn2_fx[i] = alpha*(syn_fx[i]-syn2_fx[i]); */ tmp = sub(syn_fx[i],syn2_fx[i]); #ifdef BASOP_NOGLOB syn2_fx[i] = mult_o(alpha, shl_o(tmp, 1, &Overflow), &Overflow); #else syn2_fx[i] = mult(alpha,shl(tmp,1)); #endif move16();/*Q_syn2 */ } Loading
lib_dec/gain_dec_fx.c +12 −0 Original line number Diff line number Diff line Loading @@ -866,8 +866,16 @@ void lp_gain_updt_fx( ) { Word16 tmp; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif #ifdef BASOP_NOGLOB tmp = extract_h(L_shl_o(norm_gain_code, 3, &Overflow)); /*(16+3)-16 -> Q3*/ #else tmp = extract_h(L_shl(norm_gain_code,3)); /*(16+3)-16 -> Q3*/ #endif IF( EQ_16(L_frame,L_FRAME)) { IF(i_subfr == 0) Loading Loading @@ -895,7 +903,11 @@ void lp_gain_updt_fx( { *lp_gainp = add( *lp_gainp, mult(13107, gain_pit)); move16(); /*Q14 (0.4 in Q15 = 13107)*/ #ifdef BASOP_NOGLOB *lp_gainc = mac_ro(L_deposit_h(*lp_gainc), 13107, tmp, &Overflow); #else *lp_gainc = mac_r(L_deposit_h(*lp_gainc), 13107, tmp); #endif move16(); /*Q3*/ } } Loading
lib_dec/hf_synth_fx.c +44 −1 Original line number Diff line number Diff line Loading @@ -515,6 +515,10 @@ void hf_synth_amr_wb_fx( Word32 exc32[L_FRAME], dct_exc32[L_FRAME], dct_hb32[L_FRAME16k], exc16k32[L_FRAME16k]; Word16 q_tmp; Word16 gamma; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif Scale_sig(synth, L_FRAME, -3); Loading Loading @@ -595,7 +599,11 @@ void hf_synth_amr_wb_fx( fmerit_w = shr(fmerit_w, 1); /*Q14; */ } #ifdef BASOP_NOGLOB L_tmp = L_mult(fmerit_w, add_o(16384, voice_fac, &Overflow)); #else L_tmp = L_mult(fmerit_w, add(16384, voice_fac)); #endif fmerit_w = extract_l(L_shr(L_tmp, 15)); /*Q14 */ /**fmerit_w_sm = add(mult_r(*fmerit_w_sm, 29491), mult_r(fmerit_w, 3277)); //Q14 */ hAmrwb_IO->fmerit_w_sm_fx = round_fx(L_mac(L_mult(hAmrwb_IO->fmerit_w_sm_fx, 29491), fmerit_w, 3277)); /*Q14 */ Loading Loading @@ -732,7 +740,11 @@ void hf_synth_amr_wb_fx( pt4 = &dct_hb[240]; FOR (j=0; j<fn; j++) { #ifdef BASOP_NOGLOB tmp = add_o(tmp, shr(*pt4++, 2), &Overflow); /*qdct-2 */ #else tmp = add(tmp, shr(*pt4++,2)); /*qdct-2 */ #endif } *pt1 = round_fx(L_shl(L_mult(tmp, tmp1),2)); /*qdct */ *pt2 = sub(*pt3, *pt1); Loading @@ -753,7 +765,11 @@ void hf_synth_amr_wb_fx( pt4 = &dct_hb[fb+240]; FOR (j=fb; j<fn; j++) { #ifdef BASOP_NOGLOB tmp = add_o(tmp, shr(*pt4++, 2), &Overflow); /*qdct-2 */ #else tmp = add(tmp, shr(*pt4++,2)); /*qdct-2 */ #endif } *pt1 = mult_r(tmp, 8738); move16(); /* 8738 = 1/15 in Q17 qdct */ Loading @@ -777,7 +793,11 @@ void hf_synth_amr_wb_fx( pt4 = &dct_hb[fb+240]; FOR (j=fb; j<L_SUBFR16k; j++) { #ifdef BASOP_NOGLOB tmp = add_o(tmp, shr(*pt4++, 2), &Overflow); /*qdct-2 */ #else tmp = add(tmp, shr(*pt4++,2)); /*qdct-2 */ #endif } *pt1 = round_fx(L_shl(L_mult(tmp, tmp1),2)); /*qdct */ *pt2 = sub(*pt3, *pt1); Loading Loading @@ -1179,6 +1199,10 @@ static Word16 EnhanceClass_fx( Word16 unvoicing_tmp_fx; Word16 tmp, tmp1; Word32 L_tmp; #ifdef BASOP_NOGLOB Flag Overflow; #endif /* Decide (*unvoicing_flag) to allow BWE enhancement when qq>pp */ /**voice_fac_fx = add(mult_r(*voice_fac_fx, 24576), mult_r(voice_factor_fx, 8192)); //Q15 */ Loading Loading @@ -1211,12 +1235,20 @@ static Word16 EnhanceClass_fx( *unvoicing_sm_fx = round_fx(L_mac(L_mult(32440, *unvoicing_sm_fx), 328, *unvoicing_fx)); /*Q15 */ } #ifdef BASOP_NOGLOB if (GT_16(sub_o(*unvoicing_fx, *unvoicing_sm_fx, &Overflow), 3277)) #else if ( GT_16(sub(*unvoicing_fx, *unvoicing_sm_fx),3277)) #endif { *unvoicing_flag = 1; } #ifdef BASOP_NOGLOB if (LT_16(sub_o(*unvoicing_fx, *unvoicing_sm_fx, &Overflow), 1638)) #else if ( LT_16(sub(*unvoicing_fx, *unvoicing_sm_fx),1638)) #endif { *unvoicing_flag = 0; } Loading Loading @@ -1246,6 +1278,9 @@ static void envelope_fx( Word16 *pt1; const Word16 *pt2, *pt3; Word16 Aq[M+1]; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif /* Aq has dynamic scaling Loading Loading @@ -1310,7 +1345,11 @@ static void envelope_fx( pt3 = exp_tab_q_fx; FOR ( i = 0; i <= M; i++ ) { #ifdef BASOP_NOGLOB L_tmp = L_mac_o(L_tmp, *pt2++, *pt3++, &Overflow); #else L_tmp = L_mac(L_tmp, *pt2++, *pt3++); #endif } q2 = norm_l(L_tmp); L_tmp = L_shl(L_tmp, q2);/*Q(27+q2)*/ Loading Loading @@ -1454,7 +1493,11 @@ static void envelope_fx( { IF ( GT_16(rr, (hAmrwb_IO->prev_r_fx))) { #ifdef BASOP_NOGLOB rr = shr(add_o(rr, (hAmrwb_IO->prev_r_fx), &Overflow), 1); #else rr = shr(add(rr, (hAmrwb_IO->prev_r_fx)), 1); #endif } hAmrwb_IO->prev_r_fx = rr; Loading