FreeCalypso > hg > gsm-codec-lib
changeset 193:cf39a90f5196
libgsmefr/dtx_enc.c: perf opt
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 04 Jan 2023 03:22:35 +0000 |
parents | 0303ba213e1c |
children | f151d6c18b31 |
files | libgsmefr/dtx_enc.c |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libgsmefr/dtx_enc.c Tue Jan 03 04:51:51 2023 +0000 +++ b/libgsmefr/dtx_enc.c Wed Jan 04 03:22:35 2023 +0000 @@ -100,7 +100,7 @@ /* If voice activity was detected, reset hangover counter */ - if (sub (VAD_flag, 1) == 0) + if (VAD_flag == 1) { st->txdtx_hangover = DTX_HANGOVER; st->txdtx_ctrl = TX_SP_FLAG | TX_VAD_FLAG; @@ -128,7 +128,7 @@ else { /* Hangover period is not over, update hangover counter */ - st->txdtx_hangover = sub (st->txdtx_hangover, 1); + st->txdtx_hangover--; /* Check if elapsed time from last SID update is greater than threshold. If not, set SP=0 (although hangover period is not @@ -137,8 +137,8 @@ to avoid erroneus SP=1 decision in case when N_elapsed is grown bigger than threshold and hangover period is still active */ - if (sub (add (st->txdtx_N_elapsed, st->txdtx_hangover), - DTX_ELAPSED_THRESHOLD) < 0) + if (add (st->txdtx_N_elapsed, st->txdtx_hangover) < + DTX_ELAPSED_THRESHOLD) { /* old SID frame should be used */ st->txdtx_ctrl = TX_USE_OLD_SID; @@ -304,13 +304,13 @@ /* Circular buffer */ st->gain_code_old_tx[st->buf_p_tx] = new_gain_code; - if (sub (st->buf_p_tx, (4 * DTX_HANGOVER - 1)) == 0) + if (st->buf_p_tx == (4 * DTX_HANGOVER - 1)) { st->buf_p_tx = 0; } else { - st->buf_p_tx = add (st->buf_p_tx, 1); + st->buf_p_tx++; } return; @@ -353,7 +353,7 @@ } test (); - if (L_sub (L_temp, MAX_32) == 0) + if (L_temp == MAX_32) { norm = add (norm, 1); overfl = 1; move16 (); /* Set the overflow flag */