Commit 7830cf1b authored by Gregory Maxwell's avatar Gregory Maxwell
Browse files

Replace "inline" with OPUS_INLINE.

Newer versions of MSVC are unhappy with the strategy of the build
 environment redefining "inline" (even though they don't support the
 actual keyword). Instead we define OPUS_INLINE to the right thing
 in opus_defines.h.

This is the same approach we use for restrict.
parent 2891d852
......@@ -12,9 +12,7 @@ CFLAGS := -DUSE_ALLOCA $(CFLAGS)
# These options affect performance
# HAVE_LRINTF: Use C99 intrinsics to speed up float-to-int conversion
# inline: Don't use the 'inline' keyword (for ANSI C compilers)
#CFLAGS := -DHAVE_LRINTF $(CFLAGS)
#CFLAGS := -Dinline= $(CFLAGS)
###################### END OF OPTIONS ######################
......
......@@ -35,6 +35,7 @@
#define ARCH_H
#include "opus_types.h"
#include "opus_defines.h"
# if !defined(__GNUC_PREREQ)
# if defined(__GNUC__)&&defined(__GNUC_MINOR__)
......@@ -54,7 +55,7 @@
#ifdef __GNUC__
__attribute__((noreturn))
#endif
static inline void _celt_fatal(const char *str, const char *file, int line)
static OPUS_INLINE void _celt_fatal(const char *str, const char *file, int line)
{
fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str);
abort();
......
......@@ -49,10 +49,10 @@
# define WIN32_EXTRA_LEAN
# include <windows.h>
static inline opus_uint32 opus_cpu_capabilities(void){
static OPUS_INLINE opus_uint32 opus_cpu_capabilities(void){
opus_uint32 flags;
flags=0;
/* MSVC has no inline __asm support for ARM, but it does let you __emit
/* MSVC has no OPUS_INLINE __asm support for ARM, but it does let you __emit
* instructions via their assembled hex code.
* All of these instructions should be essentially nops. */
# if defined(ARMv5E_ASM)
......
......@@ -29,7 +29,7 @@
/** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q16
static inline opus_val32 MULT16_32_Q16_armv4(opus_val16 a, opus_val32 b)
static OPUS_INLINE opus_val32 MULT16_32_Q16_armv4(opus_val16 a, opus_val32 b)
{
unsigned rd_lo;
int rd_hi;
......@@ -46,7 +46,7 @@ static inline opus_val32 MULT16_32_Q16_armv4(opus_val16 a, opus_val32 b)
/** 16x32 multiplication, followed by a 15-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q15
static inline opus_val32 MULT16_32_Q15_armv4(opus_val16 a, opus_val32 b)
static OPUS_INLINE opus_val32 MULT16_32_Q15_armv4(opus_val16 a, opus_val32 b)
{
unsigned rd_lo;
int rd_hi;
......
......@@ -34,7 +34,7 @@
/** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q16
static inline opus_val32 MULT16_32_Q16_armv5e(opus_val16 a, opus_val32 b)
static OPUS_INLINE opus_val32 MULT16_32_Q16_armv5e(opus_val16 a, opus_val32 b)
{
int res;
__asm__(
......@@ -50,7 +50,7 @@ static inline opus_val32 MULT16_32_Q16_armv5e(opus_val16 a, opus_val32 b)
/** 16x32 multiplication, followed by a 15-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q15
static inline opus_val32 MULT16_32_Q15_armv5e(opus_val16 a, opus_val32 b)
static OPUS_INLINE opus_val32 MULT16_32_Q15_armv5e(opus_val16 a, opus_val32 b)
{
int res;
__asm__(
......@@ -68,7 +68,7 @@ static inline opus_val32 MULT16_32_Q15_armv5e(opus_val16 a, opus_val32 b)
b must fit in 31 bits.
Result fits in 32 bits. */
#undef MAC16_32_Q15
static inline opus_val32 MAC16_32_Q15_armv5e(opus_val32 c, opus_val16 a,
static OPUS_INLINE opus_val32 MAC16_32_Q15_armv5e(opus_val32 c, opus_val16 a,
opus_val32 b)
{
int res;
......@@ -84,7 +84,7 @@ static inline opus_val32 MAC16_32_Q15_armv5e(opus_val32 c, opus_val16 a,
/** 16x16 multiply-add where the result fits in 32 bits */
#undef MAC16_16
static inline opus_val32 MAC16_16_armv5e(opus_val32 c, opus_val16 a,
static OPUS_INLINE opus_val32 MAC16_16_armv5e(opus_val32 c, opus_val16 a,
opus_val16 b)
{
int res;
......@@ -100,7 +100,7 @@ static inline opus_val32 MAC16_16_armv5e(opus_val32 c, opus_val16 a,
/** 16x16 multiplication where the result fits in 32 bits */
#undef MULT16_16
static inline opus_val32 MULT16_16_armv5e(opus_val16 a, opus_val16 b)
static OPUS_INLINE opus_val32 MULT16_16_armv5e(opus_val16 a, opus_val16 b)
{
int res;
__asm__(
......
......@@ -138,7 +138,7 @@ int celt_decode_with_ec(OpusCustomDecoder * OPUS_RESTRICT st, const unsigned cha
#ifdef CUSTOM_MODES
#define OPUS_CUSTOM_NOSTATIC
#else
#define OPUS_CUSTOM_NOSTATIC static inline
#define OPUS_CUSTOM_NOSTATIC static OPUS_INLINE
#endif
static const unsigned char trim_icdf[11] = {126, 124, 119, 109, 87, 41, 19, 9, 4, 2, 0};
......@@ -163,7 +163,7 @@ static const unsigned char fromOpusTable[16] = {
0x00, 0x08, 0x10, 0x18
};
static inline int toOpus(unsigned char c)
static OPUS_INLINE int toOpus(unsigned char c)
{
int ret=0;
if (c<0xA0)
......@@ -174,7 +174,7 @@ static inline int toOpus(unsigned char c)
return ret|(c&0x7);
}
static inline int fromOpus(unsigned char c)
static OPUS_INLINE int fromOpus(unsigned char c)
{
if (c<0x80)
return -1;
......
......@@ -175,7 +175,7 @@ void opus_custom_decoder_destroy(CELTDecoder *st)
}
#endif /* CUSTOM_MODES */
static inline opus_val16 SIG2WORD16(celt_sig x)
static OPUS_INLINE opus_val16 SIG2WORD16(celt_sig x)
{
#ifdef FIXED_POINT
x = PSHR32(x, SIG_SHIFT);
......
......@@ -28,6 +28,9 @@
#ifndef CPU_SUPPORT_H
#define CPU_SUPPORT_H
#include "opus_types.h"
#include "opus_defines.h"
#if defined(OPUS_HAVE_RTCD) && defined(ARMv4_ASM)
#include "arm/armcpu.h"
......@@ -42,7 +45,7 @@
#else
#define OPUS_ARCHMASK 0
static inline int opus_select_arch(void)
static OPUS_INLINE int opus_select_arch(void)
{
return 0;
}
......
......@@ -534,7 +534,7 @@ void decode_pulses(int *_y,int _n,int _k,ec_dec *_dec){
/*Computes the next row/column of any recurrence that obeys the relation
u[i][j]=u[i-1][j]+u[i][j-1]+u[i-1][j-1].
_ui0 is the base case for the new row/column.*/
static inline void unext(opus_uint32 *_ui,unsigned _len,opus_uint32 _ui0){
static OPUS_INLINE void unext(opus_uint32 *_ui,unsigned _len,opus_uint32 _ui0){
opus_uint32 ui1;
unsigned j;
/*This do-while will overrun the array if we don't have storage for at least
......@@ -550,7 +550,7 @@ static inline void unext(opus_uint32 *_ui,unsigned _len,opus_uint32 _ui0){
/*Computes the previous row/column of any recurrence that obeys the relation
u[i-1][j]=u[i][j]-u[i][j-1]-u[i-1][j-1].
_ui0 is the base case for the new row/column.*/
static inline void uprev(opus_uint32 *_ui,unsigned _n,opus_uint32 _ui0){
static OPUS_INLINE void uprev(opus_uint32 *_ui,unsigned _n,opus_uint32 _ui0){
opus_uint32 ui1;
unsigned j;
/*This do-while will overrun the array if we don't have storage for at least
......@@ -617,7 +617,7 @@ static void cwrsi(int _n,int _k,opus_uint32 _i,int *_y,opus_uint32 *_u){
of size 1 with associated sign bits.
_y: The vector of pulses, whose sum of absolute values is K.
_k: Returns K.*/
static inline opus_uint32 icwrs1(const int *_y,int *_k){
static OPUS_INLINE opus_uint32 icwrs1(const int *_y,int *_k){
*_k=abs(_y[0]);
return _y[0]<0;
}
......@@ -626,7 +626,7 @@ static inline opus_uint32 icwrs1(const int *_y,int *_k){
of size _n with associated sign bits.
_y: The vector of pulses, whose sum of absolute values must be _k.
_nc: Returns V(_n,_k).*/
static inline opus_uint32 icwrs(int _n,int _k,opus_uint32 *_nc,const int *_y,
static OPUS_INLINE opus_uint32 icwrs(int _n,int _k,opus_uint32 *_nc,const int *_y,
opus_uint32 *_u){
opus_uint32 i;
int j;
......
......@@ -33,7 +33,7 @@
#if !defined(_ecintrin_H)
# define _ecintrin_H (1)
/*Some specific platforms may have optimized intrinsic or inline assembly
/*Some specific platforms may have optimized intrinsic or OPUS_INLINE assembly
versions of these functions which can substantially improve performance.
We define macros for them to allow easy incorporation of these non-ANSI
features.*/
......
......@@ -26,6 +26,7 @@
*/
#include "opus_types.h"
#include "opus_defines.h"
#if !defined(_entcode_H)
# define _entcode_H (1)
......@@ -83,15 +84,15 @@ struct ec_ctx{
int error;
};
static inline opus_uint32 ec_range_bytes(ec_ctx *_this){
static OPUS_INLINE opus_uint32 ec_range_bytes(ec_ctx *_this){
return _this->offs;
}
static inline unsigned char *ec_get_buffer(ec_ctx *_this){
static OPUS_INLINE unsigned char *ec_get_buffer(ec_ctx *_this){
return _this->buf;
}
static inline int ec_get_error(ec_ctx *_this){
static OPUS_INLINE int ec_get_error(ec_ctx *_this){
return _this->error;
}
......@@ -101,7 +102,7 @@ static inline int ec_get_error(ec_ctx *_this){
Return: The number of bits.
This will always be slightly larger than the exact value (e.g., all
rounding error is in the positive direction).*/
static inline int ec_tell(ec_ctx *_this){
static OPUS_INLINE int ec_tell(ec_ctx *_this){
return _this->nbits_total-EC_ILOG(_this->rng);
}
......
......@@ -34,7 +34,7 @@
#include "dsplib.h"
#undef IMUL32
static inline long IMUL32(long i, long j)
static OPUS_INLINE long IMUL32(long i, long j)
{
long ac0, ac1;
ac0 = _lmpy(i>>16,j);
......
......@@ -33,9 +33,9 @@
#define FIXED_DEBUG_H
#include <stdio.h>
#include "opus_defines.h"
#ifdef CELT_C
#include "opus_defines.h"
OPUS_EXPORT opus_int64 celt_mips=0;
#else
extern opus_int64 celt_mips;
......@@ -59,7 +59,7 @@ extern opus_int64 celt_mips;
#define SHR(a,b) SHR32(a,b)
#define PSHR(a,b) PSHR32(a,b)
static inline short NEG16(int x)
static OPUS_INLINE short NEG16(int x)
{
int res;
if (!VERIFY_SHORT(x))
......@@ -80,7 +80,7 @@ static inline short NEG16(int x)
celt_mips++;
return res;
}
static inline int NEG32(opus_int64 x)
static OPUS_INLINE int NEG32(opus_int64 x)
{
opus_int64 res;
if (!VERIFY_INT(x))
......@@ -103,7 +103,7 @@ static inline int NEG32(opus_int64 x)
}
#define EXTRACT16(x) EXTRACT16_(x, __FILE__, __LINE__)
static inline short EXTRACT16_(int x, char *file, int line)
static OPUS_INLINE short EXTRACT16_(int x, char *file, int line)
{
int res;
if (!VERIFY_SHORT(x))
......@@ -119,7 +119,7 @@ static inline short EXTRACT16_(int x, char *file, int line)
}
#define EXTEND32(x) EXTEND32_(x, __FILE__, __LINE__)
static inline int EXTEND32_(int x, char *file, int line)
static OPUS_INLINE int EXTEND32_(int x, char *file, int line)
{
int res;
if (!VERIFY_SHORT(x))
......@@ -135,7 +135,7 @@ static inline int EXTEND32_(int x, char *file, int line)
}
#define SHR16(a, shift) SHR16_(a, shift, __FILE__, __LINE__)
static inline short SHR16_(int a, int shift, char *file, int line)
static OPUS_INLINE short SHR16_(int a, int shift, char *file, int line)
{
int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift))
......@@ -157,7 +157,7 @@ static inline short SHR16_(int a, int shift, char *file, int line)
return res;
}
#define SHL16(a, shift) SHL16_(a, shift, __FILE__, __LINE__)
static inline short SHL16_(int a, int shift, char *file, int line)
static OPUS_INLINE short SHL16_(int a, int shift, char *file, int line)
{
int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift))
......@@ -179,7 +179,7 @@ static inline short SHL16_(int a, int shift, char *file, int line)
return res;
}
static inline int SHR32(opus_int64 a, int shift)
static OPUS_INLINE int SHR32(opus_int64 a, int shift)
{
opus_int64 res;
if (!VERIFY_INT(a) || !VERIFY_SHORT(shift))
......@@ -201,7 +201,7 @@ static inline int SHR32(opus_int64 a, int shift)
return res;
}
#define SHL32(a, shift) SHL32_(a, shift, __FILE__, __LINE__)
static inline int SHL32_(opus_int64 a, int shift, char *file, int line)
static OPUS_INLINE int SHL32_(opus_int64 a, int shift, char *file, int line)
{
opus_int64 res;
if (!VERIFY_INT(a) || !VERIFY_SHORT(shift))
......@@ -234,7 +234,7 @@ static inline int SHL32_(opus_int64 a, int shift, char *file, int line)
//#define SHL(a,shift) ((a) << (shift))
#define ADD16(a, b) ADD16_(a, b, __FILE__, __LINE__)
static inline short ADD16_(int a, int b, char *file, int line)
static OPUS_INLINE short ADD16_(int a, int b, char *file, int line)
{
int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
......@@ -257,7 +257,7 @@ static inline short ADD16_(int a, int b, char *file, int line)
}
#define SUB16(a, b) SUB16_(a, b, __FILE__, __LINE__)
static inline short SUB16_(int a, int b, char *file, int line)
static OPUS_INLINE short SUB16_(int a, int b, char *file, int line)
{
int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
......@@ -280,7 +280,7 @@ static inline short SUB16_(int a, int b, char *file, int line)
}
#define ADD32(a, b) ADD32_(a, b, __FILE__, __LINE__)
static inline int ADD32_(opus_int64 a, opus_int64 b, char *file, int line)
static OPUS_INLINE int ADD32_(opus_int64 a, opus_int64 b, char *file, int line)
{
opus_int64 res;
if (!VERIFY_INT(a) || !VERIFY_INT(b))
......@@ -303,7 +303,7 @@ static inline int ADD32_(opus_int64 a, opus_int64 b, char *file, int line)
}
#define SUB32(a, b) SUB32_(a, b, __FILE__, __LINE__)
static inline int SUB32_(opus_int64 a, opus_int64 b, char *file, int line)
static OPUS_INLINE int SUB32_(opus_int64 a, opus_int64 b, char *file, int line)
{
opus_int64 res;
if (!VERIFY_INT(a) || !VERIFY_INT(b))
......@@ -327,7 +327,7 @@ static inline int SUB32_(opus_int64 a, opus_int64 b, char *file, int line)
#undef UADD32
#define UADD32(a, b) UADD32_(a, b, __FILE__, __LINE__)
static inline unsigned int UADD32_(opus_uint64 a, opus_uint64 b, char *file, int line)
static OPUS_INLINE unsigned int UADD32_(opus_uint64 a, opus_uint64 b, char *file, int line)
{
opus_uint64 res;
if (!VERIFY_UINT(a) || !VERIFY_UINT(b))
......@@ -351,7 +351,7 @@ static inline unsigned int UADD32_(opus_uint64 a, opus_uint64 b, char *file, int
#undef USUB32
#define USUB32(a, b) USUB32_(a, b, __FILE__, __LINE__)
static inline unsigned int USUB32_(opus_uint64 a, opus_uint64 b, char *file, int line)
static OPUS_INLINE unsigned int USUB32_(opus_uint64 a, opus_uint64 b, char *file, int line)
{
opus_uint64 res;
if (!VERIFY_UINT(a) || !VERIFY_UINT(b))
......@@ -381,7 +381,7 @@ static inline unsigned int USUB32_(opus_uint64 a, opus_uint64 b, char *file, int
}
/* result fits in 16 bits */
static inline short MULT16_16_16(int a, int b)
static OPUS_INLINE short MULT16_16_16(int a, int b)
{
int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
......@@ -404,7 +404,7 @@ static inline short MULT16_16_16(int a, int b)
}
#define MULT16_16(a, b) MULT16_16_(a, b, __FILE__, __LINE__)
static inline int MULT16_16_(int a, int b, char *file, int line)
static OPUS_INLINE int MULT16_16_(int a, int b, char *file, int line)
{
opus_int64 res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
......@@ -429,7 +429,7 @@ static inline int MULT16_16_(int a, int b, char *file, int line)
#define MAC16_16(c,a,b) (celt_mips-=2,ADD32((c),MULT16_16((a),(b))))
#define MULT16_32_QX(a, b, Q) MULT16_32_QX_(a, b, Q, __FILE__, __LINE__)
static inline int MULT16_32_QX_(int a, opus_int64 b, int Q, char *file, int line)
static OPUS_INLINE int MULT16_32_QX_(int a, opus_int64 b, int Q, char *file, int line)
{
opus_int64 res;
if (!VERIFY_SHORT(a) || !VERIFY_INT(b))
......@@ -462,7 +462,7 @@ static inline int MULT16_32_QX_(int a, opus_int64 b, int Q, char *file, int line
}
#define MULT16_32_PX(a, b, Q) MULT16_32_PX_(a, b, Q, __FILE__, __LINE__)
static inline int MULT16_32_PX_(int a, opus_int64 b, int Q, char *file, int line)
static OPUS_INLINE int MULT16_32_PX_(int a, opus_int64 b, int Q, char *file, int line)
{
opus_int64 res;
if (!VERIFY_SHORT(a) || !VERIFY_INT(b))
......@@ -497,7 +497,7 @@ static inline int MULT16_32_PX_(int a, opus_int64 b, int Q, char *file, int line
#define MULT16_32_Q15(a,b) MULT16_32_QX(a,b,15)
#define MAC16_32_Q15(c,a,b) (celt_mips-=2,ADD32((c),MULT16_32_Q15((a),(b))))
static inline int SATURATE(int a, int b)
static OPUS_INLINE int SATURATE(int a, int b)
{
if (a>b)
a=b;
......@@ -507,7 +507,7 @@ static inline int SATURATE(int a, int b)
return a;
}
static inline int MULT16_16_Q11_32(int a, int b)
static OPUS_INLINE int MULT16_16_Q11_32(int a, int b)
{
opus_int64 res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
......@@ -529,7 +529,7 @@ static inline int MULT16_16_Q11_32(int a, int b)
celt_mips+=3;
return res;
}
static inline short MULT16_16_Q13(int a, int b)
static OPUS_INLINE short MULT16_16_Q13(int a, int b)
{
opus_int64 res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
......@@ -551,7 +551,7 @@ static inline short MULT16_16_Q13(int a, int b)
celt_mips+=3;
return res;
}
static inline short MULT16_16_Q14(int a, int b)
static OPUS_INLINE short MULT16_16_Q14(int a, int b)
{
opus_int64 res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
......@@ -575,7 +575,7 @@ static inline short MULT16_16_Q14(int a, int b)
}
#define MULT16_16_Q15(a, b) MULT16_16_Q15_(a, b, __FILE__, __LINE__)
static inline short MULT16_16_Q15_(int a, int b, char *file, int line)
static OPUS_INLINE short MULT16_16_Q15_(int a, int b, char *file, int line)
{
opus_int64 res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
......@@ -598,7 +598,7 @@ static inline short MULT16_16_Q15_(int a, int b, char *file, int line)
return res;
}
static inline short MULT16_16_P13(int a, int b)
static OPUS_INLINE short MULT16_16_P13(int a, int b)
{
opus_int64 res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
......@@ -628,7 +628,7 @@ static inline short MULT16_16_P13(int a, int b)
celt_mips+=4;
return res;
}
static inline short MULT16_16_P14(int a, int b)
static OPUS_INLINE short MULT16_16_P14(int a, int b)
{
opus_int64 res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
......@@ -658,7 +658,7 @@ static inline short MULT16_16_P14(int a, int b)
celt_mips+=4;
return res;
}
static inline short MULT16_16_P15(int a, int b)
static OPUS_INLINE short MULT16_16_P15(int a, int b)
{
opus_int64 res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
......@@ -691,7 +691,7 @@ static inline short MULT16_16_P15(int a, int b)
#define DIV32_16(a, b) DIV32_16_(a, b, __FILE__, __LINE__)
static inline int DIV32_16_(opus_int64 a, opus_int64 b, char *file, int line)
static OPUS_INLINE int DIV32_16_(opus_int64 a, opus_int64 b, char *file, int line)
{
opus_int64 res;
if (b==0)
......@@ -726,7 +726,7 @@ static inline int DIV32_16_(opus_int64 a, opus_int64 b, char *file, int line)
}
#define DIV32(a, b) DIV32_(a, b, __FILE__, __LINE__)
static inline int DIV32_(opus_int64 a, opus_int64 b, char *file, int line)
static OPUS_INLINE int DIV32_(opus_int64 a, opus_int64 b, char *file, int line)
{
opus_int64 res;
if (b==0)
......
......@@ -101,7 +101,7 @@
#include <math.h>
/* Win32 doesn't seem to have these functions.
** Therefore implement inline versions of these functions here.
** Therefore implement OPUS_INLINE versions of these functions here.
*/
__inline long int
......@@ -128,7 +128,7 @@
#endif
#ifndef DISABLE_FLOAT_API
static inline opus_int16 FLOAT2INT16(float x)
static OPUS_INLINE opus_int16 FLOAT2INT16(float x)
{
x = x*CELT_SIG_SCALE;
x = MAX32(x, -32768);
......
......@@ -139,7 +139,7 @@ opus_val32 celt_sqrt(opus_val32 x)
#define L3 8277
#define L4 -626
static inline opus_val16 _celt_cos_pi_2(opus_val16 x)
static OPUS_INLINE opus_val16 _celt_cos_pi_2(opus_val16 x)
{
opus_val16 x2;
......
......@@ -44,7 +44,7 @@
unsigned isqrt32(opus_uint32 _val);
#ifndef OVERRIDE_CELT_MAXABS16
static inline opus_val32 celt_maxabs16(const opus_val16 *x, int len)
static OPUS_INLINE opus_val32 celt_maxabs16(const opus_val16 *x, int len)
{
int i;
opus_val16 maxval = 0;
......@@ -60,7 +60,7 @@ static inline opus_val32 celt_maxabs16(const opus_val16 *x, int len)
#ifndef OVERRIDE_CELT_MAXABS32
#ifdef FIXED_POINT
static inline opus_val32 celt_maxabs32(const opus_val32 *x, int len)
static OPUS_INLINE opus_val32 celt_maxabs32(const opus_val32 *x, int len)
{
int i;
opus_val32 maxval = 0;
......@@ -95,7 +95,7 @@ static inline opus_val32 celt_maxabs32(const opus_val32 *x, int len)
denorm, +/- inf and NaN are *not* handled */
/** Base-2 log approximation (log2(x)). */
static inline float celt_log2(float x)
static OPUS_INLINE float celt_log2(float x)
{
int integer;
float frac;
......@@ -113,7 +113,7 @@ static inline float celt_log2(float x)
}
/** Base-2 exponential approximation (2^x). */
static inline float celt_exp2(float x)
static OPUS_INLINE float celt_exp2(float x)
{
int integer;
float frac;
......@@ -145,7 +145,7 @@ static inline float celt_exp2(float x)
#ifndef OVERRIDE_CELT_ILOG2
/** Integer log in base2. Undefined for zero and negative numbers */
static inline opus_int16 celt_ilog2(opus_int32 x)
static OPUS_INLINE opus_int16 celt_ilog2(opus_int32 x)
{
celt_assert2(x>0, "celt_ilog2() only defined for strictly positive numbers");
return EC_ILOG(x)-1;
......@@ -154,7 +154,7 @@ static inline opus_int16 celt_ilog2(opus_int32 x)
/** Integer log in base2. Defined for zero, but not for negative numbers */
static inline opus_int16 celt_zlog2(opus_val32 x)
static OPUS_INLINE opus_int16 celt_zlog2(opus_val32 x)
{
return x <= 0 ? 0 : celt_ilog2(x);
}
......@@ -166,7 +166,7 @@ opus_val32 celt_sqrt(opus_val32 x);
opus_val16 celt_cos_norm(opus_val32 x);
/** Base-2 logarithm approximation (log2(x)). (Q14 input, Q10 output) */
static inline opus_val16 celt_log2(opus_val32 x)
static OPUS_INLINE opus_val16 celt_log2(opus_val32 x)
{
int i;
opus_val16 n, frac;
......@@ -192,14 +192,14 @@ static inline opus_val16 celt_log2(opus_val32 x)
#define D2 14819
#define D3 10204
static inline opus_val32 celt_exp2_frac(opus_val16 x)
static OPUS_INLINE opus_val32 celt_exp2_frac(opus_val16 x)
{
opus_val16 frac;
frac = SHL16(x, 4);
return ADD16(D0, MULT16_16_Q15(frac, ADD16(D1, MULT16_16_Q15(frac, ADD16(D2 , MULT16_16_Q15(D3,frac))))));
}
/** Base-2 exponential approximation (2^x). (Q10 input, Q16 output) */
static inline opus_val32 celt_exp2(opus_val16 x)
static OPUS_INLINE opus_val32 celt_exp2(opus_val16 x)
{
int integer;
opus_val16 frac;
......@@ -225,7 +225,7 @@ opus_val32 frac_div32(opus_val32 a, opus_val32 b);
/* Atan approximation using a 4th order polynomial. Input is in Q15 format
and normalized by pi/4. Output is in Q15 format */
static inline opus_val16 celt_atan01(opus_val16 x)
static OPUS_INLINE opus_val16 celt_atan01(opus_val16 x)
{
return MULT16_16_P15(x, ADD32(M1, MULT16_16_P15(x, ADD32(M2, MULT16_16_P15(x, ADD32(M3, MULT16_16_P15(M4, x)))))));
}
......@@ -236,7 +236,7 @@ static inline opus_val16 celt_atan01(opus_val16 x)
#undef M4
/* atan2() approximation valid for positive input values */
static inline opus_val16 celt_atan2p(opus_val16 y, opus_val16 x)
static OPUS_INLINE opus_val16 celt_atan2p(opus_val16 y, opus_val16 x)
{
if (y < x)
{
......
......@@ -35,13 +35,16 @@
# include "custom_support.h"
#endif
#include "opus_types.h"