silencing overflows in MDCT and FFT

This commit is contained in:
Jean-Marc Valin 2016-07-21 19:40:23 -04:00
parent ae33218495
commit 273906404c
6 changed files with 59 additions and 44 deletions

View file

@ -59,6 +59,12 @@ extern opus_int64 celt_mips;
#define SHR(a,b) SHR32(a,b)
#define PSHR(a,b) PSHR32(a,b)
/** Add two 32-bit values, ignore any overflows */
#define ADD32_ovflw(a,b) (celt_mips+=2,(opus_val32)((opus_uint32)(a)+(opus_uint32)(b)))
/** Subtract two 32-bit values, ignore any overflows */
#define SUB32_ovflw(a,b) (celt_mips+=2,(opus_val32)((opus_uint32)(a)-(opus_uint32)(b)))
#define NEG32_ovflw(a) (celt_mips+=2,(opus_val32)(-(opus_uint32)(a)))
static OPUS_INLINE short NEG16(int x)
{
int res;