#ifndef ARCH_H
#define ARCH_H
#include "opus_types.h"
#include "opus_defines.h"
# if !defined(__GNUC_PREREQ)
# if defined(__GNUC__)&&defined(__GNUC_MINOR__)
#define __GNUC_PREREQ …
# else
#define __GNUC_PREREQ …
# endif
# endif
#if OPUS_GNUC_PREREQ(3, 0)
#define opus_likely(x) …
#define opus_unlikely(x) …
#else
#define opus_likely …
#define opus_unlikely …
#endif
#define CELT_SIG_SCALE …
#define CELT_FATAL(str) …
#if defined(ENABLE_ASSERTIONS) || defined(ENABLE_HARDENING)
#ifdef __GNUC__
__attribute__((noreturn))
#endif
void celt_fatal(const char *str, const char *file, int line);
#if defined(CELT_C) && !defined(OVERRIDE_celt_fatal)
#include <stdio.h>
#include <stdlib.h>
#ifdef __GNUC__
__attribute__((noreturn))
#endif
void celt_fatal(const char *str, const char *file, int line)
{
#if !defined(CHROMIUM_NO_LOGGING)
fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str);
#endif
#if defined(_MSC_VER)
_set_abort_behavior( 0, _WRITE_ABORT_MSG);
#endif
abort();
}
#endif
#define celt_assert(cond) …
#define celt_assert2(cond, message) …
#define MUST_SUCCEED(call) …
#else
#define celt_assert …
#define celt_assert2 …
#define MUST_SUCCEED …
#endif
#if defined(ENABLE_ASSERTIONS)
#define celt_sig_assert …
#else
#define celt_sig_assert(cond) …
#endif
#define IMUL32(a,b) …
#define MIN16(a,b) …
#define MAX16(a,b) …
#define MIN32(a,b) …
#define MAX32(a,b) …
#define IMIN(a,b) …
#define IMAX(a,b) …
#define UADD32(a,b) …
#define USUB32(a,b) …
#if defined(__x86_64__) || defined(__LP64__) || defined(_WIN64)
#define OPUS_FAST_INT64 …
#else
#define OPUS_FAST_INT64 …
#endif
#define PRINT_MIPS(file) …
#ifdef FIXED_POINT
typedef opus_int16 opus_val16;
typedef opus_int32 opus_val32;
typedef opus_int64 opus_val64;
typedef opus_val32 celt_sig;
typedef opus_val16 celt_norm;
typedef opus_val32 celt_ener;
#define celt_isnan …
#define Q15ONE …
#define SIG_SHIFT …
#define SIG_SAT …
#define NORM_SCALING …
#define DB_SHIFT …
#define EPSILON …
#define VERY_SMALL …
#define VERY_LARGE16 …
#define Q15_ONE …
#define SCALEIN …
#define SCALEOUT …
#define ABS16 …
#define ABS32 …
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
#include "fixed_generic.h"
#ifdef OPUS_ARM_PRESUME_AARCH64_NEON_INTR
#include "arm/fixed_arm64.h"
#elif defined (OPUS_ARM_INLINE_EDSP)
#include "arm/fixed_armv5e.h"
#elif defined (OPUS_ARM_INLINE_ASM)
#include "arm/fixed_armv4.h"
#elif defined (BFIN_ASM)
#include "fixed_bfin.h"
#elif defined (TI_C5X_ASM)
#include "fixed_c5x.h"
#elif defined (TI_C6X_ASM)
#include "fixed_c6x.h"
#endif
#endif
#else
opus_val16;
opus_val32;
opus_val64;
celt_sig;
celt_norm;
celt_ener;
#ifdef FLOAT_APPROX
static OPUS_INLINE int celt_isnan(float x)
{
union {float f; opus_uint32 i;} in;
in.f = x;
return ((in.i>>23)&0xFF)==0xFF && (in.i&0x007FFFFF)!=0;
}
#else
#ifdef __FAST_MATH__
#error Cannot build libopus with -ffast-math unless FLOAT_APPROX is defined. This could result in crashes on extreme (e.g. NaN) input
#endif
#define celt_isnan(x) …
#endif
#define Q15ONE …
#define NORM_SCALING …
#define EPSILON …
#define VERY_SMALL …
#define VERY_LARGE16 …
#define Q15_ONE …
#define ABS16(x) …
#define ABS32(x) …
#define QCONST16(x,bits) …
#define QCONST32(x,bits) …
#define NEG16(x) …
#define NEG32(x) …
#define NEG32_ovflw(x) …
#define EXTRACT16(x) …
#define EXTEND32(x) …
#define SHR16(a,shift) …
#define SHL16(a,shift) …
#define SHR32(a,shift) …
#define SHL32(a,shift) …
#define PSHR32(a,shift) …
#define VSHR32(a,shift) …
#define PSHR(a,shift) …
#define SHR(a,shift) …
#define SHL(a,shift) …
#define SATURATE(x,a) …
#define SATURATE16(x) …
#define ROUND16(a,shift) …
#define SROUND16(a,shift) …
#define HALF16(x) …
#define HALF32(x) …
#define ADD16(a,b) …
#define SUB16(a,b) …
#define ADD32(a,b) …
#define SUB32(a,b) …
#define ADD32_ovflw(a,b) …
#define SUB32_ovflw(a,b) …
#define MULT16_16_16(a,b) …
#define MULT16_16(a,b) …
#define MAC16_16(c,a,b) …
#define MULT16_32_Q15(a,b) …
#define MULT16_32_Q16(a,b) …
#define MULT32_32_Q31(a,b) …
#define MAC16_32_Q15(c,a,b) …
#define MAC16_32_Q16(c,a,b) …
#define MULT16_16_Q11_32(a,b) …
#define MULT16_16_Q11(a,b) …
#define MULT16_16_Q13(a,b) …
#define MULT16_16_Q14(a,b) …
#define MULT16_16_Q15(a,b) …
#define MULT16_16_P15(a,b) …
#define MULT16_16_P13(a,b) …
#define MULT16_16_P14(a,b) …
#define MULT16_32_P16(a,b) …
#define DIV32_16(a,b) …
#define DIV32(a,b) …
#define SCALEIN(a) …
#define SCALEOUT(a) …
#define SIG2WORD16(x) …
#endif
#ifndef GLOBAL_STACK_SIZE
#ifdef FIXED_POINT
#define GLOBAL_STACK_SIZE …
#else
#define GLOBAL_STACK_SIZE …
#endif
#endif
#endif