diff options
author | Jenkins2 <jenkins2@gerrit.asterisk.org> | 2018-01-09 05:59:45 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2018-01-09 05:59:45 -0600 |
commit | e8f81a2905b121b87d5d3e9b63f74b6bf98596c0 (patch) | |
tree | 1f7bda69a158176970b7be09ce5950f6ca816342 | |
parent | 3a8744b59bfec5b145464816f47a7f4b8064afff (diff) | |
parent | e60135efd40314f7139f8906bb0fbe7b264a059e (diff) |
Merge "codec_gsm: Avoid shifting a negative signed value." into 13
-rw-r--r-- | codecs/gsm/src/short_term.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/codecs/gsm/src/short_term.c b/codecs/gsm/src/short_term.c index 4172d322c..d22d276ba 100644 --- a/codecs/gsm/src/short_term.c +++ b/codecs/gsm/src/short_term.c @@ -55,21 +55,21 @@ static void Decoding_of_the_coded_Log_Area_Ratios P2((LARc,LARpp), */ #undef STEP -#define STEP( B, MIC, INVA ) \ +#define STEP( B_TIMES_TWO, MIC, INVA ) \ temp1 = GSM_ADD( *LARc++, MIC ) << 10; \ - temp1 = GSM_SUB( temp1, B << 1 ); \ + temp1 = GSM_SUB( temp1, B_TIMES_TWO ); \ temp1 = (word)GSM_MULT_R( INVA, temp1 ); \ *LARpp++ = GSM_ADD( temp1, temp1 ); STEP( 0, -32, 13107 ); STEP( 0, -32, 13107 ); - STEP( 2048, -16, 13107 ); - STEP( -2560, -16, 13107 ); + STEP( 4096, -16, 13107 ); + STEP( -5120, -16, 13107 ); - STEP( 94, -8, 19223 ); - STEP( -1792, -8, 17476 ); - STEP( -341, -4, 31454 ); - STEP( -1144, -4, 29708 ); + STEP( 188, -8, 19223 ); + STEP( -3584, -8, 17476 ); + STEP( -682, -4, 31454 ); + STEP( -2288, -4, 29708 ); /* NOTE: the addition of *MIC is used to restore * the sign of *LARc. |