fixes overflows in celt_iir() by doing proper saturation

This commit is contained in:
Jean-Marc Valin 2016-07-22 09:13:00 -04:00
parent 184a4767aa
commit a0bd7d3b84
4 changed files with 12 additions and 6 deletions

View file

@ -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))