diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2012-05-10 12:36:46 -0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2012-05-10 12:36:46 -0400 |
commit | 1a9e8539d38d4bd79fd9717ad8d97b7e95ea264f (patch) | |
tree | c2529486076d100fc4310b094e24fe0932b702c8 /celt | |
parent | 9faea25d29ab18e4d67e50f58da47a5f1753d738 (diff) | |
download | libopus-1a9e8539d38d4bd79fd9717ad8d97b7e95ea264f.tar.gz |
Fixes two fixed-point overflow issues
One in SILK, one in CELT, none of them causing real harm in practice it seems
Diffstat (limited to 'celt')
-rw-r--r-- | celt/celt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/celt/celt.c b/celt/celt.c index 3b1b4f6d..8c9105bd 100644 --- a/celt/celt.c +++ b/celt/celt.c @@ -865,8 +865,9 @@ static int stereo_analysis(const CELTMode *m, const celt_norm *X, R = X[N0+j]; M = L+R; S = L-R; - sumLR += EXTEND32(ABS16(L)) + EXTEND32(ABS16(R)); - sumMS += EXTEND32(ABS16(M)) + EXTEND32(ABS16(S)); + /* We cast to 32-bit first because of the -32768 case */ + sumLR += ABS32(EXTEND32(L)) + ABS32(EXTEND32(R)); + sumMS += ABS32(EXTEND32(M)) + ABS32(EXTEND32(S)); } } sumMS = MULT16_32_Q15(QCONST16(0.707107f, 15), sumMS); |