Commit 4dc0b397 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Replacing SPK_INLINE by static inline

The config.h will take care of compat issues with "inline"
parent 0b75940c
......@@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* Compute gain to make warped filter coefficients have a zero mean log frequency response on a */
/* non-warped frequency scale. (So that it can be implemented with a minimum-phase monic filter.) */
SKP_INLINE opus_int32 warped_gain( // gain in Q16
static inline opus_int32 warped_gain( // gain in Q16
const opus_int32 *coefs_Q24,
opus_int lambda_Q16,
opus_int order
......@@ -53,7 +53,7 @@ SKP_INLINE opus_int32 warped_gain( // gain in Q16
/* Convert warped filter coefficients to monic pseudo-warped coefficients and limit maximum */
/* amplitude of monic warped coefficients by using bandwidth expansion on the true coefficients */
SKP_INLINE void limit_warped_coefs(
static inline void limit_warped_coefs(
opus_int32 *coefs_syn_Q24,
opus_int32 *coefs_ana_Q24,
opus_int lambda_Q16,
......
......@@ -33,7 +33,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "silk_tuning_parameters.h"
/* silk_prefilter. Prefilter for finding Quantizer input signal */
SKP_INLINE void silk_prefilt_FIX(
static inline void silk_prefilt_FIX(
silk_prefilter_state_FIX *P, /* I/O state */
opus_int32 st_res_Q12[], /* I short term residual signal */
opus_int16 xw[], /* O prefiltered signal */
......@@ -152,7 +152,7 @@ void silk_prefilter_FIX(
}
/* silk_prefilter. Prefilter for finding Quantizer input signal */
SKP_INLINE void silk_prefilt_FIX(
static inline void silk_prefilt_FIX(
silk_prefilter_state_FIX *P, /* I/O state */
opus_int32 st_res_Q12[], /* I short term residual signal */
opus_int16 xw[], /* O prefiltered signal */
......
......@@ -42,7 +42,7 @@ typedef struct {
} inv_D_t;
/* Factorize square matrix A into LDL form */
SKP_INLINE void silk_LDL_factorize_FIX(
static inline void silk_LDL_factorize_FIX(
opus_int32 *A, /* I/O Pointer to Symetric Square Matrix */
opus_int M, /* I Size of Matrix */
opus_int32 *L_Q16, /* I/O Pointer to Square Upper triangular Matrix */
......@@ -50,7 +50,7 @@ SKP_INLINE void silk_LDL_factorize_FIX(
);
/* Solve Lx = b, when L is lower triangular and has ones on the diagonal */
SKP_INLINE void silk_LS_SolveFirst_FIX(
static inline void silk_LS_SolveFirst_FIX(
const opus_int32 *L_Q16, /* I Pointer to Lower Triangular Matrix */
opus_int M, /* I Dim of Matrix equation */
const opus_int32 *b, /* I b Vector */
......@@ -58,14 +58,14 @@ SKP_INLINE void silk_LS_SolveFirst_FIX(
);
/* Solve L^t*x = b, where L is lower triangular with ones on the diagonal */
SKP_INLINE void silk_LS_SolveLast_FIX(
static inline void silk_LS_SolveLast_FIX(
const opus_int32 *L_Q16, /* I Pointer to Lower Triangular Matrix */
const opus_int M, /* I Dim of Matrix equation */
const opus_int32 *b, /* I b Vector */
opus_int32 *x_Q16 /* O x Vector */
);
SKP_INLINE void silk_LS_divide_Q16_FIX(
static inline void silk_LS_divide_Q16_FIX(
opus_int32 T[], /* I/O Numenator vector */
inv_D_t *inv_D, /* I 1 / D vector */
opus_int M /* I dimension */
......@@ -109,7 +109,7 @@ void silk_solve_LDL_FIX(
silk_LS_SolveLast_FIX( L_Q16, M, Y, x_Q16 );
}
SKP_INLINE void silk_LDL_factorize_FIX(
static inline void silk_LDL_factorize_FIX(
opus_int32 *A, /* I Pointer to Symetric Square Matrix */
opus_int M, /* I Size of Matrix */
opus_int32 *L_Q16, /* I/O Pointer to Square Upper triangular Matrix */
......@@ -181,7 +181,7 @@ SKP_INLINE void silk_LDL_factorize_FIX(
SKP_assert( status == 0 );
}
SKP_INLINE void silk_LS_divide_Q16_FIX(
static inline void silk_LS_divide_Q16_FIX(
opus_int32 T[], /* I/O Numenator vector */
inv_D_t *inv_D, /* I 1 / D vector */
opus_int M /* I Order */
......@@ -201,7 +201,7 @@ SKP_INLINE void silk_LS_divide_Q16_FIX(
}
/* Solve Lx = b, when L is lower triangular and has ones on the diagonal */
SKP_INLINE void silk_LS_SolveFirst_FIX(
static inline void silk_LS_SolveFirst_FIX(
const opus_int32 *L_Q16, /* I Pointer to Lower Triangular Matrix */
opus_int M, /* I Dim of Matrix equation */
const opus_int32 *b, /* I b Vector */
......@@ -223,7 +223,7 @@ SKP_INLINE void silk_LS_SolveFirst_FIX(
}
/* Solve L^t*x = b, where L is lower triangular with ones on the diagonal */
SKP_INLINE void silk_LS_SolveLast_FIX(
static inline void silk_LS_SolveLast_FIX(
const opus_int32 *L_Q16, /* I Pointer to Lower Triangular Matrix */
const opus_int M, /* I Dim of Matrix equation */
const opus_int32 *b, /* I b Vector */
......
......@@ -161,13 +161,13 @@ double silk_energy_FLP(
: ((a) > (limit2) ? (limit2) : ((a) < (limit1) ? (limit1) : (a))))
/* sigmoid function */
SKP_INLINE SKP_float SKP_sigmoid(SKP_float x)
static inline SKP_float SKP_sigmoid(SKP_float x)
{
return (SKP_float)(1.0 / (1.0 + exp(-x)));
}
/* floating-point to integer conversion (rounding) */
SKP_INLINE opus_int32 SKP_float2int(double x)
static inline opus_int32 SKP_float2int(double x)
{
#ifdef _WIN32
double t = x + 6755399441055744.0;
......@@ -178,7 +178,7 @@ SKP_INLINE opus_int32 SKP_float2int(double x)
}
/* floating-point to integer conversion (rounding) */
SKP_INLINE void SKP_float2short_array(
static inline void SKP_float2short_array(
opus_int16 *out,
const SKP_float *in,
opus_int32 length
......@@ -197,7 +197,7 @@ SKP_INLINE void SKP_float2short_array(
}
/* integer to floating-point conversion */
SKP_INLINE void SKP_short2float_array(
static inline void SKP_short2float_array(
SKP_float *out,
const opus_int16 *in,
opus_int32 length
......@@ -210,7 +210,7 @@ SKP_INLINE void SKP_short2float_array(
}
/* using log2() helps the fixed-point conversion */
SKP_INLINE SKP_float silk_log2( double x ) { return ( SKP_float )( 3.32192809488736 * log10( x ) ); }
static inline SKP_float silk_log2( double x ) { return ( SKP_float )( 3.32192809488736 * log10( x ) ); }
#ifdef __cplusplus
}
......
......@@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* Compute gain to make warped filter coefficients have a zero mean log frequency response on a */
/* non-warped frequency scale. (So that it can be implemented with a minimum-phase monic filter.) */
SKP_INLINE SKP_float warped_gain(
static inline SKP_float warped_gain(
const SKP_float *coefs,
SKP_float lambda,
opus_int order
......@@ -52,7 +52,7 @@ SKP_INLINE SKP_float warped_gain(
/* Convert warped filter coefficients to monic pseudo-warped coefficients and limit maximum */
/* amplitude of monic warped coefficients by using bandwidth expansion on the true coefficients */
SKP_INLINE void warped_true2monic_coefs(
static inline void warped_true2monic_coefs(
SKP_float *coefs_syn,
SKP_float *coefs_ana,
SKP_float lambda,
......
......@@ -35,7 +35,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* silk_prefilter. Prefilter for finding Quantizer input signal
*/
SKP_INLINE void silk_prefilt_FLP(
static inline void silk_prefilt_FLP(
silk_prefilter_state_FLP *P,/* I/O state */
SKP_float st_res[], /* I */
SKP_float xw[], /* O */
......@@ -153,7 +153,7 @@ void silk_prefilter_FLP(
/*
* Prefilter for finding Quantizer input signal
*/
SKP_INLINE void silk_prefilt_FLP(
static inline void silk_prefilt_FLP(
silk_prefilter_state_FLP *P,/* I/O state */
SKP_float st_res[], /* I */
SKP_float xw[], /* O */
......
......@@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* Helper function for A2NLSF(..) */
/* Transforms polynomials from cos(n*f) to cos(f)^n */
SKP_INLINE void silk_A2NLSF_trans_poly(
static inline void silk_A2NLSF_trans_poly(
opus_int32 *p, /* I/O Polynomial */
const opus_int dd /* I Polynomial order (= filter order / 2 ) */
)
......@@ -64,7 +64,7 @@ SKP_INLINE void silk_A2NLSF_trans_poly(
}
/* Helper function for A2NLSF(..) */
/* Polynomial evaluation */
SKP_INLINE opus_int32 silk_A2NLSF_eval_poly( /* return the polynomial evaluation, in QPoly */
static inline opus_int32 silk_A2NLSF_eval_poly( /* return the polynomial evaluation, in QPoly */
opus_int32 *p, /* I Polynomial, QPoly */
const opus_int32 x, /* I Evaluation point, Q12 */
const opus_int dd /* I Order */
......@@ -81,7 +81,7 @@ SKP_INLINE opus_int32 silk_A2NLSF_eval_poly( /* return the polynomial evaluat
return y32;
}
SKP_INLINE void silk_A2NLSF_init(
static inline void silk_A2NLSF_init(
const opus_int32 *a_Q16,
opus_int32 *P,
opus_int32 *Q,
......
......@@ -32,7 +32,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "silk_main.h"
/* Generates excitation for CNG LPC synthesis */
SKP_INLINE void silk_CNG_exc(
static inline void silk_CNG_exc(
opus_int32 residual_Q10[], /* O CNG residual signal Q10 */
opus_int32 exc_buf_Q10[], /* I Random samples buffer Q10 */
opus_int32 Gain_Q16, /* I Gain to apply */
......
......@@ -38,7 +38,7 @@ extern "C"
#endif
/* count leading zeros of opus_int64 */
SKP_INLINE opus_int32 silk_CLZ64(opus_int64 in)
static inline opus_int32 silk_CLZ64(opus_int64 in)
{
opus_int32 in_upper;
......@@ -53,7 +53,7 @@ SKP_INLINE opus_int32 silk_CLZ64(opus_int64 in)
}
/* get number of leading zeros and fractional part (the bits right after the leading one */
SKP_INLINE void silk_CLZ_FRAC(opus_int32 in, /* I: input */
static inline void silk_CLZ_FRAC(opus_int32 in, /* I: input */
opus_int32 *lz, /* O: number of leading zeros */
opus_int32 *frac_Q7) /* O: the 7 bits right after the leading one */
{
......@@ -66,7 +66,7 @@ SKP_INLINE void silk_CLZ_FRAC(opus_int32 in, /* I: input */
/* Approximation of square root */
/* Accuracy: < +/- 10% for output values > 15 */
/* < +/- 2.5% for output values > 120 */
SKP_INLINE opus_int32 silk_SQRT_APPROX(opus_int32 x)
static inline opus_int32 silk_SQRT_APPROX(opus_int32 x)
{
opus_int32 y, lz, frac_Q7;
......@@ -92,7 +92,7 @@ SKP_INLINE opus_int32 silk_SQRT_APPROX(opus_int32 x)
}
/* Divide two int32 values and return result as int32 in a given Q-domain */
SKP_INLINE opus_int32 silk_DIV32_varQ( /* O returns a good approximation of "(a32 << Qres) / b32" */
static inline opus_int32 silk_DIV32_varQ( /* O returns a good approximation of "(a32 << Qres) / b32" */
const opus_int32 a32, /* I numerator (Q0) */
const opus_int32 b32, /* I denominator (Q0) */
const opus_int Qres /* I Q-domain of result (>= 0) */
......@@ -137,7 +137,7 @@ SKP_INLINE opus_int32 silk_DIV32_varQ( /* O returns a good approximation o
}
/* Invert int32 value and return result as int32 in a given Q-domain */
SKP_INLINE opus_int32 silk_INVERSE32_varQ( /* O returns a good approximation of "(1 << Qres) / b32" */
static inline opus_int32 silk_INVERSE32_varQ( /* O returns a good approximation of "(1 << Qres) / b32" */
const opus_int32 b32, /* I denominator (Q0) */
const opus_int Qres /* I Q-domain of result (> 0) */
)
......
......@@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "silk_main.h"
/* Helper function, interpolates the filter taps */
SKP_INLINE void silk_LP_interpolate_filter_taps(
static inline void silk_LP_interpolate_filter_taps(
opus_int32 B_Q28[ TRANSITION_NB ],
opus_int32 A_Q28[ TRANSITION_NA ],
const opus_int ind,
......
This diff is collapsed.
......@@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#if 0 && defined (_WIN32) && defined (_DEBUG) && !defined (SKP_MACRO_COUNT)
#undef SKP_ADD16
SKP_INLINE opus_int16 SKP_ADD16(opus_int16 a, opus_int16 b){
static inline opus_int16 SKP_ADD16(opus_int16 a, opus_int16 b){
opus_int16 ret;
ret = a + b;
......@@ -43,7 +43,7 @@ SKP_INLINE opus_int16 SKP_ADD16(opus_int16 a, opus_int16 b){
}
#undef SKP_ADD32
SKP_INLINE opus_int32 SKP_ADD32(opus_int32 a, opus_int32 b){
static inline opus_int32 SKP_ADD32(opus_int32 a, opus_int32 b){
opus_int32 ret;
ret = a + b;
......@@ -52,7 +52,7 @@ SKP_INLINE opus_int32 SKP_ADD32(opus_int32 a, opus_int32 b){
}
#undef SKP_ADD64
SKP_INLINE opus_int64 SKP_ADD64(opus_int64 a, opus_int64 b){
static inline opus_int64 SKP_ADD64(opus_int64 a, opus_int64 b){
opus_int64 ret;
ret = a + b;
......@@ -61,7 +61,7 @@ SKP_INLINE opus_int64 SKP_ADD64(opus_int64 a, opus_int64 b){
}
#undef SKP_SUB16
SKP_INLINE opus_int16 SKP_SUB16(opus_int16 a, opus_int16 b){
static inline opus_int16 SKP_SUB16(opus_int16 a, opus_int16 b){
opus_int16 ret;
ret = a - b;
......@@ -70,7 +70,7 @@ SKP_INLINE opus_int16 SKP_SUB16(opus_int16 a, opus_int16 b){
}
#undef SKP_SUB32
SKP_INLINE opus_int32 SKP_SUB32(opus_int32 a, opus_int32 b){
static inline opus_int32 SKP_SUB32(opus_int32 a, opus_int32 b){
opus_int32 ret;
ret = a - b;
......@@ -79,7 +79,7 @@ SKP_INLINE opus_int32 SKP_SUB32(opus_int32 a, opus_int32 b){
}
#undef SKP_SUB64
SKP_INLINE opus_int64 SKP_SUB64(opus_int64 a, opus_int64 b){
static inline opus_int64 SKP_SUB64(opus_int64 a, opus_int64 b){
opus_int64 ret;
ret = a - b;
......@@ -88,7 +88,7 @@ SKP_INLINE opus_int64 SKP_SUB64(opus_int64 a, opus_int64 b){
}
#undef SKP_ADD_SAT16
SKP_INLINE opus_int16 SKP_ADD_SAT16( opus_int16 a16, opus_int16 b16 ) {
static inline opus_int16 SKP_ADD_SAT16( opus_int16 a16, opus_int16 b16 ) {
opus_int16 res;
res = (opus_int16)SKP_SAT16( SKP_ADD32( (opus_int32)(a16), (b16) ) );
SKP_assert( res == SKP_SAT16( ( opus_int32 )a16 + ( opus_int32 )b16 ) );
......@@ -96,7 +96,7 @@ SKP_INLINE opus_int16 SKP_ADD_SAT16( opus_int16 a16, opus_int16 b16 ) {
}
#undef SKP_ADD_SAT32
SKP_INLINE opus_int32 SKP_ADD_SAT32(opus_int32 a32, opus_int32 b32){
static inline opus_int32 SKP_ADD_SAT32(opus_int32 a32, opus_int32 b32){
opus_int32 res;
res = ((((a32) + (b32)) & 0x80000000) == 0 ? \
((((a32) & (b32)) & 0x80000000) != 0 ? SKP_int32_MIN : (a32)+(b32)) : \
......@@ -106,7 +106,7 @@ SKP_INLINE opus_int32 SKP_ADD_SAT32(opus_int32 a32, opus_int32 b32){
}
#undef SKP_ADD_SAT64
SKP_INLINE opus_int64 SKP_ADD_SAT64( opus_int64 a64, opus_int64 b64 ) {
static inline opus_int64 SKP_ADD_SAT64( opus_int64 a64, opus_int64 b64 ) {
opus_int64 res;
res = ((((a64) + (b64)) & 0x8000000000000000LL) == 0 ? \
((((a64) & (b64)) & 0x8000000000000000LL) != 0 ? SKP_int64_MIN : (a64)+(b64)) : \
......@@ -123,7 +123,7 @@ SKP_INLINE opus_int64 SKP_ADD_SAT64( opus_int64 a64, opus_int64 b64 ) {
}
#undef SKP_SUB_SAT16
SKP_INLINE opus_int16 SKP_SUB_SAT16( opus_int16 a16, opus_int16 b16 ) {
static inline opus_int16 SKP_SUB_SAT16( opus_int16 a16, opus_int16 b16 ) {
opus_int16 res;
res = (opus_int16)SKP_SAT16( SKP_SUB32( (opus_int32)(a16), (b16) ) );
SKP_assert( res == SKP_SAT16( ( opus_int32 )a16 - ( opus_int32 )b16 ) );
......@@ -131,7 +131,7 @@ SKP_INLINE opus_int16 SKP_SUB_SAT16( opus_int16 a16, opus_int16 b16 ) {
}
#undef SKP_SUB_SAT32
SKP_INLINE opus_int32 SKP_SUB_SAT32( opus_int32 a32, opus_int32 b32 ) {
static inline opus_int32 SKP_SUB_SAT32( opus_int32 a32, opus_int32 b32 ) {
opus_int32 res;
res = ((((a32)-(b32)) & 0x80000000) == 0 ? \
(( (a32) & ((b32)^0x80000000) & 0x80000000) ? SKP_int32_MIN : (a32)-(b32)) : \
......@@ -141,7 +141,7 @@ SKP_INLINE opus_int32 SKP_SUB_SAT32( opus_int32 a32, opus_int32 b32 ) {
}
#undef SKP_SUB_SAT64
SKP_INLINE opus_int64 SKP_SUB_SAT64( opus_int64 a64, opus_int64 b64 ) {
static inline opus_int64 SKP_SUB_SAT64( opus_int64 a64, opus_int64 b64 ) {
opus_int64 res;
res = ((((a64)-(b64)) & 0x8000000000000000LL) == 0 ? \
(( (a64) & ((b64)^0x8000000000000000LL) & 0x8000000000000000LL) ? SKP_int64_MIN : (a64)-(b64)) : \
......@@ -159,7 +159,7 @@ SKP_INLINE opus_int64 SKP_SUB_SAT64( opus_int64 a64, opus_int64 b64 ) {
}
#undef SKP_MUL
SKP_INLINE opus_int32 SKP_MUL(opus_int32 a32, opus_int32 b32){
static inline opus_int32 SKP_MUL(opus_int32 a32, opus_int32 b32){
opus_int32 ret;
opus_int64 ret64; // Will easily show how many bits that are needed
ret = a32 * b32;
......@@ -169,14 +169,14 @@ SKP_INLINE opus_int32 SKP_MUL(opus_int32 a32, opus_int32 b32){
}
#undef SKP_MUL_uint
SKP_INLINE opus_uint32 SKP_MUL_uint(opus_uint32 a32, opus_uint32 b32){
static inline opus_uint32 SKP_MUL_uint(opus_uint32 a32, opus_uint32 b32){
opus_uint32 ret;
ret = a32 * b32;
SKP_assert((opus_uint64)ret == (opus_uint64)a32 * (opus_uint64)b32); //Check output overflow
return ret;
}
#undef SKP_MLA
SKP_INLINE opus_int32 SKP_MLA(opus_int32 a32, opus_int32 b32, opus_int32 c32){
static inline opus_int32 SKP_MLA(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret;
ret = a32 + b32 * c32;
SKP_assert((opus_int64)ret == (opus_int64)a32 + (opus_int64)b32 * (opus_int64)c32); //Check output overflow
......@@ -184,7 +184,7 @@ SKP_INLINE opus_int32 SKP_MLA(opus_int32 a32, opus_int32 b32, opus_int32 c32){
}
#undef SKP_MLA_uint
SKP_INLINE opus_int32 SKP_MLA_uint(opus_uint32 a32, opus_uint32 b32, opus_uint32 c32){
static inline opus_int32 SKP_MLA_uint(opus_uint32 a32, opus_uint32 b32, opus_uint32 c32){
opus_uint32 ret;
ret = a32 + b32 * c32;
SKP_assert((opus_int64)ret == (opus_int64)a32 + (opus_int64)b32 * (opus_int64)c32); //Check output overflow
......@@ -192,14 +192,14 @@ SKP_INLINE opus_int32 SKP_MLA_uint(opus_uint32 a32, opus_uint32 b32, opus_uint32
}
#undef SKP_SMULWB
SKP_INLINE opus_int32 SKP_SMULWB(opus_int32 a32, opus_int32 b32){
static inline opus_int32 SKP_SMULWB(opus_int32 a32, opus_int32 b32){
opus_int32 ret;
ret = (a32 >> 16) * (opus_int32)((opus_int16)b32) + (((a32 & 0x0000FFFF) * (opus_int32)((opus_int16)b32)) >> 16);
SKP_assert((opus_int64)ret == ((opus_int64)a32 * (opus_int16)b32) >> 16);
return ret;
}
#undef SKP_SMLAWB
SKP_INLINE opus_int32 SKP_SMLAWB(opus_int32 a32, opus_int32 b32, opus_int32 c32){
static inline opus_int32 SKP_SMLAWB(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret;
ret = SKP_ADD32( a32, SKP_SMULWB( b32, c32 ) );
SKP_assert(SKP_ADD32( a32, SKP_SMULWB( b32, c32 ) ) == SKP_ADD_SAT32( a32, SKP_SMULWB( b32, c32 ) ));
......@@ -207,14 +207,14 @@ SKP_INLINE opus_int32 SKP_SMLAWB(opus_int32 a32, opus_int32 b32, opus_int32 c32)
}
#undef SKP_SMULWT
SKP_INLINE opus_int32 SKP_SMULWT(opus_int32 a32, opus_int32 b32){
static inline opus_int32 SKP_SMULWT(opus_int32 a32, opus_int32 b32){
opus_int32 ret;
ret = (a32 >> 16) * (b32 >> 16) + (((a32 & 0x0000FFFF) * (b32 >> 16)) >> 16);
SKP_assert((opus_int64)ret == ((opus_int64)a32 * (b32 >> 16)) >> 16);
return ret;
}
#undef SKP_SMLAWT
SKP_INLINE opus_int32 SKP_SMLAWT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
static inline opus_int32 SKP_SMLAWT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret;
ret = a32 + ((b32 >> 16) * (c32 >> 16)) + (((b32 & 0x0000FFFF) * ((c32 >> 16)) >> 16));
SKP_assert((opus_int64)ret == (opus_int64)a32 + (((opus_int64)b32 * (c32 >> 16)) >> 16));
......@@ -222,7 +222,7 @@ SKP_INLINE opus_int32 SKP_SMLAWT(opus_int32 a32, opus_int32 b32, opus_int32 c32)
}
#undef SKP_SMULL
SKP_INLINE opus_int64 SKP_SMULL(opus_int64 a64, opus_int64 b64){
static inline opus_int64 SKP_SMULL(opus_int64 a64, opus_int64 b64){
opus_int64 ret64;
ret64 = a64 * b64;
if( b64 != 0 ) {
......@@ -235,7 +235,7 @@ SKP_INLINE opus_int64 SKP_SMULL(opus_int64 a64, opus_int64 b64){
// no checking needed for SKP_SMULBB
#undef SKP_SMLABB
SKP_INLINE opus_int32 SKP_SMLABB(opus_int32 a32, opus_int32 b32, opus_int32 c32){
static inline opus_int32 SKP_SMLABB(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret;
ret = a32 + (opus_int32)((opus_int16)b32) * (opus_int32)((opus_int16)c32);
SKP_assert((opus_int64)ret == (opus_int64)a32 + (opus_int64)b32 * (opus_int16)c32);
......@@ -244,7 +244,7 @@ SKP_INLINE opus_int32 SKP_SMLABB(opus_int32 a32, opus_int32 b32, opus_int32 c32)
// no checking needed for SKP_SMULBT
#undef SKP_SMLABT
SKP_INLINE opus_int32 SKP_SMLABT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
static inline opus_int32 SKP_SMLABT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret;
ret = a32 + ((opus_int32)((opus_int16)b32)) * (c32 >> 16);
SKP_assert((opus_int64)ret == (opus_int64)a32 + (opus_int64)b32 * (c32 >> 16));
......@@ -253,7 +253,7 @@ SKP_INLINE opus_int32 SKP_SMLABT(opus_int32 a32, opus_int32 b32, opus_int32 c32)
// no checking needed for SKP_SMULTT
#undef SKP_SMLATT
SKP_INLINE opus_int32 SKP_SMLATT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
static inline opus_int32 SKP_SMLATT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret;
ret = a32 + (b32 >> 16) * (c32 >> 16);
SKP_assert((opus_int64)ret == (opus_int64)a32 + (b32 >> 16) * (c32 >> 16));
......@@ -261,7 +261,7 @@ SKP_INLINE opus_int32 SKP_SMLATT(opus_int32 a32, opus_int32 b32, opus_int32 c32)
}
#undef SKP_SMULWW
SKP_INLINE opus_int32 SKP_SMULWW(opus_int32 a32, opus_int32 b32){
static inline opus_int32 SKP_SMULWW(opus_int32 a32, opus_int32 b32){
opus_int32 ret, tmp1, tmp2;
opus_int64 ret64;
......@@ -282,7 +282,7 @@ SKP_INLINE opus_int32 SKP_SMULWW(opus_int32 a32, opus_int32 b32){
}
#undef SKP_SMLAWW
SKP_INLINE opus_int32 SKP_SMLAWW(opus_int32 a32, opus_int32 b32, opus_int32 c32){
static inline opus_int32 SKP_SMLAWW(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret, tmp;
tmp = SKP_SMULWW( b32, c32 );
......@@ -312,13 +312,13 @@ SKP_INLINE opus_int32 SKP_SMLAWW(opus_int32 a32, opus_int32 b32, opus_int32 c32)
// no checking needed for SigProcFIX_CLZ32
#undef SKP_DIV32
SKP_INLINE opus_int32 SKP_DIV32(opus_int32 a32, opus_int32 b32){
static inline opus_int32 SKP_DIV32(opus_int32 a32, opus_int32 b32){
SKP_assert( b32 != 0 );
return a32 / b32;
}
#undef SKP_DIV32_16
SKP_INLINE opus_int32 SKP_DIV32_16(opus_int32 a32, opus_int32 b32){
static inline opus_int32 SKP_DIV32_16(opus_int32 a32, opus_int32 b32){
SKP_assert( b32 != 0 );
SKP_assert( b32 <= SKP_int16_MAX );
SKP_assert( b32 >= SKP_int16_MIN );
......@@ -334,7 +334,7 @@ SKP_INLINE opus_int32 SKP_DIV32_16(opus_int32 a32, opus_int32 b32){
// no checking needed for SKP_ADD_POS_SAT32
// no checking needed for SKP_ADD_POS_SAT64
#undef SKP_LSHIFT8
SKP_INLINE opus_int8 SKP_LSHIFT8(opus_int8 a, opus_int32 shift){
static inline opus_int8 SKP_LSHIFT8(opus_int8 a, opus_int32 shift){
opus_int8 ret;
ret = a << shift;
SKP_assert(shift >= 0);
......@@ -343,7 +343,7 @@ SKP_INLINE opus_int8 SKP_LSHIFT8(opus_int8 a, opus_int32 shift){
return ret;
}
#undef SKP_LSHIFT16
SKP_INLINE opus_int16 SKP_LSHIFT16(opus_int16 a, opus_int32 shift){
static inline opus_int16 SKP_LSHIFT16(opus_int16 a, opus_int32 shift){
opus_int16 ret;
ret = a << shift;
SKP_assert(shift >= 0);
......@@ -352,7 +352,7 @@ SKP_INLINE opus_int16 SKP_LSHIFT16(opus_int16 a, opus_int32 shift){
return ret;
}
#undef SKP_LSHIFT32
SKP_INLINE opus_int32 SKP_LSHIFT32(opus_int32 a, opus_int32 shift){
static inline opus_int32 SKP_LSHIFT32(opus_int32 a, opus_int32 shift){
opus_int32 ret;
ret = a << shift;
SKP_assert(shift >= 0);
......@@ -361,20 +361,20 @@ SKP_INLINE opus_int32 SKP_LSHIFT32(opus_int32 a, opus_int32 shift){
return ret;
}
#undef SKP_LSHIFT64
SKP_INLINE opus_int64 SKP_LSHIFT64(opus_int64 a, opus_int shift){
static inline opus_int64 SKP_LSHIFT64(opus_int64 a, opus_int shift){
SKP_assert(shift >= 0);
SKP_assert(shift < 64);
return a << shift;
}
#undef SKP_LSHIFT_ovflw
SKP_INLINE opus_int32 SKP_LSHIFT_ovflw(opus_int32 a, opus_int32 shift){
static inline opus_int32 SKP_LSHIFT_ovflw(opus_int32 a, opus_int32 shift){
SKP_assert(shift >= 0); /* no check for overflow */
return a << shift;
}
#undef SKP_LSHIFT_uint
SKP_INLINE opus_uint32 SKP_LSHIFT_uint(opus_uint32 a, opus_int32 shift){
static inline opus_uint32 SKP_LSHIFT_uint(opus_uint32 a, opus_int32 shift){
opus_uint32 ret;
ret = a << shift;
SKP_assert(shift >= 0);
......@@ -383,39 +383,39 @@ SKP_INLINE opus_uint32 SKP_LSHIFT_uint(opus_uint32 a, opus_int32 shift){
}
#undef SKP_RSHIFT8
SKP_INLINE opus_int8 SKP_RSHIFT8(opus_int8 a, opus_int32 shift){
static inline opus_int8 SKP_RSHIFT8(opus_int8 a, opus_int32 shift){
SKP_assert(shift >= 0);
SKP_assert(shift < 8);
return a >> shift;
}
#undef SKP_RSHIFT16
SKP_INLINE opus_int16 SKP_RSHIFT16(opus_int16 a, opus_int32 shift){
static inline opus_int16 SKP_RSHIFT16(opus_int16 a, opus_int32 shift){
SKP_assert(shift >= 0);
SKP_assert(shift < 16);
return a >> shift;
}
#undef SKP_RSHIFT32
SKP_INLINE opus_int32 SKP_RSHIFT32(opus_int32 a, opus_int32 shift){
static inline opus_int32 SKP_RSHIFT32(opus_int32 a, opus_int32 shift){
SKP_assert(shift >= 0);
SKP_assert(shift < 32);
return a >> shift;
}
#undef SKP_RSHIFT64
SKP_INLINE opus_int64 SKP_RSHIFT64(opus_int64 a, opus_int64 shift){
static inline opus_int64 SKP_RSHIFT64(opus_int64 a, opus_int64 shift){
SKP_assert(shift >= 0);
SKP_assert(shift <= 63);
return a >> shift;
}
#undef SKP_RSHIFT_uint
SKP_INLINE opus_uint32 SKP_RSHIFT_uint(opus_uint32 a, opus_int32 shift){
static inline opus_uint32 SKP_RSHIFT_uint(opus_uint32 a, opus_int32 shift){
SKP_assert(shift >= 0);
SKP_assert(shift <= 32);
return a >> shift;
}
#undef SKP_ADD_LSHIFT
SKP_INLINE opus_int32 SKP_ADD_LSHIFT(opus_int32 a, opus_int32 b, opus_int32 shift){
static inline opus_int32 SKP_ADD_LSHIFT(opus_int32 a, opus_int32 b, opus_int32 shift){
opus_int32 ret;
SKP_assert(shift >= 0);
SKP_assert(shift <= 31);
......@@ -424,7 +424,7 @@ SKP_INLINE opus_int32 SKP_ADD_LSHIFT(opus_int32 a, opus_int32 b, opus_int32 shif
return ret; // shift >= 0
}
#undef SKP_ADD_LSHIFT32
SKP_INLINE opus_int32 SKP_ADD_LSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
static inline opus_int32 SKP_ADD_LSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
opus_int32 ret;
SKP_assert(shift >= 0);
SKP_assert(shift <= 31);
......@@ -433,7 +433,7 @@ SKP_INLINE opus_int32 SKP_ADD_LSHIFT32(opus_int32 a, opus_int32 b, opus_int32 sh
return ret; // shift >= 0
}
#undef SKP_ADD_LSHIFT_uint
SKP_INLINE opus_uint32 SKP_ADD_LSHIFT_uint(opus_uint32 a, opus_uint32 b, opus_int32 shift){
static inline opus_uint32 SKP_ADD_LSHIFT_uint(opus_uint32 a, opus_uint32 b, opus_int32 shift){
opus_uint32 ret;
SKP_assert(shift >= 0);
SKP_assert(shift <= 32);
......@@ -442,7 +442,7 @@ SKP_INLINE opus_uint32 SKP_ADD_LSHIFT_uint(opus_uint32 a, opus_uint32 b, opus_in
return ret; // shift >= 0
}
#undef SKP_ADD_RSHIFT
SKP_INLINE opus_int32 SKP_ADD_RSHIFT(opus_int32 a, opus_int32 b, opus_int32 shift){
static inline opus_int32 SKP_ADD_RSHIFT(opus_int32 a, opus_int32 b, opus_int32 shift){
opus_int32 ret;
SKP_assert(shift >= 0);
SKP_assert(shift <= 31);
......@@ -451,7 +451,7 @@ SKP_INLINE opus_int32 SKP_ADD_RSHIFT(opus_int32 a, opus_int32 b, opus_int32 shif
return ret; // shift > 0
}
#undef SKP_ADD_RSHIFT32
SKP_INLINE opus_int32 SKP_ADD_RSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
static inline opus_int32 SKP_ADD_RSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
opus_int32 ret;
SKP_assert(shift >= 0);
SKP_assert(shift <= 31);
......@@ -460,7 +460,7 @@ SKP_INLINE opus_int32 SKP_ADD_RSHIFT32(opus_int32 a, opus_int32 b, opus_int32 sh
return ret; // shift > 0