40 # if !defined(__GNUC_PREREQ) 41 # if defined(__GNUC__)&&defined(__GNUC_MINOR__) 42 # define __GNUC_PREREQ(_maj,_min) \ 43 ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) 45 # define __GNUC_PREREQ(_maj,_min) 0 49 #define CELT_SIG_SCALE 32768.f 51 #define celt_fatal(str) _celt_fatal(str, __FILE__, __LINE__); 52 #ifdef ENABLE_ASSERTIONS 58 static OPUS_INLINE
void _celt_fatal(
const char *
str,
const char *
file,
int line)
60 fprintf (
stderr,
"Fatal (internal) error in %s, line %d: %s\n", file, line, str);
63 #define celt_assert(cond) {if (!(cond)) {celt_fatal("assertion failed: " #cond);}} 64 #define celt_assert2(cond, message) {if (!(cond)) {celt_fatal("assertion failed: " #cond "\n" message);}} 66 #define celt_assert(cond) 67 #define celt_assert2(cond, message) 70 #define IMUL32(a,b) ((a)*(b)) 72 #define MIN16(a,b) ((a) < (b) ? (a) : (b)) 73 #define MAX16(a,b) ((a) > (b) ? (a) : (b)) 74 #define MIN32(a,b) ((a) < (b) ? (a) : (b)) 75 #define MAX32(a,b) ((a) > (b) ? (a) : (b)) 76 #define IMIN(a,b) ((a) < (b) ? (a) : (b)) 77 #define IMAX(a,b) ((a) > (b) ? (a) : (b)) 78 #define UADD32(a,b) ((a)+(b)) 79 #define USUB32(a,b) ((a)-(b)) 84 #if defined(__x86_64__) || defined(__LP64__) || defined(_WIN64) 85 #define OPUS_FAST_INT64 1 87 #define OPUS_FAST_INT64 0 90 #define PRINT_MIPS(file) 105 #define NORM_SCALING 16384 111 #define VERY_LARGE16 ((opus_val16)32767) 112 #define Q15_ONE ((opus_val16)32767) 114 #define SCALEIN(a) (a) 115 #define SCALEOUT(a) (a) 117 #define ABS16(x) ((x) < 0 ? (-(x)) : (x)) 118 #define ABS32(x) ((x) < 0 ? (-(x)) : (x)) 121 return x > 32767 ? 32767 : x < -32768 ? -32768 : (
opus_int16)x;
130 #ifdef OPUS_ARM_PRESUME_AARCH64_NEON_INTR 132 #elif OPUS_ARM_INLINE_EDSP 134 #elif defined (OPUS_ARM_INLINE_ASM) 136 #elif defined (BFIN_ASM) 137 #include "fixed_bfin.h" 138 #elif defined (TI_C5X_ASM) 139 #include "fixed_c5x.h" 140 #elif defined (TI_C6X_ASM) 141 #include "fixed_c6x.h" 162 return ((in.i>>23)&0xFF)==0xFF && (in.i&0x007FFFFF)!=0;
166 #error Cannot build libopus with -ffast-math unless FLOAT_APPROX is defined. This could result in crashes on extreme (e.g. NaN) input 168 #define celt_isnan(x) ((x)!=(x)) 173 #define NORM_SCALING 1.f 175 #define EPSILON 1e-15f 176 #define VERY_SMALL 1e-30f 177 #define VERY_LARGE16 1e15f 178 #define Q15_ONE ((opus_val16)1.f) 181 #define ABS16(x) ((float)fabs(x)) 182 #define ABS32(x) ((float)fabs(x)) 184 #define QCONST16(x,bits) (x) 185 #define QCONST32(x,bits) (x) 187 #define NEG16(x) (-(x)) 188 #define NEG32(x) (-(x)) 189 #define EXTRACT16(x) (x) 190 #define EXTEND32(x) (x) 191 #define SHR16(a,shift) (a) 192 #define SHL16(a,shift) (a) 193 #define SHR32(a,shift) (a) 194 #define SHL32(a,shift) (a) 195 #define PSHR32(a,shift) (a) 196 #define VSHR32(a,shift) (a) 198 #define PSHR(a,shift) (a) 199 #define SHR(a,shift) (a) 200 #define SHL(a,shift) (a) 201 #define SATURATE(x,a) (x) 202 #define SATURATE16(x) (x) 204 #define ROUND16(a,shift) (a) 205 #define HALF16(x) (.5f*(x)) 206 #define HALF32(x) (.5f*(x)) 208 #define ADD16(a,b) ((a)+(b)) 209 #define SUB16(a,b) ((a)-(b)) 210 #define ADD32(a,b) ((a)+(b)) 211 #define SUB32(a,b) ((a)-(b)) 212 #define MULT16_16_16(a,b) ((a)*(b)) 213 #define MULT16_16(a,b) ((opus_val32)(a)*(opus_val32)(b)) 214 #define MAC16_16(c,a,b) ((c)+(opus_val32)(a)*(opus_val32)(b)) 216 #define MULT16_32_Q15(a,b) ((a)*(b)) 217 #define MULT16_32_Q16(a,b) ((a)*(b)) 219 #define MULT32_32_Q31(a,b) ((a)*(b)) 221 #define MAC16_32_Q15(c,a,b) ((c)+(a)*(b)) 222 #define MAC16_32_Q16(c,a,b) ((c)+(a)*(b)) 224 #define MULT16_16_Q11_32(a,b) ((a)*(b)) 225 #define MULT16_16_Q11(a,b) ((a)*(b)) 226 #define MULT16_16_Q13(a,b) ((a)*(b)) 227 #define MULT16_16_Q14(a,b) ((a)*(b)) 228 #define MULT16_16_Q15(a,b) ((a)*(b)) 229 #define MULT16_16_P15(a,b) ((a)*(b)) 230 #define MULT16_16_P13(a,b) ((a)*(b)) 231 #define MULT16_16_P14(a,b) ((a)*(b)) 232 #define MULT16_32_P16(a,b) ((a)*(b)) 234 #define DIV32_16(a,b) (((opus_val32)(a))/(opus_val16)(b)) 235 #define DIV32(a,b) (((opus_val32)(a))/(opus_val32)(b)) 237 #define SCALEIN(a) ((a)*CELT_SIG_SCALE) 238 #define SCALEOUT(a) ((a)*(1/CELT_SIG_SCALE)) 240 #define SIG2WORD16(x) (x) 244 #ifndef GLOBAL_STACK_SIZE 246 #define GLOBAL_STACK_SIZE 100000 248 #define GLOBAL_STACK_SIZE 100000 line
Definition: buildtests.py:37
Opus reference implementation types.
float celt_sig
Definition: arch.h:151
short opus_int16
Definition: opus_types.h:144
#define celt_isnan(x)
Definition: arch.h:168
Generic fixed-point operations.
Opus reference implementation constants.
float opus_val16
Definition: arch.h:148
VoEFile * file
Definition: voe_cmd_test.cc:59
stderr
Definition: barcode_decoder.py:21
EGLSurface EGLint x
Definition: eglext.h:950
int opus_int32
Definition: opus_types.h:146
float celt_norm
Definition: arch.h:152
int aint __attribute__((__aligned__(16)))
Definition: gcc-loops.cpp:73
GLfloat f
Definition: gl2.h:417
str
Definition: make-dist.py:305
Fixed-point operations with debugging.
for i
Definition: complexityMeasures.m:24
unsigned int opus_uint32
Definition: opus_types.h:147
abort
Definition: config.py:261
float opus_val32
Definition: arch.h:149
float celt_ener
Definition: arch.h:153