Loading lib_com/basop_util.c +3 −5 Original line number Diff line number Diff line Loading @@ -1484,9 +1484,7 @@ Word32 Norm32Norm(const Word32 *x, const Word16 headroom, const Word16 length, W { Word32 L_tmp, L_tmp2; Word16 i, shift, tmp; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif move16(); shift = headroom; Loading @@ -1499,8 +1497,8 @@ Word32 Norm32Norm(const Word32 *x, const Word16 headroom, const Word16 length, W if (L_tmp2 >= 0) L_tmp = L_shr(L_tmp, 2); #ifdef BASOP_NOGLOB tmp = round_fx_o(L_shl_o(x[i], shift, &Overflow), &Overflow); L_tmp = L_mac0_o(L_tmp, tmp, tmp, &Overflow); /* exponent = (1-shift*2) , Q(30+shift*2) */ tmp = round_fx_sat(L_shl_sat(x[i], shift)); L_tmp = L_mac0_sat(L_tmp, tmp, tmp); /* exponent = (1-shift*2) , Q(30+shift*2) */ #else tmp = round_fx(L_shl(x[i], shift)); L_tmp = L_mac0(L_tmp, tmp, tmp); /* exponent = (1-shift*2) , Q(30+shift*2) */ Loading lib_dec/er_dec_acelp.c +16 −7 Original line number Diff line number Diff line Loading @@ -93,9 +93,6 @@ void con_acelp( const Word16 scale_h1 = 5; HQ_DEC_HANDLE hHQ_core; TCX_DEC_HANDLE hTcxDec; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif hHQ_core = st->hHQ_core; hTcxDec = st->hTcxDec; Loading Loading @@ -419,7 +416,7 @@ void con_acelp( move16(); BASOP_SATURATE_WARNING_OFF_EVS #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*/ exc[i] = mult_r(exc[i], shl_sat(gain, 1)); /*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 Loading @@ -433,7 +430,11 @@ void con_acelp( { move16(); BASOP_SATURATE_WARNING_OFF_EVS #ifdef BASOP_NOGLOB exc[i] = mult_r(exc[i] , shl_sat(gain,1)); /*overflow is first iteration because gain may become 1 due to shift*/ #else exc[i] = mult_r(exc[i] , shl(gain,1)); /*overflow is first iteration because gain may become 1 due to shift*/ #endif BASOP_SATURATE_WARNING_ON_EVS gain = sub(gain , step); } Loading Loading @@ -532,10 +533,18 @@ void con_acelp( ftmp = round_fx(L_shl(gain_32,1));/*Q0*/ BASOP_SATURATE_WARNING_OFF_EVS #ifdef BASOP_NOGLOB tmp_16 = sub(shl_sat(gainCNG,sub(gainCNG_e,5/*Q5*/)),ftmp); #else tmp_16 = sub(shl(gainCNG,sub(gainCNG_e,5/*Q5*/)),ftmp); #endif /*in case of overflow:*/ test(); #ifdef BASOP_NOGLOB if ((EQ_16(shl_sat(ftmp,sub(gainCNG_e,1)),MAXVAL_WORD16))&&(gainCNG==MAXVAL_WORD16)) #else if ((EQ_16(shl(ftmp,sub(gainCNG_e,1)),MAXVAL_WORD16))&&(gainCNG==MAXVAL_WORD16)) #endif { move16(); tmp_16 = 1; Loading Loading @@ -778,8 +787,8 @@ 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); g_e = add_sat(st->last_gain_syn_deemph_e, gain_lpc_e[i_subfr / L_SUBFR]); g = shl_sat(g, g_e); #else g_e = add(st->last_gain_syn_deemph_e, gain_lpc_e[i_subfr/L_SUBFR]); g = shl(g, g_e); Loading Loading @@ -866,7 +875,7 @@ 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); g = shl_sat(g, g_e); #else g = shl(g, g_e); #endif Loading Loading
lib_com/basop_util.c +3 −5 Original line number Diff line number Diff line Loading @@ -1484,9 +1484,7 @@ Word32 Norm32Norm(const Word32 *x, const Word16 headroom, const Word16 length, W { Word32 L_tmp, L_tmp2; Word16 i, shift, tmp; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif move16(); shift = headroom; Loading @@ -1499,8 +1497,8 @@ Word32 Norm32Norm(const Word32 *x, const Word16 headroom, const Word16 length, W if (L_tmp2 >= 0) L_tmp = L_shr(L_tmp, 2); #ifdef BASOP_NOGLOB tmp = round_fx_o(L_shl_o(x[i], shift, &Overflow), &Overflow); L_tmp = L_mac0_o(L_tmp, tmp, tmp, &Overflow); /* exponent = (1-shift*2) , Q(30+shift*2) */ tmp = round_fx_sat(L_shl_sat(x[i], shift)); L_tmp = L_mac0_sat(L_tmp, tmp, tmp); /* exponent = (1-shift*2) , Q(30+shift*2) */ #else tmp = round_fx(L_shl(x[i], shift)); L_tmp = L_mac0(L_tmp, tmp, tmp); /* exponent = (1-shift*2) , Q(30+shift*2) */ Loading
lib_dec/er_dec_acelp.c +16 −7 Original line number Diff line number Diff line Loading @@ -93,9 +93,6 @@ void con_acelp( const Word16 scale_h1 = 5; HQ_DEC_HANDLE hHQ_core; TCX_DEC_HANDLE hTcxDec; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #endif hHQ_core = st->hHQ_core; hTcxDec = st->hTcxDec; Loading Loading @@ -419,7 +416,7 @@ void con_acelp( move16(); BASOP_SATURATE_WARNING_OFF_EVS #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*/ exc[i] = mult_r(exc[i], shl_sat(gain, 1)); /*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 Loading @@ -433,7 +430,11 @@ void con_acelp( { move16(); BASOP_SATURATE_WARNING_OFF_EVS #ifdef BASOP_NOGLOB exc[i] = mult_r(exc[i] , shl_sat(gain,1)); /*overflow is first iteration because gain may become 1 due to shift*/ #else exc[i] = mult_r(exc[i] , shl(gain,1)); /*overflow is first iteration because gain may become 1 due to shift*/ #endif BASOP_SATURATE_WARNING_ON_EVS gain = sub(gain , step); } Loading Loading @@ -532,10 +533,18 @@ void con_acelp( ftmp = round_fx(L_shl(gain_32,1));/*Q0*/ BASOP_SATURATE_WARNING_OFF_EVS #ifdef BASOP_NOGLOB tmp_16 = sub(shl_sat(gainCNG,sub(gainCNG_e,5/*Q5*/)),ftmp); #else tmp_16 = sub(shl(gainCNG,sub(gainCNG_e,5/*Q5*/)),ftmp); #endif /*in case of overflow:*/ test(); #ifdef BASOP_NOGLOB if ((EQ_16(shl_sat(ftmp,sub(gainCNG_e,1)),MAXVAL_WORD16))&&(gainCNG==MAXVAL_WORD16)) #else if ((EQ_16(shl(ftmp,sub(gainCNG_e,1)),MAXVAL_WORD16))&&(gainCNG==MAXVAL_WORD16)) #endif { move16(); tmp_16 = 1; Loading Loading @@ -778,8 +787,8 @@ 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); g_e = add_sat(st->last_gain_syn_deemph_e, gain_lpc_e[i_subfr / L_SUBFR]); g = shl_sat(g, g_e); #else g_e = add(st->last_gain_syn_deemph_e, gain_lpc_e[i_subfr/L_SUBFR]); g = shl(g, g_e); Loading Loading @@ -866,7 +875,7 @@ 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); g = shl_sat(g, g_e); #else g = shl(g, g_e); #endif Loading