summaryrefslogtreecommitdiff
path: root/celt/fixed_debug.h
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2016-07-22 09:13:00 -0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-07-22 15:57:01 -0400
commita0bd7d3b8420be9c96f4e65e6113e11a05a23717 (patch)
tree2340ab65493a3cf8c13cd3276de4b3ef97effdfc /celt/fixed_debug.h
parent184a4767aad0e813cffa4aa178e0c161a4d17253 (diff)
downloadopus-a0bd7d3b8420be9c96f4e65e6113e11a05a23717.tar.gz
fixes overflows in celt_iir() by doing proper saturation
Diffstat (limited to 'celt/fixed_debug.h')
-rw-r--r--celt/fixed_debug.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/celt/fixed_debug.h b/celt/fixed_debug.h
index f55dbf92..c9546a7d 100644
--- a/celt/fixed_debug.h
+++ b/celt/fixed_debug.h
@@ -233,6 +233,8 @@ static OPUS_INLINE int SHL32_(opus_int64 a, int shift, char *file, int line)
#define VSHR32(a, shift) (((shift)>0) ? SHR32(a, shift) : SHL32(a, -(shift)))
#define ROUND16(x,a) (celt_mips--,EXTRACT16(PSHR32((x),(a))))
+#define SROUND16(x,a) (celt_mips--,EXTRACT16(SATURATE(PSHR32(x,a), 32767)));
+
#define HALF16(x) (SHR16(x,1))
#define HALF32(x) (SHR32(x,1))