summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libopus/silk
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs/libopus/silk')
-rw-r--r--lib/rbcodec/codecs/libopus/silk/API.h3
-rw-r--r--lib/rbcodec/codecs/libopus/silk/CNG.c4
-rw-r--r--lib/rbcodec/codecs/libopus/silk/Inlines.h14
-rw-r--r--lib/rbcodec/codecs/libopus/silk/LPC_analysis_filter.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/LPC_inv_pred_gain.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/MacroCount.h162
-rw-r--r--lib/rbcodec/codecs/libopus/silk/MacroDebug.h112
-rw-r--r--lib/rbcodec/codecs/libopus/silk/NLSF2A.c4
-rw-r--r--lib/rbcodec/codecs/libopus/silk/NLSF_VQ_weights_laroia.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/NLSF_decode.c4
-rw-r--r--lib/rbcodec/codecs/libopus/silk/NLSF_stabilize.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/NLSF_unpack.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/PLC.c10
-rw-r--r--lib/rbcodec/codecs/libopus/silk/PLC.h2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/SigProc_FIX.h35
-rw-r--r--lib/rbcodec/codecs/libopus/silk/arm/SigProc_FIX_armv4.h2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/arm/SigProc_FIX_armv5e.h4
-rw-r--r--lib/rbcodec/codecs/libopus/silk/arm/macros_armv4.h8
-rw-r--r--lib/rbcodec/codecs/libopus/silk/arm/macros_armv5e.h24
-rw-r--r--lib/rbcodec/codecs/libopus/silk/bwexpander.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/bwexpander_32.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/code_signs.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/control.h5
-rw-r--r--lib/rbcodec/codecs/libopus/silk/dec_API.c4
-rw-r--r--lib/rbcodec/codecs/libopus/silk/decode_core.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/decode_frame.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/decode_indices.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/decode_parameters.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/decode_pitch.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/decode_pulses.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/decoder_set_fs.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/define.h2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/errors.h2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/gain_quant.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/init_decoder.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/log2lin.c6
-rw-r--r--lib/rbcodec/codecs/libopus/silk/macros.h17
-rw-r--r--lib/rbcodec/codecs/libopus/silk/main.h6
-rw-r--r--lib/rbcodec/codecs/libopus/silk/pitch_est_defines.h2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/pitch_est_tables.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/resampler.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/resampler_private.h2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/resampler_private_AR2.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/resampler_private_IIR_FIR.c4
-rw-r--r--lib/rbcodec/codecs/libopus/silk/resampler_private_down_FIR.c4
-rw-r--r--lib/rbcodec/codecs/libopus/silk/resampler_private_up2_HQ.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/resampler_rom.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/resampler_rom.h2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/resampler_structs.h2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/shell_coder.c8
-rw-r--r--lib/rbcodec/codecs/libopus/silk/sort.c4
-rw-r--r--lib/rbcodec/codecs/libopus/silk/stereo_MS_to_LR.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/stereo_decode_pred.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/structs.h5
-rw-r--r--lib/rbcodec/codecs/libopus/silk/sum_sqr_shift.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/table_LSF_cos.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/tables.h4
-rw-r--r--lib/rbcodec/codecs/libopus/silk/tables_LTP.c32
-rw-r--r--lib/rbcodec/codecs/libopus/silk/tables_NLSF_CB_NB_MB.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/tables_NLSF_CB_WB.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/tables_gain.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/tables_other.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/tables_pitch_lag.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/tables_pulses_per_block.c2
-rw-r--r--lib/rbcodec/codecs/libopus/silk/typedef.h5
65 files changed, 310 insertions, 258 deletions
diff --git a/lib/rbcodec/codecs/libopus/silk/API.h b/lib/rbcodec/codecs/libopus/silk/API.h
index c477cb4729..f0601bcf6b 100644
--- a/lib/rbcodec/codecs/libopus/silk/API.h
+++ b/lib/rbcodec/codecs/libopus/silk/API.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -64,6 +64,7 @@ opus_int silk_Get_Encoder_Size( /* O Returns error co
64/*************************/ 64/*************************/
65opus_int silk_InitEncoder( /* O Returns error code */ 65opus_int silk_InitEncoder( /* O Returns error code */
66 void *encState, /* I/O State */ 66 void *encState, /* I/O State */
67 int arch, /* I Run-time architecture */
67 silk_EncControlStruct *encStatus /* O Encoder Status */ 68 silk_EncControlStruct *encStatus /* O Encoder Status */
68); 69);
69 70
diff --git a/lib/rbcodec/codecs/libopus/silk/CNG.c b/lib/rbcodec/codecs/libopus/silk/CNG.c
index 19c2e2230c..8481d95dbe 100644
--- a/lib/rbcodec/codecs/libopus/silk/CNG.c
+++ b/lib/rbcodec/codecs/libopus/silk/CNG.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
33#include "stack_alloc.h" 33#include "stack_alloc.h"
34 34
35/* Generates excitation for CNG LPC synthesis */ 35/* Generates excitation for CNG LPC synthesis */
36static inline void silk_CNG_exc( 36static OPUS_INLINE void silk_CNG_exc(
37 opus_int32 residual_Q10[], /* O CNG residual signal Q10 */ 37 opus_int32 residual_Q10[], /* O CNG residual signal Q10 */
38 opus_int32 exc_buf_Q14[], /* I Random samples buffer Q10 */ 38 opus_int32 exc_buf_Q14[], /* I Random samples buffer Q10 */
39 opus_int32 Gain_Q16, /* I Gain to apply */ 39 opus_int32 Gain_Q16, /* I Gain to apply */
diff --git a/lib/rbcodec/codecs/libopus/silk/Inlines.h b/lib/rbcodec/codecs/libopus/silk/Inlines.h
index bec35eb7dc..ec986cdfdd 100644
--- a/lib/rbcodec/codecs/libopus/silk/Inlines.h
+++ b/lib/rbcodec/codecs/libopus/silk/Inlines.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -26,7 +26,7 @@ POSSIBILITY OF SUCH DAMAGE.
26***********************************************************************/ 26***********************************************************************/
27 27
28/*! \file silk_Inlines.h 28/*! \file silk_Inlines.h
29 * \brief silk_Inlines.h defines inline signal processing functions. 29 * \brief silk_Inlines.h defines OPUS_INLINE signal processing functions.
30 */ 30 */
31 31
32#ifndef SILK_FIX_INLINES_H 32#ifndef SILK_FIX_INLINES_H
@@ -38,7 +38,7 @@ extern "C"
38#endif 38#endif
39 39
40/* count leading zeros of opus_int64 */ 40/* count leading zeros of opus_int64 */
41static inline opus_int32 silk_CLZ64( opus_int64 in ) 41static OPUS_INLINE opus_int32 silk_CLZ64( opus_int64 in )
42{ 42{
43 opus_int32 in_upper; 43 opus_int32 in_upper;
44 44
@@ -53,7 +53,7 @@ static inline opus_int32 silk_CLZ64( opus_int64 in )
53} 53}
54 54
55/* get number of leading zeros and fractional part (the bits right after the leading one */ 55/* get number of leading zeros and fractional part (the bits right after the leading one */
56static inline void silk_CLZ_FRAC( 56static OPUS_INLINE void silk_CLZ_FRAC(
57 opus_int32 in, /* I input */ 57 opus_int32 in, /* I input */
58 opus_int32 *lz, /* O number of leading zeros */ 58 opus_int32 *lz, /* O number of leading zeros */
59 opus_int32 *frac_Q7 /* O the 7 bits right after the leading one */ 59 opus_int32 *frac_Q7 /* O the 7 bits right after the leading one */
@@ -68,7 +68,7 @@ static inline void silk_CLZ_FRAC(
68/* Approximation of square root */ 68/* Approximation of square root */
69/* Accuracy: < +/- 10% for output values > 15 */ 69/* Accuracy: < +/- 10% for output values > 15 */
70/* < +/- 2.5% for output values > 120 */ 70/* < +/- 2.5% for output values > 120 */
71static inline opus_int32 silk_SQRT_APPROX( opus_int32 x ) 71static OPUS_INLINE opus_int32 silk_SQRT_APPROX( opus_int32 x )
72{ 72{
73 opus_int32 y, lz, frac_Q7; 73 opus_int32 y, lz, frac_Q7;
74 74
@@ -94,7 +94,7 @@ static inline opus_int32 silk_SQRT_APPROX( opus_int32 x )
94} 94}
95 95
96/* Divide two int32 values and return result as int32 in a given Q-domain */ 96/* Divide two int32 values and return result as int32 in a given Q-domain */
97static inline opus_int32 silk_DIV32_varQ( /* O returns a good approximation of "(a32 << Qres) / b32" */ 97static OPUS_INLINE opus_int32 silk_DIV32_varQ( /* O returns a good approximation of "(a32 << Qres) / b32" */
98 const opus_int32 a32, /* I numerator (Q0) */ 98 const opus_int32 a32, /* I numerator (Q0) */
99 const opus_int32 b32, /* I denominator (Q0) */ 99 const opus_int32 b32, /* I denominator (Q0) */
100 const opus_int Qres /* I Q-domain of result (>= 0) */ 100 const opus_int Qres /* I Q-domain of result (>= 0) */
@@ -140,7 +140,7 @@ static inline opus_int32 silk_DIV32_varQ( /* O returns a good approximation
140} 140}
141 141
142/* Invert int32 value and return result as int32 in a given Q-domain */ 142/* Invert int32 value and return result as int32 in a given Q-domain */
143static inline opus_int32 silk_INVERSE32_varQ( /* O returns a good approximation of "(1 << Qres) / b32" */ 143static OPUS_INLINE opus_int32 silk_INVERSE32_varQ( /* O returns a good approximation of "(1 << Qres) / b32" */
144 const opus_int32 b32, /* I denominator (Q0) */ 144 const opus_int32 b32, /* I denominator (Q0) */
145 const opus_int Qres /* I Q-domain of result (> 0) */ 145 const opus_int Qres /* I Q-domain of result (> 0) */
146) 146)
diff --git a/lib/rbcodec/codecs/libopus/silk/LPC_analysis_filter.c b/lib/rbcodec/codecs/libopus/silk/LPC_analysis_filter.c
index 9bfeba0f5f..9d1f16cb7d 100644
--- a/lib/rbcodec/codecs/libopus/silk/LPC_analysis_filter.c
+++ b/lib/rbcodec/codecs/libopus/silk/LPC_analysis_filter.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/LPC_inv_pred_gain.c b/lib/rbcodec/codecs/libopus/silk/LPC_inv_pred_gain.c
index fec5732616..dd14d4bca6 100644
--- a/lib/rbcodec/codecs/libopus/silk/LPC_inv_pred_gain.c
+++ b/lib/rbcodec/codecs/libopus/silk/LPC_inv_pred_gain.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/MacroCount.h b/lib/rbcodec/codecs/libopus/silk/MacroCount.h
index 6395d250b2..834817d058 100644
--- a/lib/rbcodec/codecs/libopus/silk/MacroCount.h
+++ b/lib/rbcodec/codecs/libopus/silk/MacroCount.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -34,11 +34,11 @@ POSSIBILITY OF SUCH DAMAGE.
34 34
35extern opus_int64 ops_count; 35extern opus_int64 ops_count;
36 36
37static inline opus_int64 silk_SaveCount(){ 37static OPUS_INLINE opus_int64 silk_SaveCount(){
38 return(ops_count); 38 return(ops_count);
39} 39}
40 40
41static inline opus_int64 silk_SaveResetCount(){ 41static OPUS_INLINE opus_int64 silk_SaveResetCount(){
42 opus_int64 ret; 42 opus_int64 ret;
43 43
44 ret = ops_count; 44 ret = ops_count;
@@ -46,12 +46,12 @@ static inline opus_int64 silk_SaveResetCount(){
46 return(ret); 46 return(ret);
47} 47}
48 48
49static inline silk_PrintCount(){ 49static OPUS_INLINE silk_PrintCount(){
50 printf("ops_count = %d \n ", (opus_int32)ops_count); 50 printf("ops_count = %d \n ", (opus_int32)ops_count);
51} 51}
52 52
53#undef silk_MUL 53#undef silk_MUL
54static inline opus_int32 silk_MUL(opus_int32 a32, opus_int32 b32){ 54static OPUS_INLINE opus_int32 silk_MUL(opus_int32 a32, opus_int32 b32){
55 opus_int32 ret; 55 opus_int32 ret;
56 ops_count += 4; 56 ops_count += 4;
57 ret = a32 * b32; 57 ret = a32 * b32;
@@ -59,14 +59,14 @@ static inline opus_int32 silk_MUL(opus_int32 a32, opus_int32 b32){
59} 59}
60 60
61#undef silk_MUL_uint 61#undef silk_MUL_uint
62static inline opus_uint32 silk_MUL_uint(opus_uint32 a32, opus_uint32 b32){ 62static OPUS_INLINE opus_uint32 silk_MUL_uint(opus_uint32 a32, opus_uint32 b32){
63 opus_uint32 ret; 63 opus_uint32 ret;
64 ops_count += 4; 64 ops_count += 4;
65 ret = a32 * b32; 65 ret = a32 * b32;
66 return ret; 66 return ret;
67} 67}
68#undef silk_MLA 68#undef silk_MLA
69static inline opus_int32 silk_MLA(opus_int32 a32, opus_int32 b32, opus_int32 c32){ 69static OPUS_INLINE opus_int32 silk_MLA(opus_int32 a32, opus_int32 b32, opus_int32 c32){
70 opus_int32 ret; 70 opus_int32 ret;
71 ops_count += 4; 71 ops_count += 4;
72 ret = a32 + b32 * c32; 72 ret = a32 + b32 * c32;
@@ -74,7 +74,7 @@ static inline opus_int32 silk_MLA(opus_int32 a32, opus_int32 b32, opus_int32 c32
74} 74}
75 75
76#undef silk_MLA_uint 76#undef silk_MLA_uint
77static inline opus_int32 silk_MLA_uint(opus_uint32 a32, opus_uint32 b32, opus_uint32 c32){ 77static OPUS_INLINE opus_int32 silk_MLA_uint(opus_uint32 a32, opus_uint32 b32, opus_uint32 c32){
78 opus_uint32 ret; 78 opus_uint32 ret;
79 ops_count += 4; 79 ops_count += 4;
80 ret = a32 + b32 * c32; 80 ret = a32 + b32 * c32;
@@ -82,14 +82,14 @@ static inline opus_int32 silk_MLA_uint(opus_uint32 a32, opus_uint32 b32, opus_ui
82} 82}
83 83
84#undef silk_SMULWB 84#undef silk_SMULWB
85static inline opus_int32 silk_SMULWB(opus_int32 a32, opus_int32 b32){ 85static OPUS_INLINE opus_int32 silk_SMULWB(opus_int32 a32, opus_int32 b32){
86 opus_int32 ret; 86 opus_int32 ret;
87 ops_count += 5; 87 ops_count += 5;
88 ret = (a32 >> 16) * (opus_int32)((opus_int16)b32) + (((a32 & 0x0000FFFF) * (opus_int32)((opus_int16)b32)) >> 16); 88 ret = (a32 >> 16) * (opus_int32)((opus_int16)b32) + (((a32 & 0x0000FFFF) * (opus_int32)((opus_int16)b32)) >> 16);
89 return ret; 89 return ret;
90} 90}
91#undef silk_SMLAWB 91#undef silk_SMLAWB
92static inline opus_int32 silk_SMLAWB(opus_int32 a32, opus_int32 b32, opus_int32 c32){ 92static OPUS_INLINE opus_int32 silk_SMLAWB(opus_int32 a32, opus_int32 b32, opus_int32 c32){
93 opus_int32 ret; 93 opus_int32 ret;
94 ops_count += 5; 94 ops_count += 5;
95 ret = ((a32) + ((((b32) >> 16) * (opus_int32)((opus_int16)(c32))) + ((((b32) & 0x0000FFFF) * (opus_int32)((opus_int16)(c32))) >> 16))); 95 ret = ((a32) + ((((b32) >> 16) * (opus_int32)((opus_int16)(c32))) + ((((b32) & 0x0000FFFF) * (opus_int32)((opus_int16)(c32))) >> 16)));
@@ -97,14 +97,14 @@ static inline opus_int32 silk_SMLAWB(opus_int32 a32, opus_int32 b32, opus_int32
97} 97}
98 98
99#undef silk_SMULWT 99#undef silk_SMULWT
100static inline opus_int32 silk_SMULWT(opus_int32 a32, opus_int32 b32){ 100static OPUS_INLINE opus_int32 silk_SMULWT(opus_int32 a32, opus_int32 b32){
101 opus_int32 ret; 101 opus_int32 ret;
102 ops_count += 4; 102 ops_count += 4;
103 ret = (a32 >> 16) * (b32 >> 16) + (((a32 & 0x0000FFFF) * (b32 >> 16)) >> 16); 103 ret = (a32 >> 16) * (b32 >> 16) + (((a32 & 0x0000FFFF) * (b32 >> 16)) >> 16);
104 return ret; 104 return ret;
105} 105}
106#undef silk_SMLAWT 106#undef silk_SMLAWT
107static inline opus_int32 silk_SMLAWT(opus_int32 a32, opus_int32 b32, opus_int32 c32){ 107static OPUS_INLINE opus_int32 silk_SMLAWT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
108 opus_int32 ret; 108 opus_int32 ret;
109 ops_count += 4; 109 ops_count += 4;
110 ret = a32 + ((b32 >> 16) * (c32 >> 16)) + (((b32 & 0x0000FFFF) * ((c32 >> 16)) >> 16)); 110 ret = a32 + ((b32 >> 16) * (c32 >> 16)) + (((b32 & 0x0000FFFF) * ((c32 >> 16)) >> 16));
@@ -112,14 +112,14 @@ static inline opus_int32 silk_SMLAWT(opus_int32 a32, opus_int32 b32, opus_int32
112} 112}
113 113
114#undef silk_SMULBB 114#undef silk_SMULBB
115static inline opus_int32 silk_SMULBB(opus_int32 a32, opus_int32 b32){ 115static OPUS_INLINE opus_int32 silk_SMULBB(opus_int32 a32, opus_int32 b32){
116 opus_int32 ret; 116 opus_int32 ret;
117 ops_count += 1; 117 ops_count += 1;
118 ret = (opus_int32)((opus_int16)a32) * (opus_int32)((opus_int16)b32); 118 ret = (opus_int32)((opus_int16)a32) * (opus_int32)((opus_int16)b32);
119 return ret; 119 return ret;
120} 120}
121#undef silk_SMLABB 121#undef silk_SMLABB
122static inline opus_int32 silk_SMLABB(opus_int32 a32, opus_int32 b32, opus_int32 c32){ 122static OPUS_INLINE opus_int32 silk_SMLABB(opus_int32 a32, opus_int32 b32, opus_int32 c32){
123 opus_int32 ret; 123 opus_int32 ret;
124 ops_count += 1; 124 ops_count += 1;
125 ret = a32 + (opus_int32)((opus_int16)b32) * (opus_int32)((opus_int16)c32); 125 ret = a32 + (opus_int32)((opus_int16)b32) * (opus_int32)((opus_int16)c32);
@@ -127,7 +127,7 @@ static inline opus_int32 silk_SMLABB(opus_int32 a32, opus_int32 b32, opus_int32
127} 127}
128 128
129#undef silk_SMULBT 129#undef silk_SMULBT
130static inline opus_int32 silk_SMULBT(opus_int32 a32, opus_int32 b32 ){ 130static OPUS_INLINE opus_int32 silk_SMULBT(opus_int32 a32, opus_int32 b32 ){
131 opus_int32 ret; 131 opus_int32 ret;
132 ops_count += 4; 132 ops_count += 4;
133 ret = ((opus_int32)((opus_int16)a32)) * (b32 >> 16); 133 ret = ((opus_int32)((opus_int16)a32)) * (b32 >> 16);
@@ -135,7 +135,7 @@ static inline opus_int32 silk_SMULBT(opus_int32 a32, opus_int32 b32 ){
135} 135}
136 136
137#undef silk_SMLABT 137#undef silk_SMLABT
138static inline opus_int32 silk_SMLABT(opus_int32 a32, opus_int32 b32, opus_int32 c32){ 138static OPUS_INLINE opus_int32 silk_SMLABT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
139 opus_int32 ret; 139 opus_int32 ret;
140 ops_count += 1; 140 ops_count += 1;
141 ret = a32 + ((opus_int32)((opus_int16)b32)) * (c32 >> 16); 141 ret = a32 + ((opus_int32)((opus_int16)b32)) * (c32 >> 16);
@@ -143,7 +143,7 @@ static inline opus_int32 silk_SMLABT(opus_int32 a32, opus_int32 b32, opus_int32
143} 143}
144 144
145#undef silk_SMULTT 145#undef silk_SMULTT
146static inline opus_int32 silk_SMULTT(opus_int32 a32, opus_int32 b32){ 146static OPUS_INLINE opus_int32 silk_SMULTT(opus_int32 a32, opus_int32 b32){
147 opus_int32 ret; 147 opus_int32 ret;
148 ops_count += 1; 148 ops_count += 1;
149 ret = (a32 >> 16) * (b32 >> 16); 149 ret = (a32 >> 16) * (b32 >> 16);
@@ -151,7 +151,7 @@ static inline opus_int32 silk_SMULTT(opus_int32 a32, opus_int32 b32){
151} 151}
152 152
153#undef silk_SMLATT 153#undef silk_SMLATT
154static inline opus_int32 silk_SMLATT(opus_int32 a32, opus_int32 b32, opus_int32 c32){ 154static OPUS_INLINE opus_int32 silk_SMLATT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
155 opus_int32 ret; 155 opus_int32 ret;
156 ops_count += 1; 156 ops_count += 1;
157 ret = a32 + (b32 >> 16) * (c32 >> 16); 157 ret = a32 + (b32 >> 16) * (c32 >> 16);
@@ -179,7 +179,7 @@ static inline opus_int32 silk_SMLATT(opus_int32 a32, opus_int32 b32, opus_int32
179#define silk_SMLAWT_ovflw silk_SMLAWT 179#define silk_SMLAWT_ovflw silk_SMLAWT
180 180
181#undef silk_SMULL 181#undef silk_SMULL
182static inline opus_int64 silk_SMULL(opus_int32 a32, opus_int32 b32){ 182static OPUS_INLINE opus_int64 silk_SMULL(opus_int32 a32, opus_int32 b32){
183 opus_int64 ret; 183 opus_int64 ret;
184 ops_count += 8; 184 ops_count += 8;
185 ret = ((opus_int64)(a32) * /*(opus_int64)*/(b32)); 185 ret = ((opus_int64)(a32) * /*(opus_int64)*/(b32));
@@ -187,14 +187,14 @@ static inline opus_int64 silk_SMULL(opus_int32 a32, opus_int32 b32){
187} 187}
188 188
189#undef silk_SMLAL 189#undef silk_SMLAL
190static inline opus_int64 silk_SMLAL(opus_int64 a64, opus_int32 b32, opus_int32 c32){ 190static OPUS_INLINE opus_int64 silk_SMLAL(opus_int64 a64, opus_int32 b32, opus_int32 c32){
191 opus_int64 ret; 191 opus_int64 ret;
192 ops_count += 8; 192 ops_count += 8;
193 ret = a64 + ((opus_int64)(b32) * /*(opus_int64)*/(c32)); 193 ret = a64 + ((opus_int64)(b32) * /*(opus_int64)*/(c32));
194 return ret; 194 return ret;
195} 195}
196#undef silk_SMLALBB 196#undef silk_SMLALBB
197static inline opus_int64 silk_SMLALBB(opus_int64 a64, opus_int16 b16, opus_int16 c16){ 197static OPUS_INLINE opus_int64 silk_SMLALBB(opus_int64 a64, opus_int16 b16, opus_int16 c16){
198 opus_int64 ret; 198 opus_int64 ret;
199 ops_count += 4; 199 ops_count += 4;
200 ret = a64 + ((opus_int64)(b16) * /*(opus_int64)*/(c16)); 200 ret = a64 + ((opus_int64)(b16) * /*(opus_int64)*/(c16));
@@ -202,7 +202,7 @@ static inline opus_int64 silk_SMLALBB(opus_int64 a64, opus_int16 b16, opus_int16
202} 202}
203 203
204#undef SigProcFIX_CLZ16 204#undef SigProcFIX_CLZ16
205static inline opus_int32 SigProcFIX_CLZ16(opus_int16 in16) 205static OPUS_INLINE opus_int32 SigProcFIX_CLZ16(opus_int16 in16)
206{ 206{
207 opus_int32 out32 = 0; 207 opus_int32 out32 = 0;
208 ops_count += 10; 208 ops_count += 10;
@@ -240,7 +240,7 @@ static inline opus_int32 SigProcFIX_CLZ16(opus_int16 in16)
240} 240}
241 241
242#undef SigProcFIX_CLZ32 242#undef SigProcFIX_CLZ32
243static inline opus_int32 SigProcFIX_CLZ32(opus_int32 in32) 243static OPUS_INLINE opus_int32 SigProcFIX_CLZ32(opus_int32 in32)
244{ 244{
245 /* test highest 16 bits and convert to opus_int16 */ 245 /* test highest 16 bits and convert to opus_int16 */
246 ops_count += 2; 246 ops_count += 2;
@@ -252,19 +252,19 @@ static inline opus_int32 SigProcFIX_CLZ32(opus_int32 in32)
252} 252}
253 253
254#undef silk_DIV32 254#undef silk_DIV32
255static inline opus_int32 silk_DIV32(opus_int32 a32, opus_int32 b32){ 255static OPUS_INLINE opus_int32 silk_DIV32(opus_int32 a32, opus_int32 b32){
256 ops_count += 64; 256 ops_count += 64;
257 return a32 / b32; 257 return a32 / b32;
258} 258}
259 259
260#undef silk_DIV32_16 260#undef silk_DIV32_16
261static inline opus_int32 silk_DIV32_16(opus_int32 a32, opus_int32 b32){ 261static OPUS_INLINE opus_int32 silk_DIV32_16(opus_int32 a32, opus_int32 b32){
262 ops_count += 32; 262 ops_count += 32;
263 return a32 / b32; 263 return a32 / b32;
264} 264}
265 265
266#undef silk_SAT8 266#undef silk_SAT8
267static inline opus_int8 silk_SAT8(opus_int64 a){ 267static OPUS_INLINE opus_int8 silk_SAT8(opus_int64 a){
268 opus_int8 tmp; 268 opus_int8 tmp;
269 ops_count += 1; 269 ops_count += 1;
270 tmp = (opus_int8)((a) > silk_int8_MAX ? silk_int8_MAX : \ 270 tmp = (opus_int8)((a) > silk_int8_MAX ? silk_int8_MAX : \
@@ -273,7 +273,7 @@ static inline opus_int8 silk_SAT8(opus_int64 a){
273} 273}
274 274
275#undef silk_SAT16 275#undef silk_SAT16
276static inline opus_int16 silk_SAT16(opus_int64 a){ 276static OPUS_INLINE opus_int16 silk_SAT16(opus_int64 a){
277 opus_int16 tmp; 277 opus_int16 tmp;
278 ops_count += 1; 278 ops_count += 1;
279 tmp = (opus_int16)((a) > silk_int16_MAX ? silk_int16_MAX : \ 279 tmp = (opus_int16)((a) > silk_int16_MAX ? silk_int16_MAX : \
@@ -281,7 +281,7 @@ static inline opus_int16 silk_SAT16(opus_int64 a){
281 return(tmp); 281 return(tmp);
282} 282}
283#undef silk_SAT32 283#undef silk_SAT32
284static inline opus_int32 silk_SAT32(opus_int64 a){ 284static OPUS_INLINE opus_int32 silk_SAT32(opus_int64 a){
285 opus_int32 tmp; 285 opus_int32 tmp;
286 ops_count += 1; 286 ops_count += 1;
287 tmp = (opus_int32)((a) > silk_int32_MAX ? silk_int32_MAX : \ 287 tmp = (opus_int32)((a) > silk_int32_MAX ? silk_int32_MAX : \
@@ -289,7 +289,7 @@ static inline opus_int32 silk_SAT32(opus_int64 a){
289 return(tmp); 289 return(tmp);
290} 290}
291#undef silk_POS_SAT32 291#undef silk_POS_SAT32
292static inline opus_int32 silk_POS_SAT32(opus_int64 a){ 292static OPUS_INLINE opus_int32 silk_POS_SAT32(opus_int64 a){
293 opus_int32 tmp; 293 opus_int32 tmp;
294 ops_count += 1; 294 ops_count += 1;
295 tmp = (opus_int32)((a) > silk_int32_MAX ? silk_int32_MAX : (a)); 295 tmp = (opus_int32)((a) > silk_int32_MAX ? silk_int32_MAX : (a));
@@ -297,14 +297,14 @@ static inline opus_int32 silk_POS_SAT32(opus_int64 a){
297} 297}
298 298
299#undef silk_ADD_POS_SAT8 299#undef silk_ADD_POS_SAT8
300static inline opus_int8 silk_ADD_POS_SAT8(opus_int64 a, opus_int64 b){ 300static OPUS_INLINE opus_int8 silk_ADD_POS_SAT8(opus_int64 a, opus_int64 b){
301 opus_int8 tmp; 301 opus_int8 tmp;
302 ops_count += 1; 302 ops_count += 1;
303 tmp = (opus_int8)((((a)+(b)) & 0x80) ? silk_int8_MAX : ((a)+(b))); 303 tmp = (opus_int8)((((a)+(b)) & 0x80) ? silk_int8_MAX : ((a)+(b)));
304 return(tmp); 304 return(tmp);
305} 305}
306#undef silk_ADD_POS_SAT16 306#undef silk_ADD_POS_SAT16
307static inline opus_int16 silk_ADD_POS_SAT16(opus_int64 a, opus_int64 b){ 307static OPUS_INLINE opus_int16 silk_ADD_POS_SAT16(opus_int64 a, opus_int64 b){
308 opus_int16 tmp; 308 opus_int16 tmp;
309 ops_count += 1; 309 ops_count += 1;
310 tmp = (opus_int16)((((a)+(b)) & 0x8000) ? silk_int16_MAX : ((a)+(b))); 310 tmp = (opus_int16)((((a)+(b)) & 0x8000) ? silk_int16_MAX : ((a)+(b)));
@@ -312,7 +312,7 @@ static inline opus_int16 silk_ADD_POS_SAT16(opus_int64 a, opus_int64 b){
312} 312}
313 313
314#undef silk_ADD_POS_SAT32 314#undef silk_ADD_POS_SAT32
315static inline opus_int32 silk_ADD_POS_SAT32(opus_int64 a, opus_int64 b){ 315static OPUS_INLINE opus_int32 silk_ADD_POS_SAT32(opus_int64 a, opus_int64 b){
316 opus_int32 tmp; 316 opus_int32 tmp;
317 ops_count += 1; 317 ops_count += 1;
318 tmp = (opus_int32)((((a)+(b)) & 0x80000000) ? silk_int32_MAX : ((a)+(b))); 318 tmp = (opus_int32)((((a)+(b)) & 0x80000000) ? silk_int32_MAX : ((a)+(b)));
@@ -320,7 +320,7 @@ static inline opus_int32 silk_ADD_POS_SAT32(opus_int64 a, opus_int64 b){
320} 320}
321 321
322#undef silk_ADD_POS_SAT64 322#undef silk_ADD_POS_SAT64
323static inline opus_int64 silk_ADD_POS_SAT64(opus_int64 a, opus_int64 b){ 323static OPUS_INLINE opus_int64 silk_ADD_POS_SAT64(opus_int64 a, opus_int64 b){
324 opus_int64 tmp; 324 opus_int64 tmp;
325 ops_count += 1; 325 ops_count += 1;
326 tmp = ((((a)+(b)) & 0x8000000000000000LL) ? silk_int64_MAX : ((a)+(b))); 326 tmp = ((((a)+(b)) & 0x8000000000000000LL) ? silk_int64_MAX : ((a)+(b)));
@@ -328,40 +328,40 @@ static inline opus_int64 silk_ADD_POS_SAT64(opus_int64 a, opus_int64 b){
328} 328}
329 329
330#undef silk_LSHIFT8 330#undef silk_LSHIFT8
331static inline opus_int8 silk_LSHIFT8(opus_int8 a, opus_int32 shift){ 331static OPUS_INLINE opus_int8 silk_LSHIFT8(opus_int8 a, opus_int32 shift){
332 opus_int8 ret; 332 opus_int8 ret;
333 ops_count += 1; 333 ops_count += 1;
334 ret = a << shift; 334 ret = a << shift;
335 return ret; 335 return ret;
336} 336}
337#undef silk_LSHIFT16 337#undef silk_LSHIFT16
338static inline opus_int16 silk_LSHIFT16(opus_int16 a, opus_int32 shift){ 338static OPUS_INLINE opus_int16 silk_LSHIFT16(opus_int16 a, opus_int32 shift){
339 opus_int16 ret; 339 opus_int16 ret;
340 ops_count += 1; 340 ops_count += 1;
341 ret = a << shift; 341 ret = a << shift;
342 return ret; 342 return ret;
343} 343}
344#undef silk_LSHIFT32 344#undef silk_LSHIFT32
345static inline opus_int32 silk_LSHIFT32(opus_int32 a, opus_int32 shift){ 345static OPUS_INLINE opus_int32 silk_LSHIFT32(opus_int32 a, opus_int32 shift){
346 opus_int32 ret; 346 opus_int32 ret;
347 ops_count += 1; 347 ops_count += 1;
348 ret = a << shift; 348 ret = a << shift;
349 return ret; 349 return ret;
350} 350}
351#undef silk_LSHIFT64 351#undef silk_LSHIFT64
352static inline opus_int64 silk_LSHIFT64(opus_int64 a, opus_int shift){ 352static OPUS_INLINE opus_int64 silk_LSHIFT64(opus_int64 a, opus_int shift){
353 ops_count += 1; 353 ops_count += 1;
354 return a << shift; 354 return a << shift;
355} 355}
356 356
357#undef silk_LSHIFT_ovflw 357#undef silk_LSHIFT_ovflw
358static inline opus_int32 silk_LSHIFT_ovflw(opus_int32 a, opus_int32 shift){ 358static OPUS_INLINE opus_int32 silk_LSHIFT_ovflw(opus_int32 a, opus_int32 shift){
359 ops_count += 1; 359 ops_count += 1;
360 return a << shift; 360 return a << shift;
361} 361}
362 362
363#undef silk_LSHIFT_uint 363#undef silk_LSHIFT_uint
364static inline opus_uint32 silk_LSHIFT_uint(opus_uint32 a, opus_int32 shift){ 364static OPUS_INLINE opus_uint32 silk_LSHIFT_uint(opus_uint32 a, opus_int32 shift){
365 opus_uint32 ret; 365 opus_uint32 ret;
366 ops_count += 1; 366 ops_count += 1;
367 ret = a << shift; 367 ret = a << shift;
@@ -369,83 +369,83 @@ static inline opus_uint32 silk_LSHIFT_uint(opus_uint32 a, opus_int32 shift){
369} 369}
370 370
371#undef silk_RSHIFT8 371#undef silk_RSHIFT8
372static inline opus_int8 silk_RSHIFT8(opus_int8 a, opus_int32 shift){ 372static OPUS_INLINE opus_int8 silk_RSHIFT8(opus_int8 a, opus_int32 shift){
373 ops_count += 1; 373 ops_count += 1;
374 return a >> shift; 374 return a >> shift;
375} 375}
376#undef silk_RSHIFT16 376#undef silk_RSHIFT16
377static inline opus_int16 silk_RSHIFT16(opus_int16 a, opus_int32 shift){ 377static OPUS_INLINE opus_int16 silk_RSHIFT16(opus_int16 a, opus_int32 shift){
378 ops_count += 1; 378 ops_count += 1;
379 return a >> shift; 379 return a >> shift;
380} 380}
381#undef silk_RSHIFT32 381#undef silk_RSHIFT32
382static inline opus_int32 silk_RSHIFT32(opus_int32 a, opus_int32 shift){ 382static OPUS_INLINE opus_int32 silk_RSHIFT32(opus_int32 a, opus_int32 shift){
383 ops_count += 1; 383 ops_count += 1;
384 return a >> shift; 384 return a >> shift;
385} 385}
386#undef silk_RSHIFT64 386#undef silk_RSHIFT64
387static inline opus_int64 silk_RSHIFT64(opus_int64 a, opus_int64 shift){ 387static OPUS_INLINE opus_int64 silk_RSHIFT64(opus_int64 a, opus_int64 shift){
388 ops_count += 1; 388 ops_count += 1;
389 return a >> shift; 389 return a >> shift;
390} 390}
391 391
392#undef silk_RSHIFT_uint 392#undef silk_RSHIFT_uint
393static inline opus_uint32 silk_RSHIFT_uint(opus_uint32 a, opus_int32 shift){ 393static OPUS_INLINE opus_uint32 silk_RSHIFT_uint(opus_uint32 a, opus_int32 shift){
394 ops_count += 1; 394 ops_count += 1;
395 return a >> shift; 395 return a >> shift;
396} 396}
397 397
398#undef silk_ADD_LSHIFT 398#undef silk_ADD_LSHIFT
399static inline opus_int32 silk_ADD_LSHIFT(opus_int32 a, opus_int32 b, opus_int32 shift){ 399static OPUS_INLINE opus_int32 silk_ADD_LSHIFT(opus_int32 a, opus_int32 b, opus_int32 shift){
400 opus_int32 ret; 400 opus_int32 ret;
401 ops_count += 1; 401 ops_count += 1;
402 ret = a + (b << shift); 402 ret = a + (b << shift);
403 return ret; /* shift >= 0*/ 403 return ret; /* shift >= 0*/
404} 404}
405#undef silk_ADD_LSHIFT32 405#undef silk_ADD_LSHIFT32
406static inline opus_int32 silk_ADD_LSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){ 406static OPUS_INLINE opus_int32 silk_ADD_LSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
407 opus_int32 ret; 407 opus_int32 ret;
408 ops_count += 1; 408 ops_count += 1;
409 ret = a + (b << shift); 409 ret = a + (b << shift);
410 return ret; /* shift >= 0*/ 410 return ret; /* shift >= 0*/
411} 411}
412#undef silk_ADD_LSHIFT_uint 412#undef silk_ADD_LSHIFT_uint
413static inline opus_uint32 silk_ADD_LSHIFT_uint(opus_uint32 a, opus_uint32 b, opus_int32 shift){ 413static OPUS_INLINE opus_uint32 silk_ADD_LSHIFT_uint(opus_uint32 a, opus_uint32 b, opus_int32 shift){
414 opus_uint32 ret; 414 opus_uint32 ret;
415 ops_count += 1; 415 ops_count += 1;
416 ret = a + (b << shift); 416 ret = a + (b << shift);
417 return ret; /* shift >= 0*/ 417 return ret; /* shift >= 0*/
418} 418}
419#undef silk_ADD_RSHIFT 419#undef silk_ADD_RSHIFT
420static inline opus_int32 silk_ADD_RSHIFT(opus_int32 a, opus_int32 b, opus_int32 shift){ 420static OPUS_INLINE opus_int32 silk_ADD_RSHIFT(opus_int32 a, opus_int32 b, opus_int32 shift){
421 opus_int32 ret; 421 opus_int32 ret;
422 ops_count += 1; 422 ops_count += 1;
423 ret = a + (b >> shift); 423 ret = a + (b >> shift);
424 return ret; /* shift > 0*/ 424 return ret; /* shift > 0*/
425} 425}
426#undef silk_ADD_RSHIFT32 426#undef silk_ADD_RSHIFT32
427static inline opus_int32 silk_ADD_RSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){ 427static OPUS_INLINE opus_int32 silk_ADD_RSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
428 opus_int32 ret; 428 opus_int32 ret;
429 ops_count += 1; 429 ops_count += 1;
430 ret = a + (b >> shift); 430 ret = a + (b >> shift);
431 return ret; /* shift > 0*/ 431 return ret; /* shift > 0*/
432} 432}
433#undef silk_ADD_RSHIFT_uint 433#undef silk_ADD_RSHIFT_uint
434static inline opus_uint32 silk_ADD_RSHIFT_uint(opus_uint32 a, opus_uint32 b, opus_int32 shift){ 434static OPUS_INLINE opus_uint32 silk_ADD_RSHIFT_uint(opus_uint32 a, opus_uint32 b, opus_int32 shift){
435 opus_uint32 ret; 435 opus_uint32 ret;
436 ops_count += 1; 436 ops_count += 1;
437 ret = a + (b >> shift); 437 ret = a + (b >> shift);
438 return ret; /* shift > 0*/ 438 return ret; /* shift > 0*/
439} 439}
440#undef silk_SUB_LSHIFT32 440#undef silk_SUB_LSHIFT32
441static inline opus_int32 silk_SUB_LSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){ 441static OPUS_INLINE opus_int32 silk_SUB_LSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
442 opus_int32 ret; 442 opus_int32 ret;
443 ops_count += 1; 443 ops_count += 1;
444 ret = a - (b << shift); 444 ret = a - (b << shift);
445 return ret; /* shift >= 0*/ 445 return ret; /* shift >= 0*/
446} 446}
447#undef silk_SUB_RSHIFT32 447#undef silk_SUB_RSHIFT32
448static inline opus_int32 silk_SUB_RSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){ 448static OPUS_INLINE opus_int32 silk_SUB_RSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
449 opus_int32 ret; 449 opus_int32 ret;
450 ops_count += 1; 450 ops_count += 1;
451 ret = a - (b >> shift); 451 ret = a - (b >> shift);
@@ -453,7 +453,7 @@ static inline opus_int32 silk_SUB_RSHIFT32(opus_int32 a, opus_int32 b, opus_int3
453} 453}
454 454
455#undef silk_RSHIFT_ROUND 455#undef silk_RSHIFT_ROUND
456static inline opus_int32 silk_RSHIFT_ROUND(opus_int32 a, opus_int32 shift){ 456static OPUS_INLINE opus_int32 silk_RSHIFT_ROUND(opus_int32 a, opus_int32 shift){
457 opus_int32 ret; 457 opus_int32 ret;
458 ops_count += 3; 458 ops_count += 3;
459 ret = shift == 1 ? (a >> 1) + (a & 1) : ((a >> (shift - 1)) + 1) >> 1; 459 ret = shift == 1 ? (a >> 1) + (a & 1) : ((a >> (shift - 1)) + 1) >> 1;
@@ -461,7 +461,7 @@ static inline opus_int32 silk_RSHIFT_ROUND(opus_int32 a, opus_int32 shift){
461} 461}
462 462
463#undef silk_RSHIFT_ROUND64 463#undef silk_RSHIFT_ROUND64
464static inline opus_int64 silk_RSHIFT_ROUND64(opus_int64 a, opus_int32 shift){ 464static OPUS_INLINE opus_int64 silk_RSHIFT_ROUND64(opus_int64 a, opus_int32 shift){
465 opus_int64 ret; 465 opus_int64 ret;
466 ops_count += 6; 466 ops_count += 6;
467 ret = shift == 1 ? (a >> 1) + (a & 1) : ((a >> (shift - 1)) + 1) >> 1; 467 ret = shift == 1 ? (a >> 1) + (a & 1) : ((a >> (shift - 1)) + 1) >> 1;
@@ -469,13 +469,13 @@ static inline opus_int64 silk_RSHIFT_ROUND64(opus_int64 a, opus_int32 shift){
469} 469}
470 470
471#undef silk_abs_int64 471#undef silk_abs_int64
472static inline opus_int64 silk_abs_int64(opus_int64 a){ 472static OPUS_INLINE opus_int64 silk_abs_int64(opus_int64 a){
473 ops_count += 1; 473 ops_count += 1;
474 return (((a) > 0) ? (a) : -(a)); /* Be careful, silk_abs returns wrong when input equals to silk_intXX_MIN*/ 474 return (((a) > 0) ? (a) : -(a)); /* Be careful, silk_abs returns wrong when input equals to silk_intXX_MIN*/
475} 475}
476 476
477#undef silk_abs_int32 477#undef silk_abs_int32
478static inline opus_int32 silk_abs_int32(opus_int32 a){ 478static OPUS_INLINE opus_int32 silk_abs_int32(opus_int32 a){
479 ops_count += 1; 479 ops_count += 1;
480 return silk_abs(a); 480 return silk_abs(a);
481} 481}
@@ -498,7 +498,7 @@ static silk_sign(a){
498} 498}
499 499
500#undef silk_ADD16 500#undef silk_ADD16
501static inline opus_int16 silk_ADD16(opus_int16 a, opus_int16 b){ 501static OPUS_INLINE opus_int16 silk_ADD16(opus_int16 a, opus_int16 b){
502 opus_int16 ret; 502 opus_int16 ret;
503 ops_count += 1; 503 ops_count += 1;
504 ret = a + b; 504 ret = a + b;
@@ -506,7 +506,7 @@ static inline opus_int16 silk_ADD16(opus_int16 a, opus_int16 b){
506} 506}
507 507
508#undef silk_ADD32 508#undef silk_ADD32
509static inline opus_int32 silk_ADD32(opus_int32 a, opus_int32 b){ 509static OPUS_INLINE opus_int32 silk_ADD32(opus_int32 a, opus_int32 b){
510 opus_int32 ret; 510 opus_int32 ret;
511 ops_count += 1; 511 ops_count += 1;
512 ret = a + b; 512 ret = a + b;
@@ -514,7 +514,7 @@ static inline opus_int32 silk_ADD32(opus_int32 a, opus_int32 b){
514} 514}
515 515
516#undef silk_ADD64 516#undef silk_ADD64
517static inline opus_int64 silk_ADD64(opus_int64 a, opus_int64 b){ 517static OPUS_INLINE opus_int64 silk_ADD64(opus_int64 a, opus_int64 b){
518 opus_int64 ret; 518 opus_int64 ret;
519 ops_count += 2; 519 ops_count += 2;
520 ret = a + b; 520 ret = a + b;
@@ -522,7 +522,7 @@ static inline opus_int64 silk_ADD64(opus_int64 a, opus_int64 b){
522} 522}
523 523
524#undef silk_SUB16 524#undef silk_SUB16
525static inline opus_int16 silk_SUB16(opus_int16 a, opus_int16 b){ 525static OPUS_INLINE opus_int16 silk_SUB16(opus_int16 a, opus_int16 b){
526 opus_int16 ret; 526 opus_int16 ret;
527 ops_count += 1; 527 ops_count += 1;
528 ret = a - b; 528 ret = a - b;
@@ -530,7 +530,7 @@ static inline opus_int16 silk_SUB16(opus_int16 a, opus_int16 b){
530} 530}
531 531
532#undef silk_SUB32 532#undef silk_SUB32
533static inline opus_int32 silk_SUB32(opus_int32 a, opus_int32 b){ 533static OPUS_INLINE opus_int32 silk_SUB32(opus_int32 a, opus_int32 b){
534 opus_int32 ret; 534 opus_int32 ret;
535 ops_count += 1; 535 ops_count += 1;
536 ret = a - b; 536 ret = a - b;
@@ -538,7 +538,7 @@ static inline opus_int32 silk_SUB32(opus_int32 a, opus_int32 b){
538} 538}
539 539
540#undef silk_SUB64 540#undef silk_SUB64
541static inline opus_int64 silk_SUB64(opus_int64 a, opus_int64 b){ 541static OPUS_INLINE opus_int64 silk_SUB64(opus_int64 a, opus_int64 b){
542 opus_int64 ret; 542 opus_int64 ret;
543 ops_count += 2; 543 ops_count += 2;
544 ret = a - b; 544 ret = a - b;
@@ -546,7 +546,7 @@ static inline opus_int64 silk_SUB64(opus_int64 a, opus_int64 b){
546} 546}
547 547
548#undef silk_ADD_SAT16 548#undef silk_ADD_SAT16
549static inline opus_int16 silk_ADD_SAT16( opus_int16 a16, opus_int16 b16 ) { 549static OPUS_INLINE opus_int16 silk_ADD_SAT16( opus_int16 a16, opus_int16 b16 ) {
550 opus_int16 res; 550 opus_int16 res;
551 /* Nb will be counted in AKP_add32 and silk_SAT16*/ 551 /* Nb will be counted in AKP_add32 and silk_SAT16*/
552 res = (opus_int16)silk_SAT16( silk_ADD32( (opus_int32)(a16), (b16) ) ); 552 res = (opus_int16)silk_SAT16( silk_ADD32( (opus_int32)(a16), (b16) ) );
@@ -554,7 +554,7 @@ static inline opus_int16 silk_ADD_SAT16( opus_int16 a16, opus_int16 b16 ) {
554} 554}
555 555
556#undef silk_ADD_SAT32 556#undef silk_ADD_SAT32
557static inline opus_int32 silk_ADD_SAT32(opus_int32 a32, opus_int32 b32){ 557static OPUS_INLINE opus_int32 silk_ADD_SAT32(opus_int32 a32, opus_int32 b32){
558 opus_int32 res; 558 opus_int32 res;
559 ops_count += 1; 559 ops_count += 1;
560 res = ((((a32) + (b32)) & 0x80000000) == 0 ? \ 560 res = ((((a32) + (b32)) & 0x80000000) == 0 ? \
@@ -564,7 +564,7 @@ static inline opus_int32 silk_ADD_SAT32(opus_int32 a32, opus_int32 b32){
564} 564}
565 565
566#undef silk_ADD_SAT64 566#undef silk_ADD_SAT64
567static inline opus_int64 silk_ADD_SAT64( opus_int64 a64, opus_int64 b64 ) { 567static OPUS_INLINE opus_int64 silk_ADD_SAT64( opus_int64 a64, opus_int64 b64 ) {
568 opus_int64 res; 568 opus_int64 res;
569 ops_count += 1; 569 ops_count += 1;
570 res = ((((a64) + (b64)) & 0x8000000000000000LL) == 0 ? \ 570 res = ((((a64) + (b64)) & 0x8000000000000000LL) == 0 ? \
@@ -574,7 +574,7 @@ static inline opus_int64 silk_ADD_SAT64( opus_int64 a64, opus_int64 b64 ) {
574} 574}
575 575
576#undef silk_SUB_SAT16 576#undef silk_SUB_SAT16
577static inline opus_int16 silk_SUB_SAT16( opus_int16 a16, opus_int16 b16 ) { 577static OPUS_INLINE opus_int16 silk_SUB_SAT16( opus_int16 a16, opus_int16 b16 ) {
578 opus_int16 res; 578 opus_int16 res;
579 silk_assert(0); 579 silk_assert(0);
580 /* Nb will be counted in sub-macros*/ 580 /* Nb will be counted in sub-macros*/
@@ -583,7 +583,7 @@ static inline opus_int16 silk_SUB_SAT16( opus_int16 a16, opus_int16 b16 ) {
583} 583}
584 584
585#undef silk_SUB_SAT32 585#undef silk_SUB_SAT32
586static inline opus_int32 silk_SUB_SAT32( opus_int32 a32, opus_int32 b32 ) { 586static OPUS_INLINE opus_int32 silk_SUB_SAT32( opus_int32 a32, opus_int32 b32 ) {
587 opus_int32 res; 587 opus_int32 res;
588 ops_count += 1; 588 ops_count += 1;
589 res = ((((a32)-(b32)) & 0x80000000) == 0 ? \ 589 res = ((((a32)-(b32)) & 0x80000000) == 0 ? \
@@ -593,7 +593,7 @@ static inline opus_int32 silk_SUB_SAT32( opus_int32 a32, opus_int32 b32 ) {
593} 593}
594 594
595#undef silk_SUB_SAT64 595#undef silk_SUB_SAT64
596static inline opus_int64 silk_SUB_SAT64( opus_int64 a64, opus_int64 b64 ) { 596static OPUS_INLINE opus_int64 silk_SUB_SAT64( opus_int64 a64, opus_int64 b64 ) {
597 opus_int64 res; 597 opus_int64 res;
598 ops_count += 1; 598 ops_count += 1;
599 res = ((((a64)-(b64)) & 0x8000000000000000LL) == 0 ? \ 599 res = ((((a64)-(b64)) & 0x8000000000000000LL) == 0 ? \
@@ -604,7 +604,7 @@ static inline opus_int64 silk_SUB_SAT64( opus_int64 a64, opus_int64 b64 ) {
604} 604}
605 605
606#undef silk_SMULWW 606#undef silk_SMULWW
607static inline opus_int32 silk_SMULWW(opus_int32 a32, opus_int32 b32){ 607static OPUS_INLINE opus_int32 silk_SMULWW(opus_int32 a32, opus_int32 b32){
608 opus_int32 ret; 608 opus_int32 ret;
609 /* Nb will be counted in sub-macros*/ 609 /* Nb will be counted in sub-macros*/
610 ret = silk_MLA(silk_SMULWB((a32), (b32)), (a32), silk_RSHIFT_ROUND((b32), 16)); 610 ret = silk_MLA(silk_SMULWB((a32), (b32)), (a32), silk_RSHIFT_ROUND((b32), 16));
@@ -612,7 +612,7 @@ static inline opus_int32 silk_SMULWW(opus_int32 a32, opus_int32 b32){
612} 612}
613 613
614#undef silk_SMLAWW 614#undef silk_SMLAWW
615static inline opus_int32 silk_SMLAWW(opus_int32 a32, opus_int32 b32, opus_int32 c32){ 615static OPUS_INLINE opus_int32 silk_SMLAWW(opus_int32 a32, opus_int32 b32, opus_int32 c32){
616 opus_int32 ret; 616 opus_int32 ret;
617 /* Nb will be counted in sub-macros*/ 617 /* Nb will be counted in sub-macros*/
618 ret = silk_MLA(silk_SMLAWB((a32), (b32), (c32)), (b32), silk_RSHIFT_ROUND((c32), 16)); 618 ret = silk_MLA(silk_SMLAWB((a32), (b32), (c32)), (b32), silk_RSHIFT_ROUND((c32), 16));
@@ -620,26 +620,26 @@ static inline opus_int32 silk_SMLAWW(opus_int32 a32, opus_int32 b32, opus_int32
620} 620}
621 621
622#undef silk_min_int 622#undef silk_min_int
623static inline opus_int silk_min_int(opus_int a, opus_int b) 623static OPUS_INLINE opus_int silk_min_int(opus_int a, opus_int b)
624{ 624{
625 ops_count += 1; 625 ops_count += 1;
626 return (((a) < (b)) ? (a) : (b)); 626 return (((a) < (b)) ? (a) : (b));
627} 627}
628 628
629#undef silk_min_16 629#undef silk_min_16
630static inline opus_int16 silk_min_16(opus_int16 a, opus_int16 b) 630static OPUS_INLINE opus_int16 silk_min_16(opus_int16 a, opus_int16 b)
631{ 631{
632 ops_count += 1; 632 ops_count += 1;
633 return (((a) < (b)) ? (a) : (b)); 633 return (((a) < (b)) ? (a) : (b));
634} 634}
635#undef silk_min_32 635#undef silk_min_32
636static inline opus_int32 silk_min_32(opus_int32 a, opus_int32 b) 636static OPUS_INLINE opus_int32 silk_min_32(opus_int32 a, opus_int32 b)
637{ 637{
638 ops_count += 1; 638 ops_count += 1;
639 return (((a) < (b)) ? (a) : (b)); 639 return (((a) < (b)) ? (a) : (b));
640} 640}
641#undef silk_min_64 641#undef silk_min_64
642static inline opus_int64 silk_min_64(opus_int64 a, opus_int64 b) 642static OPUS_INLINE opus_int64 silk_min_64(opus_int64 a, opus_int64 b)
643{ 643{
644 ops_count += 1; 644 ops_count += 1;
645 return (((a) < (b)) ? (a) : (b)); 645 return (((a) < (b)) ? (a) : (b));
@@ -647,26 +647,26 @@ static inline opus_int64 silk_min_64(opus_int64 a, opus_int64 b)
647 647
648/* silk_min() versions with typecast in the function call */ 648/* silk_min() versions with typecast in the function call */
649#undef silk_max_int 649#undef silk_max_int
650static inline opus_int silk_max_int(opus_int a, opus_int b) 650static OPUS_INLINE opus_int silk_max_int(opus_int a, opus_int b)
651{ 651{
652 ops_count += 1; 652 ops_count += 1;
653 return (((a) > (b)) ? (a) : (b)); 653 return (((a) > (b)) ? (a) : (b));
654} 654}
655#undef silk_max_16 655#undef silk_max_16
656static inline opus_int16 silk_max_16(opus_int16 a, opus_int16 b) 656static OPUS_INLINE opus_int16 silk_max_16(opus_int16 a, opus_int16 b)
657{ 657{
658 ops_count += 1; 658 ops_count += 1;
659 return (((a) > (b)) ? (a) : (b)); 659 return (((a) > (b)) ? (a) : (b));
660} 660}
661#undef silk_max_32 661#undef silk_max_32
662static inline opus_int32 silk_max_32(opus_int32 a, opus_int32 b) 662static OPUS_INLINE opus_int32 silk_max_32(opus_int32 a, opus_int32 b)
663{ 663{
664 ops_count += 1; 664 ops_count += 1;
665 return (((a) > (b)) ? (a) : (b)); 665 return (((a) > (b)) ? (a) : (b));
666} 666}
667 667
668#undef silk_max_64 668#undef silk_max_64
669static inline opus_int64 silk_max_64(opus_int64 a, opus_int64 b) 669static OPUS_INLINE opus_int64 silk_max_64(opus_int64 a, opus_int64 b)
670{ 670{
671 ops_count += 1; 671 ops_count += 1;
672 return (((a) > (b)) ? (a) : (b)); 672 return (((a) > (b)) ? (a) : (b));
@@ -674,7 +674,7 @@ static inline opus_int64 silk_max_64(opus_int64 a, opus_int64 b)
674 674
675 675
676#undef silk_LIMIT_int 676#undef silk_LIMIT_int
677static inline opus_int silk_LIMIT_int(opus_int a, opus_int limit1, opus_int limit2) 677static OPUS_INLINE opus_int silk_LIMIT_int(opus_int a, opus_int limit1, opus_int limit2)
678{ 678{
679 opus_int ret; 679 opus_int ret;
680 ops_count += 6; 680 ops_count += 6;
@@ -686,7 +686,7 @@ static inline opus_int silk_LIMIT_int(opus_int a, opus_int limit1, opus_int limi
686} 686}
687 687
688#undef silk_LIMIT_16 688#undef silk_LIMIT_16
689static inline opus_int16 silk_LIMIT_16(opus_int16 a, opus_int16 limit1, opus_int16 limit2) 689static OPUS_INLINE opus_int16 silk_LIMIT_16(opus_int16 a, opus_int16 limit1, opus_int16 limit2)
690{ 690{
691 opus_int16 ret; 691 opus_int16 ret;
692 ops_count += 6; 692 ops_count += 6;
@@ -699,7 +699,7 @@ return(ret);
699 699
700 700
701#undef silk_LIMIT_32 701#undef silk_LIMIT_32
702static inline opus_int silk_LIMIT_32(opus_int32 a, opus_int32 limit1, opus_int32 limit2) 702static OPUS_INLINE opus_int silk_LIMIT_32(opus_int32 a, opus_int32 limit1, opus_int32 limit2)
703{ 703{
704 opus_int32 ret; 704 opus_int32 ret;
705 ops_count += 6; 705 ops_count += 6;
diff --git a/lib/rbcodec/codecs/libopus/silk/MacroDebug.h b/lib/rbcodec/codecs/libopus/silk/MacroDebug.h
index d3d84b6caa..35aedc5c5f 100644
--- a/lib/rbcodec/codecs/libopus/silk/MacroDebug.h
+++ b/lib/rbcodec/codecs/libopus/silk/MacroDebug.h
@@ -9,7 +9,7 @@ this list of conditions and the following disclaimer.
9- Redistributions in binary form must reproduce the above copyright 9- Redistributions in binary form must reproduce the above copyright
10notice, this list of conditions and the following disclaimer in the 10notice, this list of conditions and the following disclaimer in the
11documentation and/or other materials provided with the distribution. 11documentation and/or other materials provided with the distribution.
12- Neither the name of Internet Society, IETF or IETF Trust, nor the 12- Neither the name of Internet Society, IETF or IETF Trust, nor the
13names of specific contributors, may be used to endorse or promote 13names of specific contributors, may be used to endorse or promote
14products derived from this software without specific prior written 14products derived from this software without specific prior written
15permission. 15permission.
@@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
36 36
37#undef silk_ADD16 37#undef silk_ADD16
38#define silk_ADD16(a,b) silk_ADD16_((a), (b), __FILE__, __LINE__) 38#define silk_ADD16(a,b) silk_ADD16_((a), (b), __FILE__, __LINE__)
39static inline opus_int16 silk_ADD16_(opus_int16 a, opus_int16 b, char *file, int line){ 39static OPUS_INLINE opus_int16 silk_ADD16_(opus_int16 a, opus_int16 b, char *file, int line){
40 opus_int16 ret; 40 opus_int16 ret;
41 41
42 ret = a + b; 42 ret = a + b;
@@ -52,7 +52,7 @@ static inline opus_int16 silk_ADD16_(opus_int16 a, opus_int16 b, char *file, int
52 52
53#undef silk_ADD32 53#undef silk_ADD32
54#define silk_ADD32(a,b) silk_ADD32_((a), (b), __FILE__, __LINE__) 54#define silk_ADD32(a,b) silk_ADD32_((a), (b), __FILE__, __LINE__)
55static inline opus_int32 silk_ADD32_(opus_int32 a, opus_int32 b, char *file, int line){ 55static OPUS_INLINE opus_int32 silk_ADD32_(opus_int32 a, opus_int32 b, char *file, int line){
56 opus_int32 ret; 56 opus_int32 ret;
57 57
58 ret = a + b; 58 ret = a + b;
@@ -68,7 +68,7 @@ static inline opus_int32 silk_ADD32_(opus_int32 a, opus_int32 b, char *file, int
68 68
69#undef silk_ADD64 69#undef silk_ADD64
70#define silk_ADD64(a,b) silk_ADD64_((a), (b), __FILE__, __LINE__) 70#define silk_ADD64(a,b) silk_ADD64_((a), (b), __FILE__, __LINE__)
71static inline opus_int64 silk_ADD64_(opus_int64 a, opus_int64 b, char *file, int line){ 71static OPUS_INLINE opus_int64 silk_ADD64_(opus_int64 a, opus_int64 b, char *file, int line){
72 opus_int64 ret; 72 opus_int64 ret;
73 73
74 ret = a + b; 74 ret = a + b;
@@ -84,7 +84,7 @@ static inline opus_int64 silk_ADD64_(opus_int64 a, opus_int64 b, char *file, int
84 84
85#undef silk_SUB16 85#undef silk_SUB16
86#define silk_SUB16(a,b) silk_SUB16_((a), (b), __FILE__, __LINE__) 86#define silk_SUB16(a,b) silk_SUB16_((a), (b), __FILE__, __LINE__)
87static inline opus_int16 silk_SUB16_(opus_int16 a, opus_int16 b, char *file, int line){ 87static OPUS_INLINE opus_int16 silk_SUB16_(opus_int16 a, opus_int16 b, char *file, int line){
88 opus_int16 ret; 88 opus_int16 ret;
89 89
90 ret = a - b; 90 ret = a - b;
@@ -100,7 +100,7 @@ static inline opus_int16 silk_SUB16_(opus_int16 a, opus_int16 b, char *file, int
100 100
101#undef silk_SUB32 101#undef silk_SUB32
102#define silk_SUB32(a,b) silk_SUB32_((a), (b), __FILE__, __LINE__) 102#define silk_SUB32(a,b) silk_SUB32_((a), (b), __FILE__, __LINE__)
103static inline opus_int32 silk_SUB32_(opus_int32 a, opus_int32 b, char *file, int line){ 103static OPUS_INLINE opus_int32 silk_SUB32_(opus_int32 a, opus_int32 b, char *file, int line){
104 opus_int32 ret; 104 opus_int32 ret;
105 105
106 ret = a - b; 106 ret = a - b;
@@ -116,7 +116,7 @@ static inline opus_int32 silk_SUB32_(opus_int32 a, opus_int32 b, char *file, int
116 116
117#undef silk_SUB64 117#undef silk_SUB64
118#define silk_SUB64(a,b) silk_SUB64_((a), (b), __FILE__, __LINE__) 118#define silk_SUB64(a,b) silk_SUB64_((a), (b), __FILE__, __LINE__)
119static inline opus_int64 silk_SUB64_(opus_int64 a, opus_int64 b, char *file, int line){ 119static OPUS_INLINE opus_int64 silk_SUB64_(opus_int64 a, opus_int64 b, char *file, int line){
120 opus_int64 ret; 120 opus_int64 ret;
121 121
122 ret = a - b; 122 ret = a - b;
@@ -132,7 +132,7 @@ static inline opus_int64 silk_SUB64_(opus_int64 a, opus_int64 b, char *file, int
132 132
133#undef silk_ADD_SAT16 133#undef silk_ADD_SAT16
134#define silk_ADD_SAT16(a,b) silk_ADD_SAT16_((a), (b), __FILE__, __LINE__) 134#define silk_ADD_SAT16(a,b) silk_ADD_SAT16_((a), (b), __FILE__, __LINE__)
135static inline opus_int16 silk_ADD_SAT16_( opus_int16 a16, opus_int16 b16, char *file, int line) { 135static OPUS_INLINE opus_int16 silk_ADD_SAT16_( opus_int16 a16, opus_int16 b16, char *file, int line) {
136 opus_int16 res; 136 opus_int16 res;
137 res = (opus_int16)silk_SAT16( silk_ADD32( (opus_int32)(a16), (b16) ) ); 137 res = (opus_int16)silk_SAT16( silk_ADD32( (opus_int32)(a16), (b16) ) );
138 if ( res != silk_SAT16( (opus_int32)a16 + (opus_int32)b16 ) ) 138 if ( res != silk_SAT16( (opus_int32)a16 + (opus_int32)b16 ) )
@@ -147,7 +147,7 @@ static inline opus_int16 silk_ADD_SAT16_( opus_int16 a16, opus_int16 b16, char *
147 147
148#undef silk_ADD_SAT32 148#undef silk_ADD_SAT32
149#define silk_ADD_SAT32(a,b) silk_ADD_SAT32_((a), (b), __FILE__, __LINE__) 149#define silk_ADD_SAT32(a,b) silk_ADD_SAT32_((a), (b), __FILE__, __LINE__)
150static inline opus_int32 silk_ADD_SAT32_(opus_int32 a32, opus_int32 b32, char *file, int line){ 150static OPUS_INLINE opus_int32 silk_ADD_SAT32_(opus_int32 a32, opus_int32 b32, char *file, int line){
151 opus_int32 res; 151 opus_int32 res;
152 res = ((((opus_uint32)(a32) + (opus_uint32)(b32)) & 0x80000000) == 0 ? \ 152 res = ((((opus_uint32)(a32) + (opus_uint32)(b32)) & 0x80000000) == 0 ? \
153 ((((a32) & (b32)) & 0x80000000) != 0 ? silk_int32_MIN : (a32)+(b32)) : \ 153 ((((a32) & (b32)) & 0x80000000) != 0 ? silk_int32_MIN : (a32)+(b32)) : \
@@ -164,7 +164,7 @@ static inline opus_int32 silk_ADD_SAT32_(opus_int32 a32, opus_int32 b32, char *f
164 164
165#undef silk_ADD_SAT64 165#undef silk_ADD_SAT64
166#define silk_ADD_SAT64(a,b) silk_ADD_SAT64_((a), (b), __FILE__, __LINE__) 166#define silk_ADD_SAT64(a,b) silk_ADD_SAT64_((a), (b), __FILE__, __LINE__)
167static inline opus_int64 silk_ADD_SAT64_( opus_int64 a64, opus_int64 b64, char *file, int line) { 167static OPUS_INLINE opus_int64 silk_ADD_SAT64_( opus_int64 a64, opus_int64 b64, char *file, int line) {
168 opus_int64 res; 168 opus_int64 res;
169 int fail = 0; 169 int fail = 0;
170 res = ((((a64) + (b64)) & 0x8000000000000000LL) == 0 ? \ 170 res = ((((a64) + (b64)) & 0x8000000000000000LL) == 0 ? \
@@ -193,7 +193,7 @@ static inline opus_int64 silk_ADD_SAT64_( opus_int64 a64, opus_int64 b64, char *
193 193
194#undef silk_SUB_SAT16 194#undef silk_SUB_SAT16
195#define silk_SUB_SAT16(a,b) silk_SUB_SAT16_((a), (b), __FILE__, __LINE__) 195#define silk_SUB_SAT16(a,b) silk_SUB_SAT16_((a), (b), __FILE__, __LINE__)
196static inline opus_int16 silk_SUB_SAT16_( opus_int16 a16, opus_int16 b16, char *file, int line ) { 196static OPUS_INLINE opus_int16 silk_SUB_SAT16_( opus_int16 a16, opus_int16 b16, char *file, int line ) {
197 opus_int16 res; 197 opus_int16 res;
198 res = (opus_int16)silk_SAT16( silk_SUB32( (opus_int32)(a16), (b16) ) ); 198 res = (opus_int16)silk_SAT16( silk_SUB32( (opus_int32)(a16), (b16) ) );
199 if ( res != silk_SAT16( (opus_int32)a16 - (opus_int32)b16 ) ) 199 if ( res != silk_SAT16( (opus_int32)a16 - (opus_int32)b16 ) )
@@ -208,7 +208,7 @@ static inline opus_int16 silk_SUB_SAT16_( opus_int16 a16, opus_int16 b16, char *
208 208
209#undef silk_SUB_SAT32 209#undef silk_SUB_SAT32
210#define silk_SUB_SAT32(a,b) silk_SUB_SAT32_((a), (b), __FILE__, __LINE__) 210#define silk_SUB_SAT32(a,b) silk_SUB_SAT32_((a), (b), __FILE__, __LINE__)
211static inline opus_int32 silk_SUB_SAT32_( opus_int32 a32, opus_int32 b32, char *file, int line ) { 211static OPUS_INLINE opus_int32 silk_SUB_SAT32_( opus_int32 a32, opus_int32 b32, char *file, int line ) {
212 opus_int32 res; 212 opus_int32 res;
213 res = ((((opus_uint32)(a32)-(opus_uint32)(b32)) & 0x80000000) == 0 ? \ 213 res = ((((opus_uint32)(a32)-(opus_uint32)(b32)) & 0x80000000) == 0 ? \
214 (( (a32) & ((b32)^0x80000000) & 0x80000000) ? silk_int32_MIN : (a32)-(b32)) : \ 214 (( (a32) & ((b32)^0x80000000) & 0x80000000) ? silk_int32_MIN : (a32)-(b32)) : \
@@ -225,7 +225,7 @@ static inline opus_int32 silk_SUB_SAT32_( opus_int32 a32, opus_int32 b32, char *
225 225
226#undef silk_SUB_SAT64 226#undef silk_SUB_SAT64
227#define silk_SUB_SAT64(a,b) silk_SUB_SAT64_((a), (b), __FILE__, __LINE__) 227#define silk_SUB_SAT64(a,b) silk_SUB_SAT64_((a), (b), __FILE__, __LINE__)
228static inline opus_int64 silk_SUB_SAT64_( opus_int64 a64, opus_int64 b64, char *file, int line ) { 228static OPUS_INLINE opus_int64 silk_SUB_SAT64_( opus_int64 a64, opus_int64 b64, char *file, int line ) {
229 opus_int64 res; 229 opus_int64 res;
230 int fail = 0; 230 int fail = 0;
231 res = ((((a64)-(b64)) & 0x8000000000000000LL) == 0 ? \ 231 res = ((((a64)-(b64)) & 0x8000000000000000LL) == 0 ? \
@@ -254,7 +254,7 @@ static inline opus_int64 silk_SUB_SAT64_( opus_int64 a64, opus_int64 b64, char *
254 254
255#undef silk_MUL 255#undef silk_MUL
256#define silk_MUL(a,b) silk_MUL_((a), (b), __FILE__, __LINE__) 256#define silk_MUL(a,b) silk_MUL_((a), (b), __FILE__, __LINE__)
257static inline opus_int32 silk_MUL_(opus_int32 a32, opus_int32 b32, char *file, int line){ 257static OPUS_INLINE opus_int32 silk_MUL_(opus_int32 a32, opus_int32 b32, char *file, int line){
258 opus_int32 ret; 258 opus_int32 ret;
259 opus_int64 ret64; 259 opus_int64 ret64;
260 ret = a32 * b32; 260 ret = a32 * b32;
@@ -271,7 +271,7 @@ static inline opus_int32 silk_MUL_(opus_int32 a32, opus_int32 b32, char *file, i
271 271
272#undef silk_MUL_uint 272#undef silk_MUL_uint
273#define silk_MUL_uint(a,b) silk_MUL_uint_((a), (b), __FILE__, __LINE__) 273#define silk_MUL_uint(a,b) silk_MUL_uint_((a), (b), __FILE__, __LINE__)
274static inline opus_uint32 silk_MUL_uint_(opus_uint32 a32, opus_uint32 b32, char *file, int line){ 274static OPUS_INLINE opus_uint32 silk_MUL_uint_(opus_uint32 a32, opus_uint32 b32, char *file, int line){
275 opus_uint32 ret; 275 opus_uint32 ret;
276 ret = a32 * b32; 276 ret = a32 * b32;
277 if ( (opus_uint64)ret != (opus_uint64)a32 * (opus_uint64)b32 ) 277 if ( (opus_uint64)ret != (opus_uint64)a32 * (opus_uint64)b32 )
@@ -286,7 +286,7 @@ static inline opus_uint32 silk_MUL_uint_(opus_uint32 a32, opus_uint32 b32, char
286 286
287#undef silk_MLA 287#undef silk_MLA
288#define silk_MLA(a,b,c) silk_MLA_((a), (b), (c), __FILE__, __LINE__) 288#define silk_MLA(a,b,c) silk_MLA_((a), (b), (c), __FILE__, __LINE__)
289static inline opus_int32 silk_MLA_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){ 289static OPUS_INLINE opus_int32 silk_MLA_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
290 opus_int32 ret; 290 opus_int32 ret;
291 ret = a32 + b32 * c32; 291 ret = a32 + b32 * c32;
292 if ( (opus_int64)ret != (opus_int64)a32 + (opus_int64)b32 * (opus_int64)c32 ) 292 if ( (opus_int64)ret != (opus_int64)a32 + (opus_int64)b32 * (opus_int64)c32 )
@@ -301,7 +301,7 @@ static inline opus_int32 silk_MLA_(opus_int32 a32, opus_int32 b32, opus_int32 c3
301 301
302#undef silk_MLA_uint 302#undef silk_MLA_uint
303#define silk_MLA_uint(a,b,c) silk_MLA_uint_((a), (b), (c), __FILE__, __LINE__) 303#define silk_MLA_uint(a,b,c) silk_MLA_uint_((a), (b), (c), __FILE__, __LINE__)
304static inline opus_int32 silk_MLA_uint_(opus_uint32 a32, opus_uint32 b32, opus_uint32 c32, char *file, int line){ 304static OPUS_INLINE opus_int32 silk_MLA_uint_(opus_uint32 a32, opus_uint32 b32, opus_uint32 c32, char *file, int line){
305 opus_uint32 ret; 305 opus_uint32 ret;
306 ret = a32 + b32 * c32; 306 ret = a32 + b32 * c32;
307 if ( (opus_int64)ret != (opus_int64)a32 + (opus_int64)b32 * (opus_int64)c32 ) 307 if ( (opus_int64)ret != (opus_int64)a32 + (opus_int64)b32 * (opus_int64)c32 )
@@ -316,7 +316,7 @@ static inline opus_int32 silk_MLA_uint_(opus_uint32 a32, opus_uint32 b32, opus_u
316 316
317#undef silk_SMULWB 317#undef silk_SMULWB
318#define silk_SMULWB(a,b) silk_SMULWB_((a), (b), __FILE__, __LINE__) 318#define silk_SMULWB(a,b) silk_SMULWB_((a), (b), __FILE__, __LINE__)
319static inline opus_int32 silk_SMULWB_(opus_int32 a32, opus_int32 b32, char *file, int line){ 319static OPUS_INLINE opus_int32 silk_SMULWB_(opus_int32 a32, opus_int32 b32, char *file, int line){
320 opus_int32 ret; 320 opus_int32 ret;
321 ret = (a32 >> 16) * (opus_int32)((opus_int16)b32) + (((a32 & 0x0000FFFF) * (opus_int32)((opus_int16)b32)) >> 16); 321 ret = (a32 >> 16) * (opus_int32)((opus_int16)b32) + (((a32 & 0x0000FFFF) * (opus_int32)((opus_int16)b32)) >> 16);
322 if ( (opus_int64)ret != ((opus_int64)a32 * (opus_int16)b32) >> 16 ) 322 if ( (opus_int64)ret != ((opus_int64)a32 * (opus_int16)b32) >> 16 )
@@ -331,7 +331,7 @@ static inline opus_int32 silk_SMULWB_(opus_int32 a32, opus_int32 b32, char *file
331 331
332#undef silk_SMLAWB 332#undef silk_SMLAWB
333#define silk_SMLAWB(a,b,c) silk_SMLAWB_((a), (b), (c), __FILE__, __LINE__) 333#define silk_SMLAWB(a,b,c) silk_SMLAWB_((a), (b), (c), __FILE__, __LINE__)
334static inline opus_int32 silk_SMLAWB_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){ 334static OPUS_INLINE opus_int32 silk_SMLAWB_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
335 opus_int32 ret; 335 opus_int32 ret;
336 ret = silk_ADD32( a32, silk_SMULWB( b32, c32 ) ); 336 ret = silk_ADD32( a32, silk_SMULWB( b32, c32 ) );
337 if ( silk_ADD32( a32, silk_SMULWB( b32, c32 ) ) != silk_ADD_SAT32( a32, silk_SMULWB( b32, c32 ) ) ) 337 if ( silk_ADD32( a32, silk_SMULWB( b32, c32 ) ) != silk_ADD_SAT32( a32, silk_SMULWB( b32, c32 ) ) )
@@ -346,7 +346,7 @@ static inline opus_int32 silk_SMLAWB_(opus_int32 a32, opus_int32 b32, opus_int32
346 346
347#undef silk_SMULWT 347#undef silk_SMULWT
348#define silk_SMULWT(a,b) silk_SMULWT_((a), (b), __FILE__, __LINE__) 348#define silk_SMULWT(a,b) silk_SMULWT_((a), (b), __FILE__, __LINE__)
349static inline opus_int32 silk_SMULWT_(opus_int32 a32, opus_int32 b32, char *file, int line){ 349static OPUS_INLINE opus_int32 silk_SMULWT_(opus_int32 a32, opus_int32 b32, char *file, int line){
350 opus_int32 ret; 350 opus_int32 ret;
351 ret = (a32 >> 16) * (b32 >> 16) + (((a32 & 0x0000FFFF) * (b32 >> 16)) >> 16); 351 ret = (a32 >> 16) * (b32 >> 16) + (((a32 & 0x0000FFFF) * (b32 >> 16)) >> 16);
352 if ( (opus_int64)ret != ((opus_int64)a32 * (b32 >> 16)) >> 16 ) 352 if ( (opus_int64)ret != ((opus_int64)a32 * (b32 >> 16)) >> 16 )
@@ -361,7 +361,7 @@ static inline opus_int32 silk_SMULWT_(opus_int32 a32, opus_int32 b32, char *file
361 361
362#undef silk_SMLAWT 362#undef silk_SMLAWT
363#define silk_SMLAWT(a,b,c) silk_SMLAWT_((a), (b), (c), __FILE__, __LINE__) 363#define silk_SMLAWT(a,b,c) silk_SMLAWT_((a), (b), (c), __FILE__, __LINE__)
364static inline opus_int32 silk_SMLAWT_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){ 364static OPUS_INLINE opus_int32 silk_SMLAWT_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
365 opus_int32 ret; 365 opus_int32 ret;
366 ret = a32 + ((b32 >> 16) * (c32 >> 16)) + (((b32 & 0x0000FFFF) * ((c32 >> 16)) >> 16)); 366 ret = a32 + ((b32 >> 16) * (c32 >> 16)) + (((b32 & 0x0000FFFF) * ((c32 >> 16)) >> 16));
367 if ( (opus_int64)ret != (opus_int64)a32 + (((opus_int64)b32 * (c32 >> 16)) >> 16) ) 367 if ( (opus_int64)ret != (opus_int64)a32 + (((opus_int64)b32 * (c32 >> 16)) >> 16) )
@@ -376,7 +376,7 @@ static inline opus_int32 silk_SMLAWT_(opus_int32 a32, opus_int32 b32, opus_int32
376 376
377#undef silk_SMULL 377#undef silk_SMULL
378#define silk_SMULL(a,b) silk_SMULL_((a), (b), __FILE__, __LINE__) 378#define silk_SMULL(a,b) silk_SMULL_((a), (b), __FILE__, __LINE__)
379static inline opus_int64 silk_SMULL_(opus_int64 a64, opus_int64 b64, char *file, int line){ 379static OPUS_INLINE opus_int64 silk_SMULL_(opus_int64 a64, opus_int64 b64, char *file, int line){
380 opus_int64 ret64; 380 opus_int64 ret64;
381 int fail = 0; 381 int fail = 0;
382 ret64 = a64 * b64; 382 ret64 = a64 * b64;
@@ -398,7 +398,7 @@ static inline opus_int64 silk_SMULL_(opus_int64 a64, opus_int64 b64, char *file,
398/* no checking needed for silk_SMULBB */ 398/* no checking needed for silk_SMULBB */
399#undef silk_SMLABB 399#undef silk_SMLABB
400#define silk_SMLABB(a,b,c) silk_SMLABB_((a), (b), (c), __FILE__, __LINE__) 400#define silk_SMLABB(a,b,c) silk_SMLABB_((a), (b), (c), __FILE__, __LINE__)
401static inline opus_int32 silk_SMLABB_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){ 401static OPUS_INLINE opus_int32 silk_SMLABB_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
402 opus_int32 ret; 402 opus_int32 ret;
403 ret = a32 + (opus_int32)((opus_int16)b32) * (opus_int32)((opus_int16)c32); 403 ret = a32 + (opus_int32)((opus_int16)b32) * (opus_int32)((opus_int16)c32);
404 if ( (opus_int64)ret != (opus_int64)a32 + (opus_int64)b32 * (opus_int16)c32 ) 404 if ( (opus_int64)ret != (opus_int64)a32 + (opus_int64)b32 * (opus_int16)c32 )
@@ -414,7 +414,7 @@ static inline opus_int32 silk_SMLABB_(opus_int32 a32, opus_int32 b32, opus_int32
414/* no checking needed for silk_SMULBT */ 414/* no checking needed for silk_SMULBT */
415#undef silk_SMLABT 415#undef silk_SMLABT
416#define silk_SMLABT(a,b,c) silk_SMLABT_((a), (b), (c), __FILE__, __LINE__) 416#define silk_SMLABT(a,b,c) silk_SMLABT_((a), (b), (c), __FILE__, __LINE__)
417static inline opus_int32 silk_SMLABT_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){ 417static OPUS_INLINE opus_int32 silk_SMLABT_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
418 opus_int32 ret; 418 opus_int32 ret;
419 ret = a32 + ((opus_int32)((opus_int16)b32)) * (c32 >> 16); 419 ret = a32 + ((opus_int32)((opus_int16)b32)) * (c32 >> 16);
420 if ( (opus_int64)ret != (opus_int64)a32 + (opus_int64)b32 * (c32 >> 16) ) 420 if ( (opus_int64)ret != (opus_int64)a32 + (opus_int64)b32 * (c32 >> 16) )
@@ -430,7 +430,7 @@ static inline opus_int32 silk_SMLABT_(opus_int32 a32, opus_int32 b32, opus_int32
430/* no checking needed for silk_SMULTT */ 430/* no checking needed for silk_SMULTT */
431#undef silk_SMLATT 431#undef silk_SMLATT
432#define silk_SMLATT(a,b,c) silk_SMLATT_((a), (b), (c), __FILE__, __LINE__) 432#define silk_SMLATT(a,b,c) silk_SMLATT_((a), (b), (c), __FILE__, __LINE__)
433static inline opus_int32 silk_SMLATT_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){ 433static OPUS_INLINE opus_int32 silk_SMLATT_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
434 opus_int32 ret; 434 opus_int32 ret;
435 ret = a32 + (b32 >> 16) * (c32 >> 16); 435 ret = a32 + (b32 >> 16) * (c32 >> 16);
436 if ( (opus_int64)ret != (opus_int64)a32 + (b32 >> 16) * (c32 >> 16) ) 436 if ( (opus_int64)ret != (opus_int64)a32 + (b32 >> 16) * (c32 >> 16) )
@@ -445,7 +445,7 @@ static inline opus_int32 silk_SMLATT_(opus_int32 a32, opus_int32 b32, opus_int32
445 445
446#undef silk_SMULWW 446#undef silk_SMULWW
447#define silk_SMULWW(a,b) silk_SMULWW_((a), (b), __FILE__, __LINE__) 447#define silk_SMULWW(a,b) silk_SMULWW_((a), (b), __FILE__, __LINE__)
448static inline opus_int32 silk_SMULWW_(opus_int32 a32, opus_int32 b32, char *file, int line){ 448static OPUS_INLINE opus_int32 silk_SMULWW_(opus_int32 a32, opus_int32 b32, char *file, int line){
449 opus_int32 ret, tmp1, tmp2; 449 opus_int32 ret, tmp1, tmp2;
450 opus_int64 ret64; 450 opus_int64 ret64;
451 int fail = 0; 451 int fail = 0;
@@ -476,7 +476,7 @@ static inline opus_int32 silk_SMULWW_(opus_int32 a32, opus_int32 b32, char *file
476 476
477#undef silk_SMLAWW 477#undef silk_SMLAWW
478#define silk_SMLAWW(a,b,c) silk_SMLAWW_((a), (b), (c), __FILE__, __LINE__) 478#define silk_SMLAWW(a,b,c) silk_SMLAWW_((a), (b), (c), __FILE__, __LINE__)
479static inline opus_int32 silk_SMLAWW_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){ 479static OPUS_INLINE opus_int32 silk_SMLAWW_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
480 opus_int32 ret, tmp; 480 opus_int32 ret, tmp;
481 481
482 tmp = silk_SMULWW( b32, c32 ); 482 tmp = silk_SMULWW( b32, c32 );
@@ -505,7 +505,7 @@ static inline opus_int32 silk_SMLAWW_(opus_int32 a32, opus_int32 b32, opus_int32
505 505
506#undef silk_DIV32 506#undef silk_DIV32
507#define silk_DIV32(a,b) silk_DIV32_((a), (b), __FILE__, __LINE__) 507#define silk_DIV32(a,b) silk_DIV32_((a), (b), __FILE__, __LINE__)
508static inline opus_int32 silk_DIV32_(opus_int32 a32, opus_int32 b32, char *file, int line){ 508static OPUS_INLINE opus_int32 silk_DIV32_(opus_int32 a32, opus_int32 b32, char *file, int line){
509 if ( b32 == 0 ) 509 if ( b32 == 0 )
510 { 510 {
511 fprintf (stderr, "silk_DIV32(%d, %d) in %s: line %d\n", a32, b32, file, line); 511 fprintf (stderr, "silk_DIV32(%d, %d) in %s: line %d\n", a32, b32, file, line);
@@ -518,7 +518,7 @@ static inline opus_int32 silk_DIV32_(opus_int32 a32, opus_int32 b32, char *file,
518 518
519#undef silk_DIV32_16 519#undef silk_DIV32_16
520#define silk_DIV32_16(a,b) silk_DIV32_16_((a), (b), __FILE__, __LINE__) 520#define silk_DIV32_16(a,b) silk_DIV32_16_((a), (b), __FILE__, __LINE__)
521static inline opus_int32 silk_DIV32_16_(opus_int32 a32, opus_int32 b32, char *file, int line){ 521static OPUS_INLINE opus_int32 silk_DIV32_16_(opus_int32 a32, opus_int32 b32, char *file, int line){
522 int fail = 0; 522 int fail = 0;
523 fail |= b32 == 0; 523 fail |= b32 == 0;
524 fail |= b32 > silk_int16_MAX; 524 fail |= b32 > silk_int16_MAX;
@@ -544,7 +544,7 @@ static inline opus_int32 silk_DIV32_16_(opus_int32 a32, opus_int32 b32, char *fi
544 544
545#undef silk_LSHIFT8 545#undef silk_LSHIFT8
546#define silk_LSHIFT8(a,b) silk_LSHIFT8_((a), (b), __FILE__, __LINE__) 546#define silk_LSHIFT8(a,b) silk_LSHIFT8_((a), (b), __FILE__, __LINE__)
547static inline opus_int8 silk_LSHIFT8_(opus_int8 a, opus_int32 shift, char *file, int line){ 547static OPUS_INLINE opus_int8 silk_LSHIFT8_(opus_int8 a, opus_int32 shift, char *file, int line){
548 opus_int8 ret; 548 opus_int8 ret;
549 int fail = 0; 549 int fail = 0;
550 ret = a << shift; 550 ret = a << shift;
@@ -563,7 +563,7 @@ static inline opus_int8 silk_LSHIFT8_(opus_int8 a, opus_int32 shift, char *file,
563 563
564#undef silk_LSHIFT16 564#undef silk_LSHIFT16
565#define silk_LSHIFT16(a,b) silk_LSHIFT16_((a), (b), __FILE__, __LINE__) 565#define silk_LSHIFT16(a,b) silk_LSHIFT16_((a), (b), __FILE__, __LINE__)
566static inline opus_int16 silk_LSHIFT16_(opus_int16 a, opus_int32 shift, char *file, int line){ 566static OPUS_INLINE opus_int16 silk_LSHIFT16_(opus_int16 a, opus_int32 shift, char *file, int line){
567 opus_int16 ret; 567 opus_int16 ret;
568 int fail = 0; 568 int fail = 0;
569 ret = a << shift; 569 ret = a << shift;
@@ -582,7 +582,7 @@ static inline opus_int16 silk_LSHIFT16_(opus_int16 a, opus_int32 shift, char *fi
582 582
583#undef silk_LSHIFT32 583#undef silk_LSHIFT32
584#define silk_LSHIFT32(a,b) silk_LSHIFT32_((a), (b), __FILE__, __LINE__) 584#define silk_LSHIFT32(a,b) silk_LSHIFT32_((a), (b), __FILE__, __LINE__)
585static inline opus_int32 silk_LSHIFT32_(opus_int32 a, opus_int32 shift, char *file, int line){ 585static OPUS_INLINE opus_int32 silk_LSHIFT32_(opus_int32 a, opus_int32 shift, char *file, int line){
586 opus_int32 ret; 586 opus_int32 ret;
587 int fail = 0; 587 int fail = 0;
588 ret = a << shift; 588 ret = a << shift;
@@ -601,7 +601,7 @@ static inline opus_int32 silk_LSHIFT32_(opus_int32 a, opus_int32 shift, char *fi
601 601
602#undef silk_LSHIFT64 602#undef silk_LSHIFT64
603#define silk_LSHIFT64(a,b) silk_LSHIFT64_((a), (b), __FILE__, __LINE__) 603#define silk_LSHIFT64(a,b) silk_LSHIFT64_((a), (b), __FILE__, __LINE__)
604static inline opus_int64 silk_LSHIFT64_(opus_int64 a, opus_int shift, char *file, int line){ 604static OPUS_INLINE opus_int64 silk_LSHIFT64_(opus_int64 a, opus_int shift, char *file, int line){
605 opus_int64 ret; 605 opus_int64 ret;
606 int fail = 0; 606 int fail = 0;
607 ret = a << shift; 607 ret = a << shift;
@@ -620,7 +620,7 @@ static inline opus_int64 silk_LSHIFT64_(opus_int64 a, opus_int shift, char *file
620 620
621#undef silk_LSHIFT_ovflw 621#undef silk_LSHIFT_ovflw
622#define silk_LSHIFT_ovflw(a,b) silk_LSHIFT_ovflw_((a), (b), __FILE__, __LINE__) 622#define silk_LSHIFT_ovflw(a,b) silk_LSHIFT_ovflw_((a), (b), __FILE__, __LINE__)
623static inline opus_int32 silk_LSHIFT_ovflw_(opus_int32 a, opus_int32 shift, char *file, int line){ 623static OPUS_INLINE opus_int32 silk_LSHIFT_ovflw_(opus_int32 a, opus_int32 shift, char *file, int line){
624 if ( (shift < 0) || (shift >= 32) ) /* no check for overflow */ 624 if ( (shift < 0) || (shift >= 32) ) /* no check for overflow */
625 { 625 {
626 fprintf (stderr, "silk_LSHIFT_ovflw(%d, %d) in %s: line %d\n", a, shift, file, line); 626 fprintf (stderr, "silk_LSHIFT_ovflw(%d, %d) in %s: line %d\n", a, shift, file, line);
@@ -633,7 +633,7 @@ static inline opus_int32 silk_LSHIFT_ovflw_(opus_int32 a, opus_int32 shift, char
633 633
634#undef silk_LSHIFT_uint 634#undef silk_LSHIFT_uint
635#define silk_LSHIFT_uint(a,b) silk_LSHIFT_uint_((a), (b), __FILE__, __LINE__) 635#define silk_LSHIFT_uint(a,b) silk_LSHIFT_uint_((a), (b), __FILE__, __LINE__)
636static inline opus_uint32 silk_LSHIFT_uint_(opus_uint32 a, opus_int32 shift, char *file, int line){ 636static OPUS_INLINE opus_uint32 silk_LSHIFT_uint_(opus_uint32 a, opus_int32 shift, char *file, int line){
637 opus_uint32 ret; 637 opus_uint32 ret;
638 ret = a << shift; 638 ret = a << shift;
639 if ( (shift < 0) || ((opus_int64)ret != ((opus_int64)a) << shift)) 639 if ( (shift < 0) || ((opus_int64)ret != ((opus_int64)a) << shift))
@@ -648,7 +648,7 @@ static inline opus_uint32 silk_LSHIFT_uint_(opus_uint32 a, opus_int32 shift, cha
648 648
649#undef silk_RSHIFT8 649#undef silk_RSHIFT8
650#define silk_RSHITF8(a,b) silk_RSHIFT8_((a), (b), __FILE__, __LINE__) 650#define silk_RSHITF8(a,b) silk_RSHIFT8_((a), (b), __FILE__, __LINE__)
651static inline opus_int8 silk_RSHIFT8_(opus_int8 a, opus_int32 shift, char *file, int line){ 651static OPUS_INLINE opus_int8 silk_RSHIFT8_(opus_int8 a, opus_int32 shift, char *file, int line){
652 if ( (shift < 0) || (shift>=8) ) 652 if ( (shift < 0) || (shift>=8) )
653 { 653 {
654 fprintf (stderr, "silk_RSHITF8(%d, %d) in %s: line %d\n", a, shift, file, line); 654 fprintf (stderr, "silk_RSHITF8(%d, %d) in %s: line %d\n", a, shift, file, line);
@@ -661,7 +661,7 @@ static inline opus_int8 silk_RSHIFT8_(opus_int8 a, opus_int32 shift, char *file,
661 661
662#undef silk_RSHIFT16 662#undef silk_RSHIFT16
663#define silk_RSHITF16(a,b) silk_RSHIFT16_((a), (b), __FILE__, __LINE__) 663#define silk_RSHITF16(a,b) silk_RSHIFT16_((a), (b), __FILE__, __LINE__)
664static inline opus_int16 silk_RSHIFT16_(opus_int16 a, opus_int32 shift, char *file, int line){ 664static OPUS_INLINE opus_int16 silk_RSHIFT16_(opus_int16 a, opus_int32 shift, char *file, int line){
665 if ( (shift < 0) || (shift>=16) ) 665 if ( (shift < 0) || (shift>=16) )
666 { 666 {
667 fprintf (stderr, "silk_RSHITF16(%d, %d) in %s: line %d\n", a, shift, file, line); 667 fprintf (stderr, "silk_RSHITF16(%d, %d) in %s: line %d\n", a, shift, file, line);
@@ -674,7 +674,7 @@ static inline opus_int16 silk_RSHIFT16_(opus_int16 a, opus_int32 shift, char *fi
674 674
675#undef silk_RSHIFT32 675#undef silk_RSHIFT32
676#define silk_RSHIFT32(a,b) silk_RSHIFT32_((a), (b), __FILE__, __LINE__) 676#define silk_RSHIFT32(a,b) silk_RSHIFT32_((a), (b), __FILE__, __LINE__)
677static inline opus_int32 silk_RSHIFT32_(opus_int32 a, opus_int32 shift, char *file, int line){ 677static OPUS_INLINE opus_int32 silk_RSHIFT32_(opus_int32 a, opus_int32 shift, char *file, int line){
678 if ( (shift < 0) || (shift>=32) ) 678 if ( (shift < 0) || (shift>=32) )
679 { 679 {
680 fprintf (stderr, "silk_RSHITF32(%d, %d) in %s: line %d\n", a, shift, file, line); 680 fprintf (stderr, "silk_RSHITF32(%d, %d) in %s: line %d\n", a, shift, file, line);
@@ -687,7 +687,7 @@ static inline opus_int32 silk_RSHIFT32_(opus_int32 a, opus_int32 shift, char *fi
687 687
688#undef silk_RSHIFT64 688#undef silk_RSHIFT64
689#define silk_RSHIFT64(a,b) silk_RSHIFT64_((a), (b), __FILE__, __LINE__) 689#define silk_RSHIFT64(a,b) silk_RSHIFT64_((a), (b), __FILE__, __LINE__)
690static inline opus_int64 silk_RSHIFT64_(opus_int64 a, opus_int64 shift, char *file, int line){ 690static OPUS_INLINE opus_int64 silk_RSHIFT64_(opus_int64 a, opus_int64 shift, char *file, int line){
691 if ( (shift < 0) || (shift>=64) ) 691 if ( (shift < 0) || (shift>=64) )
692 { 692 {
693 fprintf (stderr, "silk_RSHITF64(%lld, %lld) in %s: line %d\n", (long long)a, (long long)shift, file, line); 693 fprintf (stderr, "silk_RSHITF64(%lld, %lld) in %s: line %d\n", (long long)a, (long long)shift, file, line);
@@ -700,7 +700,7 @@ static inline opus_int64 silk_RSHIFT64_(opus_int64 a, opus_int64 shift, char *fi
700 700
701#undef silk_RSHIFT_uint 701#undef silk_RSHIFT_uint
702#define silk_RSHIFT_uint(a,b) silk_RSHIFT_uint_((a), (b), __FILE__, __LINE__) 702#define silk_RSHIFT_uint(a,b) silk_RSHIFT_uint_((a), (b), __FILE__, __LINE__)
703static inline opus_uint32 silk_RSHIFT_uint_(opus_uint32 a, opus_int32 shift, char *file, int line){ 703static OPUS_INLINE opus_uint32 silk_RSHIFT_uint_(opus_uint32 a, opus_int32 shift, char *file, int line){
704 if ( (shift < 0) || (shift>32) ) 704 if ( (shift < 0) || (shift>32) )
705 { 705 {
706 fprintf (stderr, "silk_RSHIFT_uint(%u, %d) in %s: line %d\n", a, shift, file, line); 706 fprintf (stderr, "silk_RSHIFT_uint(%u, %d) in %s: line %d\n", a, shift, file, line);
@@ -713,7 +713,7 @@ static inline opus_uint32 silk_RSHIFT_uint_(opus_uint32 a, opus_int32 shift, cha
713 713
714#undef silk_ADD_LSHIFT 714#undef silk_ADD_LSHIFT
715#define silk_ADD_LSHIFT(a,b,c) silk_ADD_LSHIFT_((a), (b), (c), __FILE__, __LINE__) 715#define silk_ADD_LSHIFT(a,b,c) silk_ADD_LSHIFT_((a), (b), (c), __FILE__, __LINE__)
716static inline int silk_ADD_LSHIFT_(int a, int b, int shift, char *file, int line){ 716static OPUS_INLINE int silk_ADD_LSHIFT_(int a, int b, int shift, char *file, int line){
717 opus_int16 ret; 717 opus_int16 ret;
718 ret = a + (b << shift); 718 ret = a + (b << shift);
719 if ( (shift < 0) || (shift>15) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) << shift)) ) 719 if ( (shift < 0) || (shift>15) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) << shift)) )
@@ -728,7 +728,7 @@ static inline int silk_ADD_LSHIFT_(int a, int b, int shift, char *file, int line
728 728
729#undef silk_ADD_LSHIFT32 729#undef silk_ADD_LSHIFT32
730#define silk_ADD_LSHIFT32(a,b,c) silk_ADD_LSHIFT32_((a), (b), (c), __FILE__, __LINE__) 730#define silk_ADD_LSHIFT32(a,b,c) silk_ADD_LSHIFT32_((a), (b), (c), __FILE__, __LINE__)
731static inline opus_int32 silk_ADD_LSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){ 731static OPUS_INLINE opus_int32 silk_ADD_LSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){
732 opus_int32 ret; 732 opus_int32 ret;
733 ret = a + (b << shift); 733 ret = a + (b << shift);
734 if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) << shift)) ) 734 if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) << shift)) )
@@ -743,7 +743,7 @@ static inline opus_int32 silk_ADD_LSHIFT32_(opus_int32 a, opus_int32 b, opus_int
743 743
744#undef silk_ADD_LSHIFT_uint 744#undef silk_ADD_LSHIFT_uint
745#define silk_ADD_LSHIFT_uint(a,b,c) silk_ADD_LSHIFT_uint_((a), (b), (c), __FILE__, __LINE__) 745#define silk_ADD_LSHIFT_uint(a,b,c) silk_ADD_LSHIFT_uint_((a), (b), (c), __FILE__, __LINE__)
746static inline opus_uint32 silk_ADD_LSHIFT_uint_(opus_uint32 a, opus_uint32 b, opus_int32 shift, char *file, int line){ 746static OPUS_INLINE opus_uint32 silk_ADD_LSHIFT_uint_(opus_uint32 a, opus_uint32 b, opus_int32 shift, char *file, int line){
747 opus_uint32 ret; 747 opus_uint32 ret;
748 ret = a + (b << shift); 748 ret = a + (b << shift);
749 if ( (shift < 0) || (shift>32) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) << shift)) ) 749 if ( (shift < 0) || (shift>32) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) << shift)) )
@@ -758,7 +758,7 @@ static inline opus_uint32 silk_ADD_LSHIFT_uint_(opus_uint32 a, opus_uint32 b, op
758 758
759#undef silk_ADD_RSHIFT 759#undef silk_ADD_RSHIFT
760#define silk_ADD_RSHIFT(a,b,c) silk_ADD_RSHIFT_((a), (b), (c), __FILE__, __LINE__) 760#define silk_ADD_RSHIFT(a,b,c) silk_ADD_RSHIFT_((a), (b), (c), __FILE__, __LINE__)
761static inline int silk_ADD_RSHIFT_(int a, int b, int shift, char *file, int line){ 761static OPUS_INLINE int silk_ADD_RSHIFT_(int a, int b, int shift, char *file, int line){
762 opus_int16 ret; 762 opus_int16 ret;
763 ret = a + (b >> shift); 763 ret = a + (b >> shift);
764 if ( (shift < 0) || (shift>15) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) >> shift)) ) 764 if ( (shift < 0) || (shift>15) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) >> shift)) )
@@ -773,7 +773,7 @@ static inline int silk_ADD_RSHIFT_(int a, int b, int shift, char *file, int line
773 773
774#undef silk_ADD_RSHIFT32 774#undef silk_ADD_RSHIFT32
775#define silk_ADD_RSHIFT32(a,b,c) silk_ADD_RSHIFT32_((a), (b), (c), __FILE__, __LINE__) 775#define silk_ADD_RSHIFT32(a,b,c) silk_ADD_RSHIFT32_((a), (b), (c), __FILE__, __LINE__)
776static inline opus_int32 silk_ADD_RSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){ 776static OPUS_INLINE opus_int32 silk_ADD_RSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){
777 opus_int32 ret; 777 opus_int32 ret;
778 ret = a + (b >> shift); 778 ret = a + (b >> shift);
779 if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) >> shift)) ) 779 if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) >> shift)) )
@@ -788,7 +788,7 @@ static inline opus_int32 silk_ADD_RSHIFT32_(opus_int32 a, opus_int32 b, opus_int
788 788
789#undef silk_ADD_RSHIFT_uint 789#undef silk_ADD_RSHIFT_uint
790#define silk_ADD_RSHIFT_uint(a,b,c) silk_ADD_RSHIFT_uint_((a), (b), (c), __FILE__, __LINE__) 790#define silk_ADD_RSHIFT_uint(a,b,c) silk_ADD_RSHIFT_uint_((a), (b), (c), __FILE__, __LINE__)
791static inline opus_uint32 silk_ADD_RSHIFT_uint_(opus_uint32 a, opus_uint32 b, opus_int32 shift, char *file, int line){ 791static OPUS_INLINE opus_uint32 silk_ADD_RSHIFT_uint_(opus_uint32 a, opus_uint32 b, opus_int32 shift, char *file, int line){
792 opus_uint32 ret; 792 opus_uint32 ret;
793 ret = a + (b >> shift); 793 ret = a + (b >> shift);
794 if ( (shift < 0) || (shift>32) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) >> shift)) ) 794 if ( (shift < 0) || (shift>32) || ((opus_int64)ret != (opus_int64)a + (((opus_int64)b) >> shift)) )
@@ -803,7 +803,7 @@ static inline opus_uint32 silk_ADD_RSHIFT_uint_(opus_uint32 a, opus_uint32 b, op
803 803
804#undef silk_SUB_LSHIFT32 804#undef silk_SUB_LSHIFT32
805#define silk_SUB_LSHIFT32(a,b,c) silk_SUB_LSHIFT32_((a), (b), (c), __FILE__, __LINE__) 805#define silk_SUB_LSHIFT32(a,b,c) silk_SUB_LSHIFT32_((a), (b), (c), __FILE__, __LINE__)
806static inline opus_int32 silk_SUB_LSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){ 806static OPUS_INLINE opus_int32 silk_SUB_LSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){
807 opus_int32 ret; 807 opus_int32 ret;
808 ret = a - (b << shift); 808 ret = a - (b << shift);
809 if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a - (((opus_int64)b) << shift)) ) 809 if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a - (((opus_int64)b) << shift)) )
@@ -818,7 +818,7 @@ static inline opus_int32 silk_SUB_LSHIFT32_(opus_int32 a, opus_int32 b, opus_int
818 818
819#undef silk_SUB_RSHIFT32 819#undef silk_SUB_RSHIFT32
820#define silk_SUB_RSHIFT32(a,b,c) silk_SUB_RSHIFT32_((a), (b), (c), __FILE__, __LINE__) 820#define silk_SUB_RSHIFT32(a,b,c) silk_SUB_RSHIFT32_((a), (b), (c), __FILE__, __LINE__)
821static inline opus_int32 silk_SUB_RSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){ 821static OPUS_INLINE opus_int32 silk_SUB_RSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){
822 opus_int32 ret; 822 opus_int32 ret;
823 ret = a - (b >> shift); 823 ret = a - (b >> shift);
824 if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a - (((opus_int64)b) >> shift)) ) 824 if ( (shift < 0) || (shift>31) || ((opus_int64)ret != (opus_int64)a - (((opus_int64)b) >> shift)) )
@@ -833,7 +833,7 @@ static inline opus_int32 silk_SUB_RSHIFT32_(opus_int32 a, opus_int32 b, opus_int
833 833
834#undef silk_RSHIFT_ROUND 834#undef silk_RSHIFT_ROUND
835#define silk_RSHIFT_ROUND(a,b) silk_RSHIFT_ROUND_((a), (b), __FILE__, __LINE__) 835#define silk_RSHIFT_ROUND(a,b) silk_RSHIFT_ROUND_((a), (b), __FILE__, __LINE__)
836static inline opus_int32 silk_RSHIFT_ROUND_(opus_int32 a, opus_int32 shift, char *file, int line){ 836static OPUS_INLINE opus_int32 silk_RSHIFT_ROUND_(opus_int32 a, opus_int32 shift, char *file, int line){
837 opus_int32 ret; 837 opus_int32 ret;
838 ret = shift == 1 ? (a >> 1) + (a & 1) : ((a >> (shift - 1)) + 1) >> 1; 838 ret = shift == 1 ? (a >> 1) + (a & 1) : ((a >> (shift - 1)) + 1) >> 1;
839 /* the marco definition can't handle a shift of zero */ 839 /* the marco definition can't handle a shift of zero */
@@ -849,7 +849,7 @@ static inline opus_int32 silk_RSHIFT_ROUND_(opus_int32 a, opus_int32 shift, char
849 849
850#undef silk_RSHIFT_ROUND64 850#undef silk_RSHIFT_ROUND64
851#define silk_RSHIFT_ROUND64(a,b) silk_RSHIFT_ROUND64_((a), (b), __FILE__, __LINE__) 851#define silk_RSHIFT_ROUND64(a,b) silk_RSHIFT_ROUND64_((a), (b), __FILE__, __LINE__)
852static inline opus_int64 silk_RSHIFT_ROUND64_(opus_int64 a, opus_int32 shift, char *file, int line){ 852static OPUS_INLINE opus_int64 silk_RSHIFT_ROUND64_(opus_int64 a, opus_int32 shift, char *file, int line){
853 opus_int64 ret; 853 opus_int64 ret;
854 /* the marco definition can't handle a shift of zero */ 854 /* the marco definition can't handle a shift of zero */
855 if ( (shift <= 0) || (shift>=64) ) 855 if ( (shift <= 0) || (shift>=64) )
@@ -865,14 +865,14 @@ static inline opus_int64 silk_RSHIFT_ROUND64_(opus_int64 a, opus_int32 shift, ch
865 865
866/* silk_abs is used on floats also, so doesn't work... */ 866/* silk_abs is used on floats also, so doesn't work... */
867/*#undef silk_abs 867/*#undef silk_abs
868static inline opus_int32 silk_abs(opus_int32 a){ 868static OPUS_INLINE opus_int32 silk_abs(opus_int32 a){
869 silk_assert(a != 0x80000000); 869 silk_assert(a != 0x80000000);
870 return (((a) > 0) ? (a) : -(a)); // Be careful, silk_abs returns wrong when input equals to silk_intXX_MIN 870 return (((a) > 0) ? (a) : -(a)); // Be careful, silk_abs returns wrong when input equals to silk_intXX_MIN
871}*/ 871}*/
872 872
873#undef silk_abs_int64 873#undef silk_abs_int64
874#define silk_abs_int64(a) silk_abs_int64_((a), __FILE__, __LINE__) 874#define silk_abs_int64(a) silk_abs_int64_((a), __FILE__, __LINE__)
875static inline opus_int64 silk_abs_int64_(opus_int64 a, char *file, int line){ 875static OPUS_INLINE opus_int64 silk_abs_int64_(opus_int64 a, char *file, int line){
876 if ( a == silk_int64_MIN ) 876 if ( a == silk_int64_MIN )
877 { 877 {
878 fprintf (stderr, "silk_abs_int64(%lld) in %s: line %d\n", (long long)a, file, line); 878 fprintf (stderr, "silk_abs_int64(%lld) in %s: line %d\n", (long long)a, file, line);
@@ -885,7 +885,7 @@ static inline opus_int64 silk_abs_int64_(opus_int64 a, char *file, int line){
885 885
886#undef silk_abs_int32 886#undef silk_abs_int32
887#define silk_abs_int32(a) silk_abs_int32_((a), __FILE__, __LINE__) 887#define silk_abs_int32(a) silk_abs_int32_((a), __FILE__, __LINE__)
888static inline opus_int32 silk_abs_int32_(opus_int32 a, char *file, int line){ 888static OPUS_INLINE opus_int32 silk_abs_int32_(opus_int32 a, char *file, int line){
889 if ( a == silk_int32_MIN ) 889 if ( a == silk_int32_MIN )
890 { 890 {
891 fprintf (stderr, "silk_abs_int32(%d) in %s: line %d\n", a, file, line); 891 fprintf (stderr, "silk_abs_int32(%d) in %s: line %d\n", a, file, line);
@@ -898,7 +898,7 @@ static inline opus_int32 silk_abs_int32_(opus_int32 a, char *file, int line){
898 898
899#undef silk_CHECK_FIT8 899#undef silk_CHECK_FIT8
900#define silk_CHECK_FIT8(a) silk_CHECK_FIT8_((a), __FILE__, __LINE__) 900#define silk_CHECK_FIT8(a) silk_CHECK_FIT8_((a), __FILE__, __LINE__)
901static inline opus_int8 silk_CHECK_FIT8_( opus_int64 a, char *file, int line ){ 901static OPUS_INLINE opus_int8 silk_CHECK_FIT8_( opus_int64 a, char *file, int line ){
902 opus_int8 ret; 902 opus_int8 ret;
903 ret = (opus_int8)a; 903 ret = (opus_int8)a;
904 if ( (opus_int64)ret != a ) 904 if ( (opus_int64)ret != a )
@@ -913,7 +913,7 @@ static inline opus_int8 silk_CHECK_FIT8_( opus_int64 a, char *file, int line ){
913 913
914#undef silk_CHECK_FIT16 914#undef silk_CHECK_FIT16
915#define silk_CHECK_FIT16(a) silk_CHECK_FIT16_((a), __FILE__, __LINE__) 915#define silk_CHECK_FIT16(a) silk_CHECK_FIT16_((a), __FILE__, __LINE__)
916static inline opus_int16 silk_CHECK_FIT16_( opus_int64 a, char *file, int line ){ 916static OPUS_INLINE opus_int16 silk_CHECK_FIT16_( opus_int64 a, char *file, int line ){
917 opus_int16 ret; 917 opus_int16 ret;
918 ret = (opus_int16)a; 918 ret = (opus_int16)a;
919 if ( (opus_int64)ret != a ) 919 if ( (opus_int64)ret != a )
@@ -928,7 +928,7 @@ static inline opus_int16 silk_CHECK_FIT16_( opus_int64 a, char *file, int line )
928 928
929#undef silk_CHECK_FIT32 929#undef silk_CHECK_FIT32
930#define silk_CHECK_FIT32(a) silk_CHECK_FIT32_((a), __FILE__, __LINE__) 930#define silk_CHECK_FIT32(a) silk_CHECK_FIT32_((a), __FILE__, __LINE__)
931static inline opus_int32 silk_CHECK_FIT32_( opus_int64 a, char *file, int line ){ 931static OPUS_INLINE opus_int32 silk_CHECK_FIT32_( opus_int64 a, char *file, int line ){
932 opus_int32 ret; 932 opus_int32 ret;
933 ret = (opus_int32)a; 933 ret = (opus_int32)a;
934 if ( (opus_int64)ret != a ) 934 if ( (opus_int64)ret != a )
diff --git a/lib/rbcodec/codecs/libopus/silk/NLSF2A.c b/lib/rbcodec/codecs/libopus/silk/NLSF2A.c
index f9a09b0d5f..b1c559ea68 100644
--- a/lib/rbcodec/codecs/libopus/silk/NLSF2A.c
+++ b/lib/rbcodec/codecs/libopus/silk/NLSF2A.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -41,7 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
41#define QA 16 41#define QA 16
42 42
43/* helper function for NLSF2A(..) */ 43/* helper function for NLSF2A(..) */
44static inline void silk_NLSF2A_find_poly( 44static OPUS_INLINE void silk_NLSF2A_find_poly(
45 opus_int32 *out, /* O intermediate polynomial, QA [dd+1] */ 45 opus_int32 *out, /* O intermediate polynomial, QA [dd+1] */
46 const opus_int32 *cLSF, /* I vector of interleaved 2*cos(LSFs), QA [d] */ 46 const opus_int32 *cLSF, /* I vector of interleaved 2*cos(LSFs), QA [d] */
47 opus_int dd /* I polynomial order (= 1/2 * filter order) */ 47 opus_int dd /* I polynomial order (= 1/2 * filter order) */
diff --git a/lib/rbcodec/codecs/libopus/silk/NLSF_VQ_weights_laroia.c b/lib/rbcodec/codecs/libopus/silk/NLSF_VQ_weights_laroia.c
index bd5f52d2b3..04894c59ab 100644
--- a/lib/rbcodec/codecs/libopus/silk/NLSF_VQ_weights_laroia.c
+++ b/lib/rbcodec/codecs/libopus/silk/NLSF_VQ_weights_laroia.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/NLSF_decode.c b/lib/rbcodec/codecs/libopus/silk/NLSF_decode.c
index 5845c37452..9f715060b8 100644
--- a/lib/rbcodec/codecs/libopus/silk/NLSF_decode.c
+++ b/lib/rbcodec/codecs/libopus/silk/NLSF_decode.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
32#include "main.h" 32#include "main.h"
33 33
34/* Predictive dequantizer for NLSF residuals */ 34/* Predictive dequantizer for NLSF residuals */
35static inline void silk_NLSF_residual_dequant( /* O Returns RD value in Q30 */ 35static OPUS_INLINE void silk_NLSF_residual_dequant( /* O Returns RD value in Q30 */
36 opus_int16 x_Q10[], /* O Output [ order ] */ 36 opus_int16 x_Q10[], /* O Output [ order ] */
37 const opus_int8 indices[], /* I Quantization indices [ order ] */ 37 const opus_int8 indices[], /* I Quantization indices [ order ] */
38 const opus_uint8 pred_coef_Q8[], /* I Backward predictor coefs [ order ] */ 38 const opus_uint8 pred_coef_Q8[], /* I Backward predictor coefs [ order ] */
diff --git a/lib/rbcodec/codecs/libopus/silk/NLSF_stabilize.c b/lib/rbcodec/codecs/libopus/silk/NLSF_stabilize.c
index e732992282..1fa1ea379b 100644
--- a/lib/rbcodec/codecs/libopus/silk/NLSF_stabilize.c
+++ b/lib/rbcodec/codecs/libopus/silk/NLSF_stabilize.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/NLSF_unpack.c b/lib/rbcodec/codecs/libopus/silk/NLSF_unpack.c
index d84eb8121d..17bd23f752 100644
--- a/lib/rbcodec/codecs/libopus/silk/NLSF_unpack.c
+++ b/lib/rbcodec/codecs/libopus/silk/NLSF_unpack.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/PLC.c b/lib/rbcodec/codecs/libopus/silk/PLC.c
index d9fda74555..01f40014c4 100644
--- a/lib/rbcodec/codecs/libopus/silk/PLC.c
+++ b/lib/rbcodec/codecs/libopus/silk/PLC.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -38,12 +38,12 @@ static const opus_int16 HARM_ATT_Q15[NB_ATT] = { 32440, 31130 }; /*
38static const opus_int16 PLC_RAND_ATTENUATE_V_Q15[NB_ATT] = { 31130, 26214 }; /* 0.95, 0.8 */ 38static const opus_int16 PLC_RAND_ATTENUATE_V_Q15[NB_ATT] = { 31130, 26214 }; /* 0.95, 0.8 */
39static const opus_int16 PLC_RAND_ATTENUATE_UV_Q15[NB_ATT] = { 32440, 29491 }; /* 0.99, 0.9 */ 39static const opus_int16 PLC_RAND_ATTENUATE_UV_Q15[NB_ATT] = { 32440, 29491 }; /* 0.99, 0.9 */
40 40
41static inline void silk_PLC_update( 41static OPUS_INLINE void silk_PLC_update(
42 silk_decoder_state *psDec, /* I/O Decoder state */ 42 silk_decoder_state *psDec, /* I/O Decoder state */
43 silk_decoder_control *psDecCtrl /* I/O Decoder control */ 43 silk_decoder_control *psDecCtrl /* I/O Decoder control */
44); 44);
45 45
46static inline void silk_PLC_conceal( 46static OPUS_INLINE void silk_PLC_conceal(
47 silk_decoder_state *psDec, /* I/O Decoder state */ 47 silk_decoder_state *psDec, /* I/O Decoder state */
48 silk_decoder_control *psDecCtrl, /* I/O Decoder control */ 48 silk_decoder_control *psDecCtrl, /* I/O Decoder control */
49 opus_int16 frame[] /* O LPC residual signal */ 49 opus_int16 frame[] /* O LPC residual signal */
@@ -92,7 +92,7 @@ void silk_PLC(
92/**************************************************/ 92/**************************************************/
93/* Update state of PLC */ 93/* Update state of PLC */
94/**************************************************/ 94/**************************************************/
95static inline void silk_PLC_update( 95static OPUS_INLINE void silk_PLC_update(
96 silk_decoder_state *psDec, /* I/O Decoder state */ 96 silk_decoder_state *psDec, /* I/O Decoder state */
97 silk_decoder_control *psDecCtrl /* I/O Decoder control */ 97 silk_decoder_control *psDecCtrl /* I/O Decoder control */
98) 98)
@@ -165,7 +165,7 @@ static inline void silk_PLC_update(
165 psPLC->nb_subfr = psDec->nb_subfr; 165 psPLC->nb_subfr = psDec->nb_subfr;
166} 166}
167 167
168static inline void silk_PLC_conceal( 168static OPUS_INLINE void silk_PLC_conceal(
169 silk_decoder_state *psDec, /* I/O Decoder state */ 169 silk_decoder_state *psDec, /* I/O Decoder state */
170 silk_decoder_control *psDecCtrl, /* I/O Decoder control */ 170 silk_decoder_control *psDecCtrl, /* I/O Decoder control */
171 opus_int16 frame[] /* O LPC residual signal */ 171 opus_int16 frame[] /* O LPC residual signal */
diff --git a/lib/rbcodec/codecs/libopus/silk/PLC.h b/lib/rbcodec/codecs/libopus/silk/PLC.h
index 172c63ae83..f1e2eccc69 100644
--- a/lib/rbcodec/codecs/libopus/silk/PLC.h
+++ b/lib/rbcodec/codecs/libopus/silk/PLC.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/SigProc_FIX.h b/lib/rbcodec/codecs/libopus/silk/SigProc_FIX.h
index 64c0b0eaec..1b58057910 100644
--- a/lib/rbcodec/codecs/libopus/silk/SigProc_FIX.h
+++ b/lib/rbcodec/codecs/libopus/silk/SigProc_FIX.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -227,7 +227,8 @@ void silk_autocorr(
227 opus_int *scale, /* O Scaling of the correlation vector */ 227 opus_int *scale, /* O Scaling of the correlation vector */
228 const opus_int16 *inputData, /* I Input data to correlate */ 228 const opus_int16 *inputData, /* I Input data to correlate */
229 const opus_int inputDataSize, /* I Length of input */ 229 const opus_int inputDataSize, /* I Length of input */
230 const opus_int correlationCount /* I Number of correlation taps to compute */ 230 const opus_int correlationCount, /* I Number of correlation taps to compute */
231 int arch /* I Run-time architecture */
231); 232);
232 233
233void silk_decode_pitch( 234void silk_decode_pitch(
@@ -249,7 +250,8 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0
249 const opus_int search_thres2_Q13, /* I Final threshold for lag candidates 0 - 1 */ 250 const opus_int search_thres2_Q13, /* I Final threshold for lag candidates 0 - 1 */
250 const opus_int Fs_kHz, /* I Sample frequency (kHz) */ 251 const opus_int Fs_kHz, /* I Sample frequency (kHz) */
251 const opus_int complexity, /* I Complexity setting, 0-2, where 2 is highest */ 252 const opus_int complexity, /* I Complexity setting, 0-2, where 2 is highest */
252 const opus_int nb_subfr /* I number of 5 ms subframes */ 253 const opus_int nb_subfr, /* I number of 5 ms subframes */
254 int arch /* I Run-time architecture */
253); 255);
254 256
255/* Compute Normalized Line Spectral Frequencies (NLSFs) from whitening filter coefficients */ 257/* Compute Normalized Line Spectral Frequencies (NLSFs) from whitening filter coefficients */
@@ -309,7 +311,8 @@ void silk_burg_modified(
309 const opus_int32 minInvGain_Q30, /* I Inverse of max prediction gain */ 311 const opus_int32 minInvGain_Q30, /* I Inverse of max prediction gain */
310 const opus_int subfr_length, /* I Input signal subframe length (incl. D preceding samples) */ 312 const opus_int subfr_length, /* I Input signal subframe length (incl. D preceding samples) */
311 const opus_int nb_subfr, /* I Number of subframes stacked in x */ 313 const opus_int nb_subfr, /* I Number of subframes stacked in x */
312 const opus_int D /* I Order */ 314 const opus_int D, /* I Order */
315 int arch /* I Run-time architecture */
313); 316);
314 317
315/* Copy and multiply a vector by a constant */ 318/* Copy and multiply a vector by a constant */
@@ -358,8 +361,8 @@ opus_int64 silk_inner_prod16_aligned_64(
358/* Rotate a32 right by 'rot' bits. Negative rot values result in rotating 361/* Rotate a32 right by 'rot' bits. Negative rot values result in rotating
359 left. Output is 32bit int. 362 left. Output is 32bit int.
360 Note: contemporary compilers recognize the C expression below and 363 Note: contemporary compilers recognize the C expression below and
361 compile it into a 'ror' instruction if available. No need for inline ASM! */ 364 compile it into a 'ror' instruction if available. No need for OPUS_INLINE ASM! */
362static inline opus_int32 silk_ROR32( opus_int32 a32, opus_int rot ) 365static OPUS_INLINE opus_int32 silk_ROR32( opus_int32 a32, opus_int rot )
363{ 366{
364 opus_uint32 x = (opus_uint32) a32; 367 opus_uint32 x = (opus_uint32) a32;
365 opus_uint32 r = (opus_uint32) rot; 368 opus_uint32 r = (opus_uint32) rot;
@@ -508,37 +511,37 @@ static inline opus_int32 silk_ROR32( opus_int32 a32, opus_int rot )
508#define SILK_FIX_CONST( C, Q ) ((opus_int32)((C) * ((opus_int64)1 << (Q)) + 0.5)) 511#define SILK_FIX_CONST( C, Q ) ((opus_int32)((C) * ((opus_int64)1 << (Q)) + 0.5))
509 512
510/* silk_min() versions with typecast in the function call */ 513/* silk_min() versions with typecast in the function call */
511static inline opus_int silk_min_int(opus_int a, opus_int b) 514static OPUS_INLINE opus_int silk_min_int(opus_int a, opus_int b)
512{ 515{
513 return (((a) < (b)) ? (a) : (b)); 516 return (((a) < (b)) ? (a) : (b));
514} 517}
515static inline opus_int16 silk_min_16(opus_int16 a, opus_int16 b) 518static OPUS_INLINE opus_int16 silk_min_16(opus_int16 a, opus_int16 b)
516{ 519{
517 return (((a) < (b)) ? (a) : (b)); 520 return (((a) < (b)) ? (a) : (b));
518} 521}
519static inline opus_int32 silk_min_32(opus_int32 a, opus_int32 b) 522static OPUS_INLINE opus_int32 silk_min_32(opus_int32 a, opus_int32 b)
520{ 523{
521 return (((a) < (b)) ? (a) : (b)); 524 return (((a) < (b)) ? (a) : (b));
522} 525}
523static inline opus_int64 silk_min_64(opus_int64 a, opus_int64 b) 526static OPUS_INLINE opus_int64 silk_min_64(opus_int64 a, opus_int64 b)
524{ 527{
525 return (((a) < (b)) ? (a) : (b)); 528 return (((a) < (b)) ? (a) : (b));
526} 529}
527 530
528/* silk_min() versions with typecast in the function call */ 531/* silk_min() versions with typecast in the function call */
529static inline opus_int silk_max_int(opus_int a, opus_int b) 532static OPUS_INLINE opus_int silk_max_int(opus_int a, opus_int b)
530{ 533{
531 return (((a) > (b)) ? (a) : (b)); 534 return (((a) > (b)) ? (a) : (b));
532} 535}
533static inline opus_int16 silk_max_16(opus_int16 a, opus_int16 b) 536static OPUS_INLINE opus_int16 silk_max_16(opus_int16 a, opus_int16 b)
534{ 537{
535 return (((a) > (b)) ? (a) : (b)); 538 return (((a) > (b)) ? (a) : (b));
536} 539}
537static inline opus_int32 silk_max_32(opus_int32 a, opus_int32 b) 540static OPUS_INLINE opus_int32 silk_max_32(opus_int32 a, opus_int32 b)
538{ 541{
539 return (((a) > (b)) ? (a) : (b)); 542 return (((a) > (b)) ? (a) : (b));
540} 543}
541static inline opus_int64 silk_max_64(opus_int64 a, opus_int64 b) 544static OPUS_INLINE opus_int64 silk_max_64(opus_int64 a, opus_int64 b)
542{ 545{
543 return (((a) > (b)) ? (a) : (b)); 546 return (((a) > (b)) ? (a) : (b));
544} 547}
@@ -576,11 +579,11 @@ static inline opus_int64 silk_max_64(opus_int64 a, opus_int64 b)
576#include "MacroCount.h" 579#include "MacroCount.h"
577#include "MacroDebug.h" 580#include "MacroDebug.h"
578 581
579#ifdef ARMv4_ASM 582#ifdef OPUS_ARM_INLINE_ASM
580#include "arm/SigProc_FIX_armv4.h" 583#include "arm/SigProc_FIX_armv4.h"
581#endif 584#endif
582 585
583#ifdef ARMv5E_ASM 586#ifdef OPUS_ARM_INLINE_EDSP
584#include "arm/SigProc_FIX_armv5e.h" 587#include "arm/SigProc_FIX_armv5e.h"
585#endif 588#endif
586 589
diff --git a/lib/rbcodec/codecs/libopus/silk/arm/SigProc_FIX_armv4.h b/lib/rbcodec/codecs/libopus/silk/arm/SigProc_FIX_armv4.h
index d69573e3d4..ff62b1e5d6 100644
--- a/lib/rbcodec/codecs/libopus/silk/arm/SigProc_FIX_armv4.h
+++ b/lib/rbcodec/codecs/libopus/silk/arm/SigProc_FIX_armv4.h
@@ -30,7 +30,7 @@ POSSIBILITY OF SUCH DAMAGE.
30#define SILK_SIGPROC_FIX_ARMv4_H 30#define SILK_SIGPROC_FIX_ARMv4_H
31 31
32#undef silk_MLA 32#undef silk_MLA
33static inline opus_int32 silk_MLA_armv4(opus_int32 a, opus_int32 b, 33static OPUS_INLINE opus_int32 silk_MLA_armv4(opus_int32 a, opus_int32 b,
34 opus_int32 c) 34 opus_int32 c)
35{ 35{
36 opus_int32 res; 36 opus_int32 res;
diff --git a/lib/rbcodec/codecs/libopus/silk/arm/SigProc_FIX_armv5e.h b/lib/rbcodec/codecs/libopus/silk/arm/SigProc_FIX_armv5e.h
index 81a6324f65..617a09cab1 100644
--- a/lib/rbcodec/codecs/libopus/silk/arm/SigProc_FIX_armv5e.h
+++ b/lib/rbcodec/codecs/libopus/silk/arm/SigProc_FIX_armv5e.h
@@ -30,7 +30,7 @@ POSSIBILITY OF SUCH DAMAGE.
30#define SILK_SIGPROC_FIX_ARMv5E_H 30#define SILK_SIGPROC_FIX_ARMv5E_H
31 31
32#undef silk_SMULTT 32#undef silk_SMULTT
33static inline opus_int32 silk_SMULTT_armv5e(opus_int32 a, opus_int32 b) 33static OPUS_INLINE opus_int32 silk_SMULTT_armv5e(opus_int32 a, opus_int32 b)
34{ 34{
35 opus_int32 res; 35 opus_int32 res;
36 __asm__( 36 __asm__(
@@ -44,7 +44,7 @@ static inline opus_int32 silk_SMULTT_armv5e(opus_int32 a, opus_int32 b)
44#define silk_SMULTT(a, b) (silk_SMULTT_armv5e(a, b)) 44#define silk_SMULTT(a, b) (silk_SMULTT_armv5e(a, b))
45 45
46#undef silk_SMLATT 46#undef silk_SMLATT
47static inline opus_int32 silk_SMLATT_armv5e(opus_int32 a, opus_int32 b, 47static OPUS_INLINE opus_int32 silk_SMLATT_armv5e(opus_int32 a, opus_int32 b,
48 opus_int32 c) 48 opus_int32 c)
49{ 49{
50 opus_int32 res; 50 opus_int32 res;
diff --git a/lib/rbcodec/codecs/libopus/silk/arm/macros_armv4.h b/lib/rbcodec/codecs/libopus/silk/arm/macros_armv4.h
index 58df6c2e2b..3f30e97288 100644
--- a/lib/rbcodec/codecs/libopus/silk/arm/macros_armv4.h
+++ b/lib/rbcodec/codecs/libopus/silk/arm/macros_armv4.h
@@ -30,7 +30,7 @@ POSSIBILITY OF SUCH DAMAGE.
30 30
31/* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */ 31/* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */
32#undef silk_SMULWB 32#undef silk_SMULWB
33static inline opus_int32 silk_SMULWB_armv4(opus_int32 a, opus_int16 b) 33static OPUS_INLINE opus_int32 silk_SMULWB_armv4(opus_int32 a, opus_int16 b)
34{ 34{
35 unsigned rd_lo; 35 unsigned rd_lo;
36 int rd_hi; 36 int rd_hi;
@@ -50,7 +50,7 @@ static inline opus_int32 silk_SMULWB_armv4(opus_int32 a, opus_int16 b)
50 50
51/* (a32 * (b32 >> 16)) >> 16 */ 51/* (a32 * (b32 >> 16)) >> 16 */
52#undef silk_SMULWT 52#undef silk_SMULWT
53static inline opus_int32 silk_SMULWT_armv4(opus_int32 a, opus_int32 b) 53static OPUS_INLINE opus_int32 silk_SMULWT_armv4(opus_int32 a, opus_int32 b)
54{ 54{
55 unsigned rd_lo; 55 unsigned rd_lo;
56 int rd_hi; 56 int rd_hi;
@@ -70,7 +70,7 @@ static inline opus_int32 silk_SMULWT_armv4(opus_int32 a, opus_int32 b)
70 70
71/* (a32 * b32) >> 16 */ 71/* (a32 * b32) >> 16 */
72#undef silk_SMULWW 72#undef silk_SMULWW
73static inline opus_int32 silk_SMULWW_armv4(opus_int32 a, opus_int32 b) 73static OPUS_INLINE opus_int32 silk_SMULWW_armv4(opus_int32 a, opus_int32 b)
74{ 74{
75 unsigned rd_lo; 75 unsigned rd_lo;
76 int rd_hi; 76 int rd_hi;
@@ -85,7 +85,7 @@ static inline opus_int32 silk_SMULWW_armv4(opus_int32 a, opus_int32 b)
85#define silk_SMULWW(a, b) (silk_SMULWW_armv4(a, b)) 85#define silk_SMULWW(a, b) (silk_SMULWW_armv4(a, b))
86 86
87#undef silk_SMLAWW 87#undef silk_SMLAWW
88static inline opus_int32 silk_SMLAWW_armv4(opus_int32 a, opus_int32 b, 88static OPUS_INLINE opus_int32 silk_SMLAWW_armv4(opus_int32 a, opus_int32 b,
89 opus_int32 c) 89 opus_int32 c)
90{ 90{
91 unsigned rd_lo; 91 unsigned rd_lo;
diff --git a/lib/rbcodec/codecs/libopus/silk/arm/macros_armv5e.h b/lib/rbcodec/codecs/libopus/silk/arm/macros_armv5e.h
index 63b1e30f48..aad4117e46 100644
--- a/lib/rbcodec/codecs/libopus/silk/arm/macros_armv5e.h
+++ b/lib/rbcodec/codecs/libopus/silk/arm/macros_armv5e.h
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
31 31
32/* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */ 32/* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */
33#undef silk_SMULWB 33#undef silk_SMULWB
34static inline opus_int32 silk_SMULWB_armv5e(opus_int32 a, opus_int16 b) 34static OPUS_INLINE opus_int32 silk_SMULWB_armv5e(opus_int32 a, opus_int16 b)
35{ 35{
36 int res; 36 int res;
37 __asm__( 37 __asm__(
@@ -46,7 +46,7 @@ static inline opus_int32 silk_SMULWB_armv5e(opus_int32 a, opus_int16 b)
46 46
47/* a32 + (b32 * (opus_int32)((opus_int16)(c32))) >> 16 output have to be 32bit int */ 47/* a32 + (b32 * (opus_int32)((opus_int16)(c32))) >> 16 output have to be 32bit int */
48#undef silk_SMLAWB 48#undef silk_SMLAWB
49static inline opus_int32 silk_SMLAWB_armv5e(opus_int32 a, opus_int32 b, 49static OPUS_INLINE opus_int32 silk_SMLAWB_armv5e(opus_int32 a, opus_int32 b,
50 opus_int16 c) 50 opus_int16 c)
51{ 51{
52 int res; 52 int res;
@@ -62,7 +62,7 @@ static inline opus_int32 silk_SMLAWB_armv5e(opus_int32 a, opus_int32 b,
62 62
63/* (a32 * (b32 >> 16)) >> 16 */ 63/* (a32 * (b32 >> 16)) >> 16 */
64#undef silk_SMULWT 64#undef silk_SMULWT
65static inline opus_int32 silk_SMULWT_armv5e(opus_int32 a, opus_int32 b) 65static OPUS_INLINE opus_int32 silk_SMULWT_armv5e(opus_int32 a, opus_int32 b)
66{ 66{
67 int res; 67 int res;
68 __asm__( 68 __asm__(
@@ -77,7 +77,7 @@ static inline opus_int32 silk_SMULWT_armv5e(opus_int32 a, opus_int32 b)
77 77
78/* a32 + (b32 * (c32 >> 16)) >> 16 */ 78/* a32 + (b32 * (c32 >> 16)) >> 16 */
79#undef silk_SMLAWT 79#undef silk_SMLAWT
80static inline opus_int32 silk_SMLAWT_armv5e(opus_int32 a, opus_int32 b, 80static OPUS_INLINE opus_int32 silk_SMLAWT_armv5e(opus_int32 a, opus_int32 b,
81 opus_int32 c) 81 opus_int32 c)
82{ 82{
83 int res; 83 int res;
@@ -93,7 +93,7 @@ static inline opus_int32 silk_SMLAWT_armv5e(opus_int32 a, opus_int32 b,
93 93
94/* (opus_int32)((opus_int16)(a3))) * (opus_int32)((opus_int16)(b32)) output have to be 32bit int */ 94/* (opus_int32)((opus_int16)(a3))) * (opus_int32)((opus_int16)(b32)) output have to be 32bit int */
95#undef silk_SMULBB 95#undef silk_SMULBB
96static inline opus_int32 silk_SMULBB_armv5e(opus_int32 a, opus_int32 b) 96static OPUS_INLINE opus_int32 silk_SMULBB_armv5e(opus_int32 a, opus_int32 b)
97{ 97{
98 int res; 98 int res;
99 __asm__( 99 __asm__(
@@ -108,7 +108,7 @@ static inline opus_int32 silk_SMULBB_armv5e(opus_int32 a, opus_int32 b)
108 108
109/* a32 + (opus_int32)((opus_int16)(b32)) * (opus_int32)((opus_int16)(c32)) output have to be 32bit int */ 109/* a32 + (opus_int32)((opus_int16)(b32)) * (opus_int32)((opus_int16)(c32)) output have to be 32bit int */
110#undef silk_SMLABB 110#undef silk_SMLABB
111static inline opus_int32 silk_SMLABB_armv5e(opus_int32 a, opus_int32 b, 111static OPUS_INLINE opus_int32 silk_SMLABB_armv5e(opus_int32 a, opus_int32 b,
112 opus_int32 c) 112 opus_int32 c)
113{ 113{
114 int res; 114 int res;
@@ -124,7 +124,7 @@ static inline opus_int32 silk_SMLABB_armv5e(opus_int32 a, opus_int32 b,
124 124
125/* (opus_int32)((opus_int16)(a32)) * (b32 >> 16) */ 125/* (opus_int32)((opus_int16)(a32)) * (b32 >> 16) */
126#undef silk_SMULBT 126#undef silk_SMULBT
127static inline opus_int32 silk_SMULBT_armv5e(opus_int32 a, opus_int32 b) 127static OPUS_INLINE opus_int32 silk_SMULBT_armv5e(opus_int32 a, opus_int32 b)
128{ 128{
129 int res; 129 int res;
130 __asm__( 130 __asm__(
@@ -139,7 +139,7 @@ static inline opus_int32 silk_SMULBT_armv5e(opus_int32 a, opus_int32 b)
139 139
140/* a32 + (opus_int32)((opus_int16)(b32)) * (c32 >> 16) */ 140/* a32 + (opus_int32)((opus_int16)(b32)) * (c32 >> 16) */
141#undef silk_SMLABT 141#undef silk_SMLABT
142static inline opus_int32 silk_SMLABT_armv5e(opus_int32 a, opus_int32 b, 142static OPUS_INLINE opus_int32 silk_SMLABT_armv5e(opus_int32 a, opus_int32 b,
143 opus_int32 c) 143 opus_int32 c)
144{ 144{
145 int res; 145 int res;
@@ -155,7 +155,7 @@ static inline opus_int32 silk_SMLABT_armv5e(opus_int32 a, opus_int32 b,
155 155
156/* add/subtract with output saturated */ 156/* add/subtract with output saturated */
157#undef silk_ADD_SAT32 157#undef silk_ADD_SAT32
158static inline opus_int32 silk_ADD_SAT32_armv5e(opus_int32 a, opus_int32 b) 158static OPUS_INLINE opus_int32 silk_ADD_SAT32_armv5e(opus_int32 a, opus_int32 b)
159{ 159{
160 int res; 160 int res;
161 __asm__( 161 __asm__(
@@ -169,7 +169,7 @@ static inline opus_int32 silk_ADD_SAT32_armv5e(opus_int32 a, opus_int32 b)
169#define silk_ADD_SAT32(a, b) (silk_ADD_SAT32_armv5e(a, b)) 169#define silk_ADD_SAT32(a, b) (silk_ADD_SAT32_armv5e(a, b))
170 170
171#undef silk_SUB_SAT32 171#undef silk_SUB_SAT32
172static inline opus_int32 silk_SUB_SAT32_armv5e(opus_int32 a, opus_int32 b) 172static OPUS_INLINE opus_int32 silk_SUB_SAT32_armv5e(opus_int32 a, opus_int32 b)
173{ 173{
174 int res; 174 int res;
175 __asm__( 175 __asm__(
@@ -183,7 +183,7 @@ static inline opus_int32 silk_SUB_SAT32_armv5e(opus_int32 a, opus_int32 b)
183#define silk_SUB_SAT32(a, b) (silk_SUB_SAT32_armv5e(a, b)) 183#define silk_SUB_SAT32(a, b) (silk_SUB_SAT32_armv5e(a, b))
184 184
185#undef silk_CLZ16 185#undef silk_CLZ16
186static inline opus_int32 silk_CLZ16_armv5(opus_int16 in16) 186static OPUS_INLINE opus_int32 silk_CLZ16_armv5(opus_int16 in16)
187{ 187{
188 int res; 188 int res;
189 __asm__( 189 __asm__(
@@ -197,7 +197,7 @@ static inline opus_int32 silk_CLZ16_armv5(opus_int16 in16)
197#define silk_CLZ16(in16) (silk_CLZ16_armv5(in16)) 197#define silk_CLZ16(in16) (silk_CLZ16_armv5(in16))
198 198
199#undef silk_CLZ32 199#undef silk_CLZ32
200static inline opus_int32 silk_CLZ32_armv5(opus_int32 in32) 200static OPUS_INLINE opus_int32 silk_CLZ32_armv5(opus_int32 in32)
201{ 201{
202 int res; 202 int res;
203 __asm__( 203 __asm__(
diff --git a/lib/rbcodec/codecs/libopus/silk/bwexpander.c b/lib/rbcodec/codecs/libopus/silk/bwexpander.c
index a0157b0606..2eb4456695 100644
--- a/lib/rbcodec/codecs/libopus/silk/bwexpander.c
+++ b/lib/rbcodec/codecs/libopus/silk/bwexpander.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/bwexpander_32.c b/lib/rbcodec/codecs/libopus/silk/bwexpander_32.c
index 80628cd7a7..d0010f73df 100644
--- a/lib/rbcodec/codecs/libopus/silk/bwexpander_32.c
+++ b/lib/rbcodec/codecs/libopus/silk/bwexpander_32.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/code_signs.c b/lib/rbcodec/codecs/libopus/silk/code_signs.c
index f9173278ab..561043c739 100644
--- a/lib/rbcodec/codecs/libopus/silk/code_signs.c
+++ b/lib/rbcodec/codecs/libopus/silk/code_signs.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/control.h b/lib/rbcodec/codecs/libopus/silk/control.h
index 77530f8feb..747e5426a0 100644
--- a/lib/rbcodec/codecs/libopus/silk/control.h
+++ b/lib/rbcodec/codecs/libopus/silk/control.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -92,6 +92,9 @@ typedef struct {
92 /* I: Opus encoder is allowing us to switch bandwidth */ 92 /* I: Opus encoder is allowing us to switch bandwidth */
93 opus_int opusCanSwitch; 93 opus_int opusCanSwitch;
94 94
95 /* I: Make frames as independent as possible (but still use LPC) */
96 opus_int reducedDependency;
97
95 /* O: Internal sampling rate used, in Hertz; 8000/12000/16000 */ 98 /* O: Internal sampling rate used, in Hertz; 8000/12000/16000 */
96 opus_int32 internalSampleRate; 99 opus_int32 internalSampleRate;
97 100
diff --git a/lib/rbcodec/codecs/libopus/silk/dec_API.c b/lib/rbcodec/codecs/libopus/silk/dec_API.c
index 5b6e518130..4cbcf71514 100644
--- a/lib/rbcodec/codecs/libopus/silk/dec_API.c
+++ b/lib/rbcodec/codecs/libopus/silk/dec_API.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -305,7 +305,7 @@ opus_int silk_Decode( /* O Returns error co
305 305
306 /* Set up pointers to temp buffers */ 306 /* Set up pointers to temp buffers */
307 ALLOC( samplesOut2_tmp, 307 ALLOC( samplesOut2_tmp,
308 decControl->nChannelsAPI == 2 ? *nSamplesOut : 0, opus_int16 ); 308 decControl->nChannelsAPI == 2 ? *nSamplesOut : ALLOC_NONE, opus_int16 );
309 if( decControl->nChannelsAPI == 2 ) { 309 if( decControl->nChannelsAPI == 2 ) {
310 resample_out_ptr = samplesOut2_tmp; 310 resample_out_ptr = samplesOut2_tmp;
311 } else { 311 } else {
diff --git a/lib/rbcodec/codecs/libopus/silk/decode_core.c b/lib/rbcodec/codecs/libopus/silk/decode_core.c
index b298389f07..87fbd5de9f 100644
--- a/lib/rbcodec/codecs/libopus/silk/decode_core.c
+++ b/lib/rbcodec/codecs/libopus/silk/decode_core.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/decode_frame.c b/lib/rbcodec/codecs/libopus/silk/decode_frame.c
index a9ad7928ef..abc00a3d54 100644
--- a/lib/rbcodec/codecs/libopus/silk/decode_frame.c
+++ b/lib/rbcodec/codecs/libopus/silk/decode_frame.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/decode_indices.c b/lib/rbcodec/codecs/libopus/silk/decode_indices.c
index f5a2665107..7afe5c26c1 100644
--- a/lib/rbcodec/codecs/libopus/silk/decode_indices.c
+++ b/lib/rbcodec/codecs/libopus/silk/decode_indices.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/decode_parameters.c b/lib/rbcodec/codecs/libopus/silk/decode_parameters.c
index fa72395c3b..e345b1dcef 100644
--- a/lib/rbcodec/codecs/libopus/silk/decode_parameters.c
+++ b/lib/rbcodec/codecs/libopus/silk/decode_parameters.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/decode_pitch.c b/lib/rbcodec/codecs/libopus/silk/decode_pitch.c
index f9e3e3bc2b..fedbc6a525 100644
--- a/lib/rbcodec/codecs/libopus/silk/decode_pitch.c
+++ b/lib/rbcodec/codecs/libopus/silk/decode_pitch.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/decode_pulses.c b/lib/rbcodec/codecs/libopus/silk/decode_pulses.c
index 2d8f28186f..e8a87c2ab7 100644
--- a/lib/rbcodec/codecs/libopus/silk/decode_pulses.c
+++ b/lib/rbcodec/codecs/libopus/silk/decode_pulses.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/decoder_set_fs.c b/lib/rbcodec/codecs/libopus/silk/decoder_set_fs.c
index de410797ae..eef0fd25e1 100644
--- a/lib/rbcodec/codecs/libopus/silk/decoder_set_fs.c
+++ b/lib/rbcodec/codecs/libopus/silk/decoder_set_fs.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/define.h b/lib/rbcodec/codecs/libopus/silk/define.h
index ee3a534b41..c47aca9f58 100644
--- a/lib/rbcodec/codecs/libopus/silk/define.h
+++ b/lib/rbcodec/codecs/libopus/silk/define.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/errors.h b/lib/rbcodec/codecs/libopus/silk/errors.h
index 00b67163c9..45070800f2 100644
--- a/lib/rbcodec/codecs/libopus/silk/errors.h
+++ b/lib/rbcodec/codecs/libopus/silk/errors.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/gain_quant.c b/lib/rbcodec/codecs/libopus/silk/gain_quant.c
index 47e747ee4a..ed084073b1 100644
--- a/lib/rbcodec/codecs/libopus/silk/gain_quant.c
+++ b/lib/rbcodec/codecs/libopus/silk/gain_quant.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/init_decoder.c b/lib/rbcodec/codecs/libopus/silk/init_decoder.c
index 68a20ae6b0..f887c67886 100644
--- a/lib/rbcodec/codecs/libopus/silk/init_decoder.c
+++ b/lib/rbcodec/codecs/libopus/silk/init_decoder.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/log2lin.c b/lib/rbcodec/codecs/libopus/silk/log2lin.c
index 50be565cb5..a692e009db 100644
--- a/lib/rbcodec/codecs/libopus/silk/log2lin.c
+++ b/lib/rbcodec/codecs/libopus/silk/log2lin.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -41,7 +41,9 @@ opus_int32 silk_log2lin(
41 41
42 if( inLog_Q7 < 0 ) { 42 if( inLog_Q7 < 0 ) {
43 return 0; 43 return 0;
44 } 44 } else if ( inLog_Q7 >= 3967 ) {
45 return silk_int32_MAX;
46 }
45 47
46 out = silk_LSHIFT( 1, silk_RSHIFT( inLog_Q7, 7 ) ); 48 out = silk_LSHIFT( 1, silk_RSHIFT( inLog_Q7, 7 ) );
47 frac_Q7 = inLog_Q7 & 0x7F; 49 frac_Q7 = inLog_Q7 & 0x7F;
diff --git a/lib/rbcodec/codecs/libopus/silk/macros.h b/lib/rbcodec/codecs/libopus/silk/macros.h
index 97f03c886a..482dc3c6eb 100644
--- a/lib/rbcodec/codecs/libopus/silk/macros.h
+++ b/lib/rbcodec/codecs/libopus/silk/macros.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -32,7 +32,10 @@ POSSIBILITY OF SUCH DAMAGE.
32#include "config.h" 32#include "config.h"
33#endif 33#endif
34 34
35/* This is an inline header file for general platform. */ 35#include "opus_types.h"
36#include "opus_defines.h"
37
38/* This is an OPUS_INLINE header file for general platform. */
36 39
37/* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */ 40/* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */
38#define silk_SMULWB(a32, b32) ((((a32) >> 16) * (opus_int32)((opus_int16)(b32))) + ((((a32) & 0x0000FFFF) * (opus_int32)((opus_int16)(b32))) >> 16)) 41#define silk_SMULWB(a32, b32) ((((a32) >> 16) * (opus_int32)((opus_int16)(b32))) + ((((a32) & 0x0000FFFF) * (opus_int32)((opus_int16)(b32))) >> 16))
@@ -78,12 +81,12 @@ POSSIBILITY OF SUCH DAMAGE.
78 81
79#include "ecintrin.h" 82#include "ecintrin.h"
80 83
81static inline opus_int32 silk_CLZ16(opus_int16 in16) 84static OPUS_INLINE opus_int32 silk_CLZ16(opus_int16 in16)
82{ 85{
83 return 32 - EC_ILOG(in16<<16|0x8000); 86 return 32 - EC_ILOG(in16<<16|0x8000);
84} 87}
85 88
86static inline opus_int32 silk_CLZ32(opus_int32 in32) 89static OPUS_INLINE opus_int32 silk_CLZ32(opus_int32 in32)
87{ 90{
88 return in32 ? 32 - EC_ILOG(in32) : 32; 91 return in32 ? 32 - EC_ILOG(in32) : 32;
89} 92}
@@ -100,15 +103,15 @@ static inline opus_int32 silk_CLZ32(opus_int32 in32)
100 (*((Matrix_base_adr) + ((row)+(M)*(column)))) 103 (*((Matrix_base_adr) + ((row)+(M)*(column))))
101#endif 104#endif
102 105
103#ifdef ARMv4_ASM 106#ifdef OPUS_ARM_INLINE_ASM
104#include "arm/macros_armv4.h" 107#include "arm/macros_armv4.h"
105#endif 108#endif
106 109
107#ifdef ARMv5E_ASM 110#ifdef OPUS_ARM_INLINE_EDSP
108#include "arm/macros_armv5e.h" 111#include "arm/macros_armv5e.h"
109#endif 112#endif
110 113
111#ifdef CF_ASM 114#ifdef OPUS_CF_INLINE_ASM
112#include "cf/macros_cf.h" 115#include "cf/macros_cf.h"
113#endif 116#endif
114 117
diff --git a/lib/rbcodec/codecs/libopus/silk/main.h b/lib/rbcodec/codecs/libopus/silk/main.h
index 376c77c8b3..2bdf89784d 100644
--- a/lib/rbcodec/codecs/libopus/silk/main.h
+++ b/lib/rbcodec/codecs/libopus/silk/main.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -204,6 +204,7 @@ void silk_quant_LTP_gains(
204 opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (un)quantized LTP gains */ 204 opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (un)quantized LTP gains */
205 opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook Index */ 205 opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook Index */
206 opus_int8 *periodicity_index, /* O Periodicity Index */ 206 opus_int8 *periodicity_index, /* O Periodicity Index */
207 opus_int32 *sum_gain_dB_Q7, /* I/O Cumulative max prediction gain */
207 const opus_int32 W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I Error Weights in Q18 */ 208 const opus_int32 W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I Error Weights in Q18 */
208 opus_int mu_Q9, /* I Mu value (R/D tradeoff) */ 209 opus_int mu_Q9, /* I Mu value (R/D tradeoff) */
209 opus_int lowComplexity, /* I Flag for low complexity */ 210 opus_int lowComplexity, /* I Flag for low complexity */
@@ -214,11 +215,14 @@ void silk_quant_LTP_gains(
214void silk_VQ_WMat_EC( 215void silk_VQ_WMat_EC(
215 opus_int8 *ind, /* O index of best codebook vector */ 216 opus_int8 *ind, /* O index of best codebook vector */
216 opus_int32 *rate_dist_Q14, /* O best weighted quant error + mu * rate */ 217 opus_int32 *rate_dist_Q14, /* O best weighted quant error + mu * rate */
218 opus_int *gain_Q7, /* O sum of absolute LTP coefficients */
217 const opus_int16 *in_Q14, /* I input vector to be quantized */ 219 const opus_int16 *in_Q14, /* I input vector to be quantized */
218 const opus_int32 *W_Q18, /* I weighting matrix */ 220 const opus_int32 *W_Q18, /* I weighting matrix */
219 const opus_int8 *cb_Q7, /* I codebook */ 221 const opus_int8 *cb_Q7, /* I codebook */
222 const opus_uint8 *cb_gain_Q7, /* I codebook effective gain */
220 const opus_uint8 *cl_Q5, /* I code length for each codebook vector */ 223 const opus_uint8 *cl_Q5, /* I code length for each codebook vector */
221 const opus_int mu_Q9, /* I tradeoff betw. weighted error and rate */ 224 const opus_int mu_Q9, /* I tradeoff betw. weighted error and rate */
225 const opus_int32 max_gain_Q7, /* I maximum sum of absolute LTP coefficients */
222 opus_int L /* I number of vectors in codebook */ 226 opus_int L /* I number of vectors in codebook */
223); 227);
224 228
diff --git a/lib/rbcodec/codecs/libopus/silk/pitch_est_defines.h b/lib/rbcodec/codecs/libopus/silk/pitch_est_defines.h
index 1e4440121b..e1e4b5d768 100644
--- a/lib/rbcodec/codecs/libopus/silk/pitch_est_defines.h
+++ b/lib/rbcodec/codecs/libopus/silk/pitch_est_defines.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/pitch_est_tables.c b/lib/rbcodec/codecs/libopus/silk/pitch_est_tables.c
index 38d6df4572..81a8bacaca 100644
--- a/lib/rbcodec/codecs/libopus/silk/pitch_est_tables.c
+++ b/lib/rbcodec/codecs/libopus/silk/pitch_est_tables.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/resampler.c b/lib/rbcodec/codecs/libopus/silk/resampler.c
index 624cae00ed..374fbb3722 100644
--- a/lib/rbcodec/codecs/libopus/silk/resampler.c
+++ b/lib/rbcodec/codecs/libopus/silk/resampler.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/resampler_private.h b/lib/rbcodec/codecs/libopus/silk/resampler_private.h
index 273f93e680..422a7d9d95 100644
--- a/lib/rbcodec/codecs/libopus/silk/resampler_private.h
+++ b/lib/rbcodec/codecs/libopus/silk/resampler_private.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/resampler_private_AR2.c b/lib/rbcodec/codecs/libopus/silk/resampler_private_AR2.c
index 7377459159..5fff23714f 100644
--- a/lib/rbcodec/codecs/libopus/silk/resampler_private_AR2.c
+++ b/lib/rbcodec/codecs/libopus/silk/resampler_private_AR2.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/resampler_private_IIR_FIR.c b/lib/rbcodec/codecs/libopus/silk/resampler_private_IIR_FIR.c
index ce9aff0907..c7b4f6ed5e 100644
--- a/lib/rbcodec/codecs/libopus/silk/resampler_private_IIR_FIR.c
+++ b/lib/rbcodec/codecs/libopus/silk/resampler_private_IIR_FIR.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
33#include "resampler_private.h" 33#include "resampler_private.h"
34#include "stack_alloc.h" 34#include "stack_alloc.h"
35 35
36static inline opus_int16 *silk_resampler_private_IIR_FIR_INTERPOL( 36static OPUS_INLINE opus_int16 *silk_resampler_private_IIR_FIR_INTERPOL(
37 opus_int16 *out, 37 opus_int16 *out,
38 opus_int16 *buf, 38 opus_int16 *buf,
39 opus_int32 max_index_Q16, 39 opus_int32 max_index_Q16,
diff --git a/lib/rbcodec/codecs/libopus/silk/resampler_private_down_FIR.c b/lib/rbcodec/codecs/libopus/silk/resampler_private_down_FIR.c
index 163fedd818..783e42b356 100644
--- a/lib/rbcodec/codecs/libopus/silk/resampler_private_down_FIR.c
+++ b/lib/rbcodec/codecs/libopus/silk/resampler_private_down_FIR.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
33#include "resampler_private.h" 33#include "resampler_private.h"
34#include "stack_alloc.h" 34#include "stack_alloc.h"
35 35
36static inline opus_int16 *silk_resampler_private_down_FIR_INTERPOL( 36static OPUS_INLINE opus_int16 *silk_resampler_private_down_FIR_INTERPOL(
37 opus_int16 *out, 37 opus_int16 *out,
38 opus_int32 *buf, 38 opus_int32 *buf,
39 const opus_int16 *FIR_Coefs, 39 const opus_int16 *FIR_Coefs,
diff --git a/lib/rbcodec/codecs/libopus/silk/resampler_private_up2_HQ.c b/lib/rbcodec/codecs/libopus/silk/resampler_private_up2_HQ.c
index e611d4206d..c7ec8de365 100644
--- a/lib/rbcodec/codecs/libopus/silk/resampler_private_up2_HQ.c
+++ b/lib/rbcodec/codecs/libopus/silk/resampler_private_up2_HQ.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/resampler_rom.c b/lib/rbcodec/codecs/libopus/silk/resampler_rom.c
index edec0436e4..2d502706f9 100644
--- a/lib/rbcodec/codecs/libopus/silk/resampler_rom.c
+++ b/lib/rbcodec/codecs/libopus/silk/resampler_rom.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/resampler_rom.h b/lib/rbcodec/codecs/libopus/silk/resampler_rom.h
index ffc7f5dabd..490b3388dc 100644
--- a/lib/rbcodec/codecs/libopus/silk/resampler_rom.h
+++ b/lib/rbcodec/codecs/libopus/silk/resampler_rom.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/resampler_structs.h b/lib/rbcodec/codecs/libopus/silk/resampler_structs.h
index cbcac20fe7..9e9457d11c 100644
--- a/lib/rbcodec/codecs/libopus/silk/resampler_structs.h
+++ b/lib/rbcodec/codecs/libopus/silk/resampler_structs.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/shell_coder.c b/lib/rbcodec/codecs/libopus/silk/shell_coder.c
index f402cc4328..9d6e1bb366 100644
--- a/lib/rbcodec/codecs/libopus/silk/shell_coder.c
+++ b/lib/rbcodec/codecs/libopus/silk/shell_coder.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
33 33
34/* shell coder; pulse-subframe length is hardcoded */ 34/* shell coder; pulse-subframe length is hardcoded */
35 35
36static inline void combine_pulses( 36static OPUS_INLINE void combine_pulses(
37 opus_int *out, /* O combined pulses vector [len] */ 37 opus_int *out, /* O combined pulses vector [len] */
38 const opus_int *in, /* I input vector [2 * len] */ 38 const opus_int *in, /* I input vector [2 * len] */
39 const opus_int len /* I number of OUTPUT samples */ 39 const opus_int len /* I number of OUTPUT samples */
@@ -46,7 +46,7 @@ static inline void combine_pulses(
46} 46}
47 47
48#if 0 48#if 0
49static inline void encode_split( 49static OPUS_INLINE void encode_split(
50 ec_enc *psRangeEnc, /* I/O compressor data structure */ 50 ec_enc *psRangeEnc, /* I/O compressor data structure */
51 const opus_int p_child1, /* I pulse amplitude of first child subframe */ 51 const opus_int p_child1, /* I pulse amplitude of first child subframe */
52 const opus_int p, /* I pulse amplitude of current subframe */ 52 const opus_int p, /* I pulse amplitude of current subframe */
@@ -59,7 +59,7 @@ static inline void encode_split(
59} 59}
60#endif 60#endif
61 61
62static inline void decode_split( 62static OPUS_INLINE void decode_split(
63 opus_int *p_child1, /* O pulse amplitude of first child subframe */ 63 opus_int *p_child1, /* O pulse amplitude of first child subframe */
64 opus_int *p_child2, /* O pulse amplitude of second child subframe */ 64 opus_int *p_child2, /* O pulse amplitude of second child subframe */
65 ec_dec *psRangeDec, /* I/O Compressor data structure */ 65 ec_dec *psRangeDec, /* I/O Compressor data structure */
diff --git a/lib/rbcodec/codecs/libopus/silk/sort.c b/lib/rbcodec/codecs/libopus/silk/sort.c
index b311e24c9f..2f9930d9ce 100644
--- a/lib/rbcodec/codecs/libopus/silk/sort.c
+++ b/lib/rbcodec/codecs/libopus/silk/sort.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -83,6 +83,7 @@ void silk_insertion_sort_increasing(
83 } 83 }
84 } 84 }
85} 85}
86#endif
86 87
87#ifdef FIXED_POINT 88#ifdef FIXED_POINT
88/* This function is only used by the fixed-point build */ 89/* This function is only used by the fixed-point build */
@@ -132,7 +133,6 @@ void silk_insertion_sort_decreasing_int16(
132 } 133 }
133} 134}
134#endif 135#endif
135#endif
136 136
137void silk_insertion_sort_increasing_all_values_int16( 137void silk_insertion_sort_increasing_all_values_int16(
138 opus_int16 *a, /* I/O Unsorted / Sorted vector */ 138 opus_int16 *a, /* I/O Unsorted / Sorted vector */
diff --git a/lib/rbcodec/codecs/libopus/silk/stereo_MS_to_LR.c b/lib/rbcodec/codecs/libopus/silk/stereo_MS_to_LR.c
index 22d61a5f1d..62521a4f35 100644
--- a/lib/rbcodec/codecs/libopus/silk/stereo_MS_to_LR.c
+++ b/lib/rbcodec/codecs/libopus/silk/stereo_MS_to_LR.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/stereo_decode_pred.c b/lib/rbcodec/codecs/libopus/silk/stereo_decode_pred.c
index 586b4d81df..56ba3925e8 100644
--- a/lib/rbcodec/codecs/libopus/silk/stereo_decode_pred.c
+++ b/lib/rbcodec/codecs/libopus/silk/stereo_decode_pred.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/structs.h b/lib/rbcodec/codecs/libopus/silk/structs.h
index 8828f44d03..1826b36a80 100644
--- a/lib/rbcodec/codecs/libopus/silk/structs.h
+++ b/lib/rbcodec/codecs/libopus/silk/structs.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -171,6 +171,7 @@ typedef struct {
171 opus_int32 pitchEstimationThreshold_Q16; /* Threshold for pitch estimator */ 171 opus_int32 pitchEstimationThreshold_Q16; /* Threshold for pitch estimator */
172 opus_int LTPQuantLowComplexity; /* Flag for low complexity LTP quantization */ 172 opus_int LTPQuantLowComplexity; /* Flag for low complexity LTP quantization */
173 opus_int mu_LTP_Q9; /* Rate-distortion tradeoff in LTP quantization */ 173 opus_int mu_LTP_Q9; /* Rate-distortion tradeoff in LTP quantization */
174 opus_int32 sum_log_gain_Q7; /* Cumulative max prediction gain */
174 opus_int NLSF_MSVQ_Survivors; /* Number of survivors in NLSF MSVQ */ 175 opus_int NLSF_MSVQ_Survivors; /* Number of survivors in NLSF MSVQ */
175 opus_int first_frame_after_reset; /* Flag for deactivating NLSF interpolation, pitch prediction */ 176 opus_int first_frame_after_reset; /* Flag for deactivating NLSF interpolation, pitch prediction */
176 opus_int controlled_since_last_payload; /* Flag for ensuring codec_control only runs once per packet */ 177 opus_int controlled_since_last_payload; /* Flag for ensuring codec_control only runs once per packet */
@@ -191,6 +192,8 @@ typedef struct {
191 SideInfoIndices indices; 192 SideInfoIndices indices;
192 opus_int8 pulses[ MAX_FRAME_LENGTH ]; 193 opus_int8 pulses[ MAX_FRAME_LENGTH ];
193 194
195 int arch;
196
194 /* Input/output buffering */ 197 /* Input/output buffering */
195 opus_int16 inputBuf[ MAX_FRAME_LENGTH + 2 ]; /* Buffer containing input signal */ 198 opus_int16 inputBuf[ MAX_FRAME_LENGTH + 2 ]; /* Buffer containing input signal */
196 opus_int inputBufIx; 199 opus_int inputBufIx;
diff --git a/lib/rbcodec/codecs/libopus/silk/sum_sqr_shift.c b/lib/rbcodec/codecs/libopus/silk/sum_sqr_shift.c
index 815489a4a6..12514c9917 100644
--- a/lib/rbcodec/codecs/libopus/silk/sum_sqr_shift.c
+++ b/lib/rbcodec/codecs/libopus/silk/sum_sqr_shift.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/table_LSF_cos.c b/lib/rbcodec/codecs/libopus/silk/table_LSF_cos.c
index 93a7039c15..ec9dc63927 100644
--- a/lib/rbcodec/codecs/libopus/silk/table_LSF_cos.c
+++ b/lib/rbcodec/codecs/libopus/silk/table_LSF_cos.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/tables.h b/lib/rbcodec/codecs/libopus/silk/tables.h
index 6e4b670647..a91431e854 100644
--- a/lib/rbcodec/codecs/libopus/silk/tables.h
+++ b/lib/rbcodec/codecs/libopus/silk/tables.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -78,6 +78,8 @@ extern const opus_uint8 * const silk_LTP_gain_iCDF_ptrs[ NB_LTP_CBKS ];
78extern const opus_uint8 * const silk_LTP_gain_BITS_Q5_ptrs[ NB_LTP_CBKS ]; /* 3 */ 78extern const opus_uint8 * const silk_LTP_gain_BITS_Q5_ptrs[ NB_LTP_CBKS ]; /* 3 */
79extern const opus_int16 silk_LTP_gain_middle_avg_RD_Q14; 79extern const opus_int16 silk_LTP_gain_middle_avg_RD_Q14;
80extern const opus_int8 * const silk_LTP_vq_ptrs_Q7[ NB_LTP_CBKS ]; /* 168 */ 80extern const opus_int8 * const silk_LTP_vq_ptrs_Q7[ NB_LTP_CBKS ]; /* 168 */
81extern const opus_uint8 * const silk_LTP_vq_gain_ptrs_Q7[NB_LTP_CBKS];
82
81extern const opus_int8 silk_LTP_vq_sizes[ NB_LTP_CBKS ]; /* 3 */ 83extern const opus_int8 silk_LTP_vq_sizes[ NB_LTP_CBKS ]; /* 3 */
82 84
83extern const opus_uint8 silk_LTPscale_iCDF[ 3 ]; /* 4 */ 85extern const opus_uint8 silk_LTPscale_iCDF[ 3 ]; /* 4 */
diff --git a/lib/rbcodec/codecs/libopus/silk/tables_LTP.c b/lib/rbcodec/codecs/libopus/silk/tables_LTP.c
index d16a511cc2..ea518652b8 100644
--- a/lib/rbcodec/codecs/libopus/silk/tables_LTP.c
+++ b/lib/rbcodec/codecs/libopus/silk/tables_LTP.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -51,6 +51,7 @@ static const opus_uint8 silk_LTP_gain_iCDF_2[32] = {
51 24, 20, 16, 12, 9, 5, 2, 0 51 24, 20, 16, 12, 9, 5, 2, 0
52}; 52};
53 53
54#if 0
54const opus_int16 silk_LTP_gain_middle_avg_RD_Q14 = 12304; 55const opus_int16 silk_LTP_gain_middle_avg_RD_Q14 = 12304;
55 56
56static const opus_uint8 silk_LTP_gain_BITS_Q5_0[8] = { 57static const opus_uint8 silk_LTP_gain_BITS_Q5_0[8] = {
@@ -68,6 +69,7 @@ static const opus_uint8 silk_LTP_gain_BITS_Q5_2[32] = {
68 160, 160, 166, 166, 173, 173, 182, 192, 69 160, 160, 166, 166, 173, 173, 182, 192,
69 182, 192, 192, 192, 205, 192, 205, 224 70 182, 192, 192, 192, 205, 192, 205, 224
70}; 71};
72#endif
71 73
72const opus_uint8 * const silk_LTP_gain_iCDF_ptrs[NB_LTP_CBKS] = { 74const opus_uint8 * const silk_LTP_gain_iCDF_ptrs[NB_LTP_CBKS] = {
73 silk_LTP_gain_iCDF_0, 75 silk_LTP_gain_iCDF_0,
@@ -75,11 +77,13 @@ const opus_uint8 * const silk_LTP_gain_iCDF_ptrs[NB_LTP_CBKS] = {
75 silk_LTP_gain_iCDF_2 77 silk_LTP_gain_iCDF_2
76}; 78};
77 79
80#if 0
78const opus_uint8 * const silk_LTP_gain_BITS_Q5_ptrs[NB_LTP_CBKS] = { 81const opus_uint8 * const silk_LTP_gain_BITS_Q5_ptrs[NB_LTP_CBKS] = {
79 silk_LTP_gain_BITS_Q5_0, 82 silk_LTP_gain_BITS_Q5_0,
80 silk_LTP_gain_BITS_Q5_1, 83 silk_LTP_gain_BITS_Q5_1,
81 silk_LTP_gain_BITS_Q5_2 84 silk_LTP_gain_BITS_Q5_2
82}; 85};
86#endif
83 87
84static const opus_int8 silk_LTP_gain_vq_0[8][5] = 88static const opus_int8 silk_LTP_gain_vq_0[8][5] =
85{ 89{
@@ -267,6 +271,32 @@ const opus_int8 * const silk_LTP_vq_ptrs_Q7[NB_LTP_CBKS] = {
267 (opus_int8 *)&silk_LTP_gain_vq_2[0][0] 271 (opus_int8 *)&silk_LTP_gain_vq_2[0][0]
268}; 272};
269 273
274#if 0
275/* Maximum frequency-dependent response of the pitch taps above,
276 computed as max(abs(freqz(taps))) */
277static const opus_uint8 silk_LTP_gain_vq_0_gain[8] = {
278 46, 2, 90, 87, 93, 91, 82, 98
279};
280
281static const opus_uint8 silk_LTP_gain_vq_1_gain[16] = {
282 109, 120, 118, 12, 113, 115, 117, 119,
283 99, 59, 87, 111, 63, 111, 112, 80
284};
285
286static const opus_uint8 silk_LTP_gain_vq_2_gain[32] = {
287 126, 124, 125, 124, 129, 121, 126, 23,
288 132, 127, 127, 127, 126, 127, 122, 133,
289 130, 134, 101, 118, 119, 145, 126, 86,
290 124, 120, 123, 119, 170, 173, 107, 109
291};
292
293const opus_uint8 * const silk_LTP_vq_gain_ptrs_Q7[NB_LTP_CBKS] = {
294 &silk_LTP_gain_vq_0_gain[0],
295 &silk_LTP_gain_vq_1_gain[0],
296 &silk_LTP_gain_vq_2_gain[0]
297};
298
270const opus_int8 silk_LTP_vq_sizes[NB_LTP_CBKS] = { 299const opus_int8 silk_LTP_vq_sizes[NB_LTP_CBKS] = {
271 8, 16, 32 300 8, 16, 32
272}; 301};
302#endif
diff --git a/lib/rbcodec/codecs/libopus/silk/tables_NLSF_CB_NB_MB.c b/lib/rbcodec/codecs/libopus/silk/tables_NLSF_CB_NB_MB.c
index 492ed61d75..8c59d207aa 100644
--- a/lib/rbcodec/codecs/libopus/silk/tables_NLSF_CB_NB_MB.c
+++ b/lib/rbcodec/codecs/libopus/silk/tables_NLSF_CB_NB_MB.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/tables_NLSF_CB_WB.c b/lib/rbcodec/codecs/libopus/silk/tables_NLSF_CB_WB.c
index 0806d32f9e..50af87eb2e 100644
--- a/lib/rbcodec/codecs/libopus/silk/tables_NLSF_CB_WB.c
+++ b/lib/rbcodec/codecs/libopus/silk/tables_NLSF_CB_WB.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/tables_gain.c b/lib/rbcodec/codecs/libopus/silk/tables_gain.c
index 8cf7d643b2..37e41d890c 100644
--- a/lib/rbcodec/codecs/libopus/silk/tables_gain.c
+++ b/lib/rbcodec/codecs/libopus/silk/tables_gain.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/tables_other.c b/lib/rbcodec/codecs/libopus/silk/tables_other.c
index e4204f9366..398686bf26 100644
--- a/lib/rbcodec/codecs/libopus/silk/tables_other.c
+++ b/lib/rbcodec/codecs/libopus/silk/tables_other.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/tables_pitch_lag.c b/lib/rbcodec/codecs/libopus/silk/tables_pitch_lag.c
index 97869b7331..e80cc59a27 100644
--- a/lib/rbcodec/codecs/libopus/silk/tables_pitch_lag.c
+++ b/lib/rbcodec/codecs/libopus/silk/tables_pitch_lag.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/tables_pulses_per_block.c b/lib/rbcodec/codecs/libopus/silk/tables_pulses_per_block.c
index 91060572d1..c7c01c8893 100644
--- a/lib/rbcodec/codecs/libopus/silk/tables_pulses_per_block.c
+++ b/lib/rbcodec/codecs/libopus/silk/tables_pulses_per_block.c
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
diff --git a/lib/rbcodec/codecs/libopus/silk/typedef.h b/lib/rbcodec/codecs/libopus/silk/typedef.h
index 073aa28cc7..97b7e709be 100644
--- a/lib/rbcodec/codecs/libopus/silk/typedef.h
+++ b/lib/rbcodec/codecs/libopus/silk/typedef.h
@@ -8,7 +8,7 @@ this list of conditions and the following disclaimer.
8- Redistributions in binary form must reproduce the above copyright 8- Redistributions in binary form must reproduce the above copyright
9notice, this list of conditions and the following disclaimer in the 9notice, this list of conditions and the following disclaimer in the
10documentation and/or other materials provided with the distribution. 10documentation and/or other materials provided with the distribution.
11- Neither the name of Internet Society, IETF or IETF Trust, nor the 11- Neither the name of Internet Society, IETF or IETF Trust, nor the
12names of specific contributors, may be used to endorse or promote 12names of specific contributors, may be used to endorse or promote
13products derived from this software without specific prior written 13products derived from this software without specific prior written
14permission. 14permission.
@@ -29,6 +29,7 @@ POSSIBILITY OF SUCH DAMAGE.
29#define SILK_TYPEDEF_H 29#define SILK_TYPEDEF_H
30 30
31#include "opus_types.h" 31#include "opus_types.h"
32#include "opus_defines.h"
32 33
33#ifndef FIXED_POINT 34#ifndef FIXED_POINT
34# include <float.h> 35# include <float.h>
@@ -63,7 +64,7 @@ POSSIBILITY OF SUCH DAMAGE.
63#ifdef __GNUC__ 64#ifdef __GNUC__
64__attribute__((noreturn)) 65__attribute__((noreturn))
65#endif 66#endif
66static inline void _silk_fatal(const char *str, const char *file, int line) 67static OPUS_INLINE void _silk_fatal(const char *str, const char *file, int line)
67{ 68{
68 fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str); 69 fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str);
69 abort(); 70 abort();