aboutsummaryrefslogtreecommitdiff
path: root/celt/arch.h
diff options
context:
space:
mode:
Diffstat (limited to 'celt/arch.h')
-rw-r--r--celt/arch.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/celt/arch.h b/celt/arch.h
index 25cc0b77..8c79a66e 100644
--- a/celt/arch.h
+++ b/celt/arch.h
@@ -108,6 +108,10 @@ typedef opus_val32 celt_ener;
#define ABS16(x) ((x) < 0 ? (-(x)) : (x))
#define ABS32(x) ((x) < 0 ? (-(x)) : (x))
+static OPUS_INLINE opus_int16 SAT16(opus_int32 x) {
+ return x > 32767 ? 32767 : x < -32768 ? -32768 : (opus_int16)x;
+}
+
#ifdef FIXED_DEBUG
#include "fixed_debug.h"
#else