Loading lib_com/basop_util.c +8 −0 Original line number Diff line number Diff line Loading @@ -278,6 +278,10 @@ static Word16 Sqrt16_common(Word16 m, Word16 e) { Word16 index, frac; #ifdef BASOP_NOGLOB Flag Overflow; #endif assert((m >= 0x4000) || (m == 0)); Loading @@ -292,7 +296,11 @@ static Word16 Sqrt16_common(Word16 m, if (m != 0) { BASOP_SATURATE_WARNING_OFF; #ifdef BASOP_NOGLOB m = mac_ro(SqrtTable[index], SqrtDiffTable[index], frac, &Overflow); #else m = mac_r(SqrtTable[index], SqrtDiffTable[index], frac); #endif BASOP_SATURATE_WARNING_ON; } Loading lib_dec/FEC_clas_estim_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -348,7 +348,11 @@ void FEC_clas_estim_fx( exp1 = sub(exp1, tmpS); tilt = div_s(tmp_y, tmp_x); #ifdef BASOP_NOGLOB tilt = shl_o(tilt, sub(exp1, exp2), &Overflow); /* saturate to 1.0 */ #else tilt = shl(tilt, sub(exp1, exp2)); /* saturate to 1.0 */ #endif tilt = i_mult2(tilt, tmp16); } Loading lib_dec/dec_tcx.c +38 −1 Original line number Diff line number Diff line Loading @@ -1312,6 +1312,9 @@ void decoder_tcx_post(Decoder_State_fx *st_fx, Word32 tmp32; Word32 tmp32_1, tmp32_2; TCX_DEC_HANDLE hTcxDec; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif hTcxDec = st_fx->hTcxDec; Loading Loading @@ -1381,7 +1384,11 @@ void decoder_tcx_post(Decoder_State_fx *st_fx, } tmp32 = Mpy_32_16_1(tmp32, getInvFrameLen(hTcxDec->L_frameTCX)); tmp2 = norm_l(tmp32); #ifdef BASOP_NOGLOB tmp1 = round_fx_o(L_shl(tmp32, tmp2), &Overflow); #else tmp1 = round_fx(L_shl(tmp32, tmp2)); #endif s = sub(sub(sub(1, shl(s, 1)), 6/*table lookup for inverse framelength*/), tmp2); tmp1 = Sqrt16(tmp1, &s); move16(); Loading Loading @@ -1473,19 +1480,30 @@ void decoder_tcx_post(Decoder_State_fx *st_fx, &tmp1); tmp2 = BASOP_Util_Add_MantExp(hTcxDec->conceal_eof_gain, 15-14, negate(tmp1), tmp2, &tmp1); #ifdef BASOP_NOGLOB step = L_shl_o(L_mult(tmp1, getInvFrameLen(st_fx->L_frame_fx)), sub(tmp2, 6/*scaling from table lookup*/ + 1/*go to Q30*/), &Overflow); /*Q30*/ #else step = L_shl(L_mult(tmp1, getInvFrameLen(st_fx->L_frame_fx)), sub(tmp2,6/*scaling from table lookup*/ +1/*go to Q30*/)); /*Q30*/ #endif { Word32 stepFB; UWord32 dmy; conceal_eof_gainFB = L_deposit_h(hTcxDec->conceal_eof_gain); /*Q30*/ Mpy_32_32_ss(step,L_shl(L_mult0(st_fx->L_frame_fx, getInvFrameLen(hTcxDec->L_frameTCX)),8),&stepFB ,&dmy ); #ifdef BASOP_NOGLOB stepFB = L_shl_o(stepFB, 3 - 1, &Overflow); /*Q30*/ #else stepFB = L_shl(stepFB,3-1); /*Q30*/ #endif FOR( i=0; i < hTcxDec->L_frameTCX; i++ ) { synthFB[i] = round_fx(L_shl(Mpy_32_16_1(conceal_eof_gainFB, synthFB[i]),1)); move16(); #ifdef BASOP_NOGLOB conceal_eof_gainFB = L_sub_o(conceal_eof_gainFB, stepFB, &Overflow); #else conceal_eof_gainFB = L_sub(conceal_eof_gainFB, stepFB); #endif } } conceal_eof_gain32 = L_deposit_h(hTcxDec->conceal_eof_gain); /*Q30*/ Loading @@ -1493,25 +1511,44 @@ void decoder_tcx_post(Decoder_State_fx *st_fx, { xn_buf[i] = round_fx(L_shl(Mpy_32_16_1(conceal_eof_gain32 /*Q30*/, xn_buf[i]),1)); move16(); #ifdef BASOP_NOGLOB conceal_eof_gain32 = L_sub_o(conceal_eof_gain32, step, &Overflow); #else conceal_eof_gain32 = L_sub(conceal_eof_gain32,step); #endif } #ifdef BASOP_NOGLOB hTcxDec->conceal_eof_gain = round_fx_o(conceal_eof_gain32, &Overflow); /*Q14*/ move16(); #else hTcxDec->conceal_eof_gain = round_fx(conceal_eof_gain32); /*Q14*/ move16(); #endif /* run lpc gain compensation not for waveform adjustment */ test(); IF ( 0 == st_fx->enablePlcWaveadjust || EQ_16(st_fx->plcInfo.concealment_method,TCX_TONAL)) { #ifdef BASOP_NOGLOB st_fx->plcInfo.recovery_gain = extract_h(L_shl_o(Mpy_32_16_1(conceal_eof_gainFB, st_fx->last_concealed_gain_syn_deemph), st_fx->last_concealed_gain_syn_deemph_e, &Overflow ));/*Q30->Q14*/ #else st_fx->plcInfo.recovery_gain = extract_h(L_shl(Mpy_32_16_1(conceal_eof_gainFB, st_fx->last_concealed_gain_syn_deemph), st_fx->last_concealed_gain_syn_deemph_e ));/*Q30->Q14*/ #endif } ELSE { st_fx->plcInfo.recovery_gain = extract_h(conceal_eof_gainFB); /*Q14*/ } st_fx->plcInfo.step_concealgain_fx = #ifdef BASOP_NOGLOB round_fx(L_shl_o(L_mult0( round_fx(step), round_fx(L_shl_o(L_mult0(st_fx->L_frame_fx, getInvFrameLen(hTcxDec->L_frameTCX)), 8, &Overflow))), 3, &Overflow)); /*Q15*/ #else round_fx(L_shl(L_mult0( round_fx(step), round_fx(L_shl(L_mult0(st_fx->L_frame_fx, getInvFrameLen(hTcxDec->L_frameTCX)),8))),3)); /*Q15*/ #endif } /*-----------------------------------------------------------* Loading lib_dec/er_dec_acelp.c +17 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,9 @@ void con_acelp( const Word16 scale_h1 = 5; HQ_DEC_HANDLE hHQ_core; TCX_DEC_HANDLE hTcxDec; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif hHQ_core = st->hHQ_core; hTcxDec = st->hTcxDec; Loading Loading @@ -415,7 +418,11 @@ void con_acelp( { move16(); BASOP_SATURATE_WARNING_OFF #ifdef BASOP_NOGLOB exc[i] = mult_r(exc[i], shl_o(gain, 1, &Overflow)); /*overflow is first iteration because gain may be 1 after shift*/ #else exc[i] = mult_r(exc[i] , shl(gain,1)); /*overflow is first iteration because gain may be 1 after shift*/ #endif BASOP_SATURATE_WARNING_ON gain = sub(gain , step); } Loading Loading @@ -770,8 +777,14 @@ void con_acelp( { g = mult_r(st->last_gain_syn_deemph, gain_lpc[i_subfr/L_SUBFR]); #ifdef BASOP_NOGLOB g_e = add_o(st->last_gain_syn_deemph_e, gain_lpc_e[i_subfr / L_SUBFR], &Overflow); g = shl_o(g, g_e, &Overflow); #else g_e = add(st->last_gain_syn_deemph_e, gain_lpc_e[i_subfr/L_SUBFR]); g = shl(g, g_e); #endif FOR (i=0; i < L_SUBFR; i++) { /* exc[i_subfr + i] *= st->last_gain_syn_deemph*gain_lpc[j]; */ Loading Loading @@ -852,7 +865,11 @@ void con_acelp( { g = mult_r(st->last_gain_syn_deemph, gain_lpc[i_subfr/L_SUBFR]); g_e = add(st->last_gain_syn_deemph_e, gain_lpc_e[i_subfr/L_SUBFR]); #ifdef BASOP_NOGLOB g = shl_o(g, g_e, &Overflow); #else g = shl(g, g_e); #endif FOR (i=0; i < L_SUBFR; i++) { /* exc[i_subfr + i] *= st->last_gain_syn_deemph*gain_lpc[j]; */ Loading lib_dec/er_scale_syn.c +8 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,10 @@ Word16 Damping_fact( /* o : damping factor Word32 lp_tmp; Word16 s_gainp; Word32 gain32; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif IF (core == ACELP_CORE) { Loading Loading @@ -91,7 +95,11 @@ Word16 Damping_fact( /* o : damping factor move16(); gain32 = Sqrt32(lp_tmp, &s_gainp); #ifdef BASOP_NOGLOB gain = round_fx_o(L_shl_o(gain32, s_gainp, &Overflow), &Overflow); /* Q15*/ #else gain = round_fx(L_shl(gain32,s_gainp)); /* Q15*/ #endif gain = s_min(gain, 32113/*0.98f Q15*/); /*Q15*/ gain = s_max(gain, 27853/*0.85f Q15*/); /*Q15*/ alpha = mult_r(alpha , gain); /*Q14*/ Loading Loading
lib_com/basop_util.c +8 −0 Original line number Diff line number Diff line Loading @@ -278,6 +278,10 @@ static Word16 Sqrt16_common(Word16 m, Word16 e) { Word16 index, frac; #ifdef BASOP_NOGLOB Flag Overflow; #endif assert((m >= 0x4000) || (m == 0)); Loading @@ -292,7 +296,11 @@ static Word16 Sqrt16_common(Word16 m, if (m != 0) { BASOP_SATURATE_WARNING_OFF; #ifdef BASOP_NOGLOB m = mac_ro(SqrtTable[index], SqrtDiffTable[index], frac, &Overflow); #else m = mac_r(SqrtTable[index], SqrtDiffTable[index], frac); #endif BASOP_SATURATE_WARNING_ON; } Loading
lib_dec/FEC_clas_estim_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -348,7 +348,11 @@ void FEC_clas_estim_fx( exp1 = sub(exp1, tmpS); tilt = div_s(tmp_y, tmp_x); #ifdef BASOP_NOGLOB tilt = shl_o(tilt, sub(exp1, exp2), &Overflow); /* saturate to 1.0 */ #else tilt = shl(tilt, sub(exp1, exp2)); /* saturate to 1.0 */ #endif tilt = i_mult2(tilt, tmp16); } Loading
lib_dec/dec_tcx.c +38 −1 Original line number Diff line number Diff line Loading @@ -1312,6 +1312,9 @@ void decoder_tcx_post(Decoder_State_fx *st_fx, Word32 tmp32; Word32 tmp32_1, tmp32_2; TCX_DEC_HANDLE hTcxDec; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif hTcxDec = st_fx->hTcxDec; Loading Loading @@ -1381,7 +1384,11 @@ void decoder_tcx_post(Decoder_State_fx *st_fx, } tmp32 = Mpy_32_16_1(tmp32, getInvFrameLen(hTcxDec->L_frameTCX)); tmp2 = norm_l(tmp32); #ifdef BASOP_NOGLOB tmp1 = round_fx_o(L_shl(tmp32, tmp2), &Overflow); #else tmp1 = round_fx(L_shl(tmp32, tmp2)); #endif s = sub(sub(sub(1, shl(s, 1)), 6/*table lookup for inverse framelength*/), tmp2); tmp1 = Sqrt16(tmp1, &s); move16(); Loading Loading @@ -1473,19 +1480,30 @@ void decoder_tcx_post(Decoder_State_fx *st_fx, &tmp1); tmp2 = BASOP_Util_Add_MantExp(hTcxDec->conceal_eof_gain, 15-14, negate(tmp1), tmp2, &tmp1); #ifdef BASOP_NOGLOB step = L_shl_o(L_mult(tmp1, getInvFrameLen(st_fx->L_frame_fx)), sub(tmp2, 6/*scaling from table lookup*/ + 1/*go to Q30*/), &Overflow); /*Q30*/ #else step = L_shl(L_mult(tmp1, getInvFrameLen(st_fx->L_frame_fx)), sub(tmp2,6/*scaling from table lookup*/ +1/*go to Q30*/)); /*Q30*/ #endif { Word32 stepFB; UWord32 dmy; conceal_eof_gainFB = L_deposit_h(hTcxDec->conceal_eof_gain); /*Q30*/ Mpy_32_32_ss(step,L_shl(L_mult0(st_fx->L_frame_fx, getInvFrameLen(hTcxDec->L_frameTCX)),8),&stepFB ,&dmy ); #ifdef BASOP_NOGLOB stepFB = L_shl_o(stepFB, 3 - 1, &Overflow); /*Q30*/ #else stepFB = L_shl(stepFB,3-1); /*Q30*/ #endif FOR( i=0; i < hTcxDec->L_frameTCX; i++ ) { synthFB[i] = round_fx(L_shl(Mpy_32_16_1(conceal_eof_gainFB, synthFB[i]),1)); move16(); #ifdef BASOP_NOGLOB conceal_eof_gainFB = L_sub_o(conceal_eof_gainFB, stepFB, &Overflow); #else conceal_eof_gainFB = L_sub(conceal_eof_gainFB, stepFB); #endif } } conceal_eof_gain32 = L_deposit_h(hTcxDec->conceal_eof_gain); /*Q30*/ Loading @@ -1493,25 +1511,44 @@ void decoder_tcx_post(Decoder_State_fx *st_fx, { xn_buf[i] = round_fx(L_shl(Mpy_32_16_1(conceal_eof_gain32 /*Q30*/, xn_buf[i]),1)); move16(); #ifdef BASOP_NOGLOB conceal_eof_gain32 = L_sub_o(conceal_eof_gain32, step, &Overflow); #else conceal_eof_gain32 = L_sub(conceal_eof_gain32,step); #endif } #ifdef BASOP_NOGLOB hTcxDec->conceal_eof_gain = round_fx_o(conceal_eof_gain32, &Overflow); /*Q14*/ move16(); #else hTcxDec->conceal_eof_gain = round_fx(conceal_eof_gain32); /*Q14*/ move16(); #endif /* run lpc gain compensation not for waveform adjustment */ test(); IF ( 0 == st_fx->enablePlcWaveadjust || EQ_16(st_fx->plcInfo.concealment_method,TCX_TONAL)) { #ifdef BASOP_NOGLOB st_fx->plcInfo.recovery_gain = extract_h(L_shl_o(Mpy_32_16_1(conceal_eof_gainFB, st_fx->last_concealed_gain_syn_deemph), st_fx->last_concealed_gain_syn_deemph_e, &Overflow ));/*Q30->Q14*/ #else st_fx->plcInfo.recovery_gain = extract_h(L_shl(Mpy_32_16_1(conceal_eof_gainFB, st_fx->last_concealed_gain_syn_deemph), st_fx->last_concealed_gain_syn_deemph_e ));/*Q30->Q14*/ #endif } ELSE { st_fx->plcInfo.recovery_gain = extract_h(conceal_eof_gainFB); /*Q14*/ } st_fx->plcInfo.step_concealgain_fx = #ifdef BASOP_NOGLOB round_fx(L_shl_o(L_mult0( round_fx(step), round_fx(L_shl_o(L_mult0(st_fx->L_frame_fx, getInvFrameLen(hTcxDec->L_frameTCX)), 8, &Overflow))), 3, &Overflow)); /*Q15*/ #else round_fx(L_shl(L_mult0( round_fx(step), round_fx(L_shl(L_mult0(st_fx->L_frame_fx, getInvFrameLen(hTcxDec->L_frameTCX)),8))),3)); /*Q15*/ #endif } /*-----------------------------------------------------------* Loading
lib_dec/er_dec_acelp.c +17 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,9 @@ void con_acelp( const Word16 scale_h1 = 5; HQ_DEC_HANDLE hHQ_core; TCX_DEC_HANDLE hTcxDec; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif hHQ_core = st->hHQ_core; hTcxDec = st->hTcxDec; Loading Loading @@ -415,7 +418,11 @@ void con_acelp( { move16(); BASOP_SATURATE_WARNING_OFF #ifdef BASOP_NOGLOB exc[i] = mult_r(exc[i], shl_o(gain, 1, &Overflow)); /*overflow is first iteration because gain may be 1 after shift*/ #else exc[i] = mult_r(exc[i] , shl(gain,1)); /*overflow is first iteration because gain may be 1 after shift*/ #endif BASOP_SATURATE_WARNING_ON gain = sub(gain , step); } Loading Loading @@ -770,8 +777,14 @@ void con_acelp( { g = mult_r(st->last_gain_syn_deemph, gain_lpc[i_subfr/L_SUBFR]); #ifdef BASOP_NOGLOB g_e = add_o(st->last_gain_syn_deemph_e, gain_lpc_e[i_subfr / L_SUBFR], &Overflow); g = shl_o(g, g_e, &Overflow); #else g_e = add(st->last_gain_syn_deemph_e, gain_lpc_e[i_subfr/L_SUBFR]); g = shl(g, g_e); #endif FOR (i=0; i < L_SUBFR; i++) { /* exc[i_subfr + i] *= st->last_gain_syn_deemph*gain_lpc[j]; */ Loading Loading @@ -852,7 +865,11 @@ void con_acelp( { g = mult_r(st->last_gain_syn_deemph, gain_lpc[i_subfr/L_SUBFR]); g_e = add(st->last_gain_syn_deemph_e, gain_lpc_e[i_subfr/L_SUBFR]); #ifdef BASOP_NOGLOB g = shl_o(g, g_e, &Overflow); #else g = shl(g, g_e); #endif FOR (i=0; i < L_SUBFR; i++) { /* exc[i_subfr + i] *= st->last_gain_syn_deemph*gain_lpc[j]; */ Loading
lib_dec/er_scale_syn.c +8 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,10 @@ Word16 Damping_fact( /* o : damping factor Word32 lp_tmp; Word16 s_gainp; Word32 gain32; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif IF (core == ACELP_CORE) { Loading Loading @@ -91,7 +95,11 @@ Word16 Damping_fact( /* o : damping factor move16(); gain32 = Sqrt32(lp_tmp, &s_gainp); #ifdef BASOP_NOGLOB gain = round_fx_o(L_shl_o(gain32, s_gainp, &Overflow), &Overflow); /* Q15*/ #else gain = round_fx(L_shl(gain32,s_gainp)); /* Q15*/ #endif gain = s_min(gain, 32113/*0.98f Q15*/); /*Q15*/ gain = s_max(gain, 27853/*0.85f Q15*/); /*Q15*/ alpha = mult_r(alpha , gain); /*Q14*/ Loading