summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2013-12-11 22:59:14 +0100
committerNils Wallménius <nils@rockbox.org>2013-12-16 21:13:23 +0100
commite3c2ed7a71f65dc721c7210f120259ecd4ff65cb (patch)
treede593c1e927dcc036f1b6656f1f881995491b3b9 /lib
parentd0918b98fa0cfba21208a4fb5ed153687b8f02c3 (diff)
downloadrockbox-e3c2ed7a71f65dc721c7210f120259ecd4ff65cb.tar.gz
rockbox-e3c2ed7a71f65dc721c7210f120259ecd4ff65cb.tar.bz2
rockbox-e3c2ed7a71f65dc721c7210f120259ecd4ff65cb.zip
Sync libopus to upstream release 1.1
Change-Id: I9fea7460fc33f60faff961b3389dd97b5191463c
Diffstat (limited to 'lib')
-rw-r--r--lib/rbcodec/codecs/libopus/SOURCES1
-rw-r--r--lib/rbcodec/codecs/libopus/celt/_kiss_fft_guts.h6
-rw-r--r--lib/rbcodec/codecs/libopus/celt/arch.h10
-rw-r--r--lib/rbcodec/codecs/libopus/celt/arm/fixed_armv4.h4
-rw-r--r--lib/rbcodec/codecs/libopus/celt/arm/fixed_armv5e.h10
-rw-r--r--lib/rbcodec/codecs/libopus/celt/bands.c28
-rw-r--r--lib/rbcodec/codecs/libopus/celt/celt.h31
-rw-r--r--lib/rbcodec/codecs/libopus/celt/celt_decoder.c19
-rw-r--r--lib/rbcodec/codecs/libopus/celt/celt_lpc.c5
-rw-r--r--lib/rbcodec/codecs/libopus/celt/celt_lpc.h3
-rw-r--r--lib/rbcodec/codecs/libopus/celt/cpu_support.h7
-rw-r--r--lib/rbcodec/codecs/libopus/celt/cwrs.c12
-rw-r--r--lib/rbcodec/codecs/libopus/celt/ecintrin.h2
-rw-r--r--lib/rbcodec/codecs/libopus/celt/entcode.h9
-rw-r--r--lib/rbcodec/codecs/libopus/celt/fixed_generic.h3
-rw-r--r--lib/rbcodec/codecs/libopus/celt/float_cast.h4
-rw-r--r--lib/rbcodec/codecs/libopus/celt/mathops.c2
-rw-r--r--lib/rbcodec/codecs/libopus/celt/mathops.h23
-rw-r--r--lib/rbcodec/codecs/libopus/celt/os_support.h9
-rw-r--r--lib/rbcodec/codecs/libopus/celt/pitch.c15
-rw-r--r--lib/rbcodec/codecs/libopus/celt/pitch.h38
-rw-r--r--lib/rbcodec/codecs/libopus/celt/quant_bands.c6
-rw-r--r--lib/rbcodec/codecs/libopus/celt/rate.c2
-rw-r--r--lib/rbcodec/codecs/libopus/celt/rate.h6
-rw-r--r--lib/rbcodec/codecs/libopus/celt/stack_alloc.h9
-rw-r--r--lib/rbcodec/codecs/libopus/config.h6
-rw-r--r--lib/rbcodec/codecs/libopus/opus.c333
-rw-r--r--lib/rbcodec/codecs/libopus/opus.h58
-rw-r--r--lib/rbcodec/codecs/libopus/opus_custom.h7
-rw-r--r--lib/rbcodec/codecs/libopus/opus_decoder.c261
-rw-r--r--lib/rbcodec/codecs/libopus/opus_defines.h23
-rw-r--r--lib/rbcodec/codecs/libopus/opus_private.h35
-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
97 files changed, 977 insertions, 578 deletions
diff --git a/lib/rbcodec/codecs/libopus/SOURCES b/lib/rbcodec/codecs/libopus/SOURCES
index 81d49f3ff1..417cf01d88 100644
--- a/lib/rbcodec/codecs/libopus/SOURCES
+++ b/lib/rbcodec/codecs/libopus/SOURCES
@@ -63,6 +63,7 @@ silk/tables_pitch_lag.c
silk/tables_pulses_per_block.c
/* OPUS sources */
+opus.c
opus_decoder.c
opus_header.c
diff --git a/lib/rbcodec/codecs/libopus/celt/_kiss_fft_guts.h b/lib/rbcodec/codecs/libopus/celt/_kiss_fft_guts.h
index 866a6520ca..cc52f37c36 100644
--- a/lib/rbcodec/codecs/libopus/celt/_kiss_fft_guts.h
+++ b/lib/rbcodec/codecs/libopus/celt/_kiss_fft_guts.h
@@ -94,15 +94,15 @@
do {(res).r = ADD32((res).r,(a).r); (res).i = SUB32((res).i,(a).i); \
}while(0)
-#if defined(ARMv4_ASM)
+#if defined(OPUS_ARM_INLINE_ASM)
#include "arm/kiss_fft_armv4.h"
#endif
-#if defined(ARMv5E_ASM)
+#if defined(OPUS_ARM_INLINE_EDSP)
#include "arm/kiss_fft_armv5e.h"
#endif
-#if defined(CF_ASM)
+#if defined(OPUS_CF_INLINE_ASM)
#include "cf/kiss_fft_cf.h"
#endif
diff --git a/lib/rbcodec/codecs/libopus/celt/arch.h b/lib/rbcodec/codecs/libopus/celt/arch.h
index c0f9413d00..b2d26c4ee4 100644
--- a/lib/rbcodec/codecs/libopus/celt/arch.h
+++ b/lib/rbcodec/codecs/libopus/celt/arch.h
@@ -35,6 +35,7 @@
#define ARCH_H
#include "opus_types.h"
+#include "opus_defines.h"
# if !defined(__GNUC_PREREQ)
# if defined(__GNUC__)&&defined(__GNUC_MINOR__)
@@ -54,7 +55,7 @@
#ifdef __GNUC__
__attribute__((noreturn))
#endif
-static inline void _celt_fatal(const char *str, const char *file, int line)
+static OPUS_INLINE void _celt_fatal(const char *str, const char *file, int line)
{
fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str);
abort();
@@ -113,9 +114,9 @@ typedef opus_val32 celt_ener;
#include "fixed_generic.h"
-#ifdef ARMv5E_ASM
+#ifdef OPUS_ARM_INLINE_EDSP
#include "arm/fixed_armv5e.h"
-#elif defined (ARMv4_ASM)
+#elif defined (OPUS_ARM_INLINE_ASM)
#include "arm/fixed_armv4.h"
#elif defined (BFIN_ASM)
#include "fixed_bfin.h"
@@ -123,7 +124,7 @@ typedef opus_val32 celt_ener;
#include "fixed_c5x.h"
#elif defined (TI_C6X_ASM)
#include "fixed_c6x.h"
-#elif defined (CF_ASM)
+#elif defined (OPUS_CF_INLINE_ASM)
#include "cf/fixed_cf.h"
#endif
@@ -187,6 +188,7 @@ typedef float celt_ener;
#define MAC16_32_Q15(c,a,b) ((c)+(a)*(b))
#define MULT16_16_Q11_32(a,b) ((a)*(b))
+#define MULT16_16_Q11(a,b) ((a)*(b))
#define MULT16_16_Q13(a,b) ((a)*(b))
#define MULT16_16_Q14(a,b) ((a)*(b))
#define MULT16_16_Q15(a,b) ((a)*(b))
diff --git a/lib/rbcodec/codecs/libopus/celt/arm/fixed_armv4.h b/lib/rbcodec/codecs/libopus/celt/arm/fixed_armv4.h
index bcacc343e8..b690bc8cea 100644
--- a/lib/rbcodec/codecs/libopus/celt/arm/fixed_armv4.h
+++ b/lib/rbcodec/codecs/libopus/celt/arm/fixed_armv4.h
@@ -29,7 +29,7 @@
/** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q16
-static inline opus_val32 MULT16_32_Q16_armv4(opus_val16 a, opus_val32 b)
+static OPUS_INLINE opus_val32 MULT16_32_Q16_armv4(opus_val16 a, opus_val32 b)
{
unsigned rd_lo;
int rd_hi;
@@ -46,7 +46,7 @@ static inline opus_val32 MULT16_32_Q16_armv4(opus_val16 a, opus_val32 b)
/** 16x32 multiplication, followed by a 15-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q15
-static inline opus_val32 MULT16_32_Q15_armv4(opus_val16 a, opus_val32 b)
+static OPUS_INLINE opus_val32 MULT16_32_Q15_armv4(opus_val16 a, opus_val32 b)
{
unsigned rd_lo;
int rd_hi;
diff --git a/lib/rbcodec/codecs/libopus/celt/arm/fixed_armv5e.h b/lib/rbcodec/codecs/libopus/celt/arm/fixed_armv5e.h
index 80632c4a94..1194a7d3ec 100644
--- a/lib/rbcodec/codecs/libopus/celt/arm/fixed_armv5e.h
+++ b/lib/rbcodec/codecs/libopus/celt/arm/fixed_armv5e.h
@@ -34,7 +34,7 @@
/** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q16
-static inline opus_val32 MULT16_32_Q16_armv5e(opus_val16 a, opus_val32 b)
+static OPUS_INLINE opus_val32 MULT16_32_Q16_armv5e(opus_val16 a, opus_val32 b)
{
int res;
__asm__(
@@ -50,7 +50,7 @@ static inline opus_val32 MULT16_32_Q16_armv5e(opus_val16 a, opus_val32 b)
/** 16x32 multiplication, followed by a 15-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q15
-static inline opus_val32 MULT16_32_Q15_armv5e(opus_val16 a, opus_val32 b)
+static OPUS_INLINE opus_val32 MULT16_32_Q15_armv5e(opus_val16 a, opus_val32 b)
{
int res;
__asm__(
@@ -68,7 +68,7 @@ static inline opus_val32 MULT16_32_Q15_armv5e(opus_val16 a, opus_val32 b)
b must fit in 31 bits.
Result fits in 32 bits. */
#undef MAC16_32_Q15
-static inline opus_val32 MAC16_32_Q15_armv5e(opus_val32 c, opus_val16 a,
+static OPUS_INLINE opus_val32 MAC16_32_Q15_armv5e(opus_val32 c, opus_val16 a,
opus_val32 b)
{
int res;
@@ -84,7 +84,7 @@ static inline opus_val32 MAC16_32_Q15_armv5e(opus_val32 c, opus_val16 a,
/** 16x16 multiply-add where the result fits in 32 bits */
#undef MAC16_16
-static inline opus_val32 MAC16_16_armv5e(opus_val32 c, opus_val16 a,
+static OPUS_INLINE opus_val32 MAC16_16_armv5e(opus_val32 c, opus_val16 a,
opus_val16 b)
{
int res;
@@ -100,7 +100,7 @@ static inline opus_val32 MAC16_16_armv5e(opus_val32 c, opus_val16 a,
/** 16x16 multiplication where the result fits in 32 bits */
#undef MULT16_16
-static inline opus_val32 MULT16_16_armv5e(opus_val16 a, opus_val16 b)
+static OPUS_INLINE opus_val32 MULT16_16_armv5e(opus_val16 a, opus_val16 b)
{
int res;
__asm__(
diff --git a/lib/rbcodec/codecs/libopus/celt/bands.c b/lib/rbcodec/codecs/libopus/celt/bands.c
index 5c715aff53..1ad786d795 100644
--- a/lib/rbcodec/codecs/libopus/celt/bands.c
+++ b/lib/rbcodec/codecs/libopus/celt/bands.c
@@ -216,7 +216,9 @@ void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X,
j=M*eBands[i];
band_end = M*eBands[i+1];
lg = ADD16(bandLogE[i+c*m->nbEBands], SHL16((opus_val16)eMeans[i],6));
-#ifdef FIXED_POINT
+#ifndef FIXED_POINT
+ g = celt_exp2(lg);
+#else
/* Handle the integer part of the log energy */
shift = 16-(lg>>DB_SHIFT);
if (shift>31)
@@ -227,9 +229,23 @@ void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X,
/* Handle the fractional part. */
g = celt_exp2_frac(lg&((1<<DB_SHIFT)-1));
}
-#else
- g = celt_exp2(lg);
+ /* Handle extreme gains with negative shift. */
+ if (shift<0)
+ {
+ /* For shift < -2 we'd be likely to overflow, so we're capping
+ the gain here. This shouldn't happen unless the bitstream is
+ already corrupted. */
+ if (shift < -2)
+ {
+ g = 32767;
+ shift = -2;
+ }
+ do {
+ *f++ = SHL32(MULT16_16(*x++, g), -shift);
+ } while (++j<band_end);
+ } else
#endif
+ /* Be careful of the fixed-point "else" just above when changing this code */
do {
*f++ = SHR32(MULT16_16(*x++, g), shift);
} while (++j<band_end);
@@ -495,7 +511,7 @@ int spreading_decision(const CELTMode *m, celt_norm *X, int *average,
*tapset_decision=0;
}
/*printf("%d %d %d\n", hf_sum, *hf_average, *tapset_decision);*/
- celt_assert(nbBands>0); /*M*(eBands[end]-eBands[end-1]) <= 8 assures this*/
+ celt_assert(nbBands>0); /* end has to be non-zero */
sum /= nbBands;
/* Recursive averaging */
sum = (sum+*average)>>1;
@@ -873,7 +889,6 @@ static unsigned quant_partition(struct band_ctx *ctx, celt_norm *X,
int q;
int curr_bits;
int imid=0, iside=0;
- int N_B=N;
int B0=B;
opus_val16 mid=0, side=0;
unsigned cm=0;
@@ -895,8 +910,6 @@ static unsigned quant_partition(struct band_ctx *ctx, celt_norm *X,
spread = ctx->spread;
ec = ctx->ec;
- N_B /= B;
-
/* If we need 1.5 more bit than we can produce, split the band in two. */
cache = m->cache.bits + m->cache.index[(LM+1)*m->nbEBands+i];
if (LM != -1 && b > cache[cache[0]]+12 && N>2)
@@ -1076,7 +1089,6 @@ static unsigned quant_band(struct band_ctx *ctx, celt_norm *X,
longBlocks = B0==1;
N_B /= B;
- N_B0 = N_B;
/* Special case for one sample */
if (N==1)
diff --git a/lib/rbcodec/codecs/libopus/celt/celt.h b/lib/rbcodec/codecs/libopus/celt/celt.h
index 0911c72f72..5deea1f0aa 100644
--- a/lib/rbcodec/codecs/libopus/celt/celt.h
+++ b/lib/rbcodec/codecs/libopus/celt/celt.h
@@ -52,11 +52,11 @@ extern "C" {
typedef struct {
int valid;
- opus_val16 tonality;
- opus_val16 tonality_slope;
- opus_val16 noisiness;
- opus_val16 activity;
- opus_val16 music_prob;
+ float tonality;
+ float tonality_slope;
+ float noisiness;
+ float activity;
+ float music_prob;
int bandwidth;
}AnalysisInfo;
@@ -66,6 +66,10 @@ typedef struct {
/* Encoder/decoder Requests */
+/* Expose this option again when variable framesize actually works */
+#define OPUS_FRAMESIZE_VARIABLE 5010 /**< Optimize the frame size dynamically */
+
+
#define CELT_SET_PREDICTION_REQUEST 10002
/** Controls the use of interframe prediction.
0=Independent frames
@@ -109,10 +113,7 @@ typedef struct {
#define OPUS_SET_LFE_REQUEST 10024
#define OPUS_SET_LFE(x) OPUS_SET_LFE_REQUEST, __opus_check_int(x)
-#define OPUS_SET_ENERGY_SAVE_REQUEST 10026
-#define OPUS_SET_ENERGY_SAVE(x) OPUS_SET_ENERGY_SAVE_REQUEST, __opus_check_val16_ptr(x)
-
-#define OPUS_SET_ENERGY_MASK_REQUEST 10028
+#define OPUS_SET_ENERGY_MASK_REQUEST 10026
#define OPUS_SET_ENERGY_MASK(x) OPUS_SET_ENERGY_MASK_REQUEST, __opus_check_val16_ptr(x)
/* Encoder stuff */
@@ -121,7 +122,8 @@ int celt_encoder_get_size(int channels);
int celt_encode_with_ec(OpusCustomEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, int frame_size, unsigned char *compressed, int nbCompressedBytes, ec_enc *enc);
-int celt_encoder_init(CELTEncoder *st, opus_int32 sampling_rate, int channels);
+int celt_encoder_init(CELTEncoder *st, opus_int32 sampling_rate, int channels,
+ int arch);
@@ -141,7 +143,7 @@ int celt_decode_with_ec(OpusCustomDecoder * OPUS_RESTRICT st, const unsigned cha
#ifdef CUSTOM_MODES
#define OPUS_CUSTOM_NOSTATIC
#else
-#define OPUS_CUSTOM_NOSTATIC static inline
+#define OPUS_CUSTOM_NOSTATIC static OPUS_INLINE
#endif
static const unsigned char trim_icdf[11] = {126, 124, 119, 109, 87, 41, 19, 9, 4, 2, 0};
@@ -166,7 +168,7 @@ static const unsigned char fromOpusTable[16] = {
0x00, 0x08, 0x10, 0x18
};
-static inline int toOpus(unsigned char c)
+static OPUS_INLINE int toOpus(unsigned char c)
{
int ret=0;
if (c<0xA0)
@@ -177,7 +179,7 @@ static inline int toOpus(unsigned char c)
return ret|(c&0x7);
}
-static inline int fromOpus(unsigned char c)
+static OPUS_INLINE int fromOpus(unsigned char c)
{
if (c<0x80)
return -1;
@@ -193,6 +195,9 @@ extern const signed char tf_select_table[4][8];
int resampling_factor(opus_int32 rate);
+void celt_preemphasis(const opus_val16 * OPUS_RESTRICT pcmp, celt_sig * OPUS_RESTRICT inp,
+ int N, int CC, int upsample, const opus_val16 *coef, celt_sig *mem, int clip);
+
void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N,
opus_val16 g0, opus_val16 g1, int tapset0, int tapset1,
const opus_val16 *window, int overlap);
diff --git a/lib/rbcodec/codecs/libopus/celt/celt_decoder.c b/lib/rbcodec/codecs/libopus/celt/celt_decoder.c
index 3d8211b9b0..77fa2d01f7 100644
--- a/lib/rbcodec/codecs/libopus/celt/celt_decoder.c
+++ b/lib/rbcodec/codecs/libopus/celt/celt_decoder.c
@@ -175,7 +175,7 @@ void opus_custom_decoder_destroy(CELTDecoder *st)
}
#endif /* CUSTOM_MODES */
-static inline opus_val16 SIG2WORD16(celt_sig x)
+static OPUS_INLINE opus_val16 SIG2WORD16(celt_sig x)
{
#ifdef FIXED_POINT
x = PSHR32(x, SIG_SHIFT);
@@ -213,7 +213,7 @@ void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, c
opus_val16 coef3 = coef[3];
for (j=0;j<N;j++)
{
- celt_sig tmp = x[j] + m;
+ celt_sig tmp = x[j] + m + VERY_SMALL;
m = MULT16_32_Q15(coef0, tmp)
- MULT16_32_Q15(coef1, x[j]);
tmp = SHL32(MULT16_32_Q15(coef3, tmp), 2);
@@ -227,7 +227,7 @@ void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, c
/* Shortcut for the standard (non-custom modes) case */
for (j=0;j<N;j++)
{
- celt_sig tmp = x[j] + m;
+ celt_sig tmp = x[j] + m + VERY_SMALL;
m = MULT16_32_Q15(coef0, tmp);
scratch[j] = tmp;
}
@@ -447,10 +447,11 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, opus_val16 * OPUS_R
{
VARDECL( opus_val16, lp_pitch_buf );
ALLOC( lp_pitch_buf, DECODE_BUFFER_SIZE>>1, opus_val16 );
- pitch_downsample(decode_mem, lp_pitch_buf, DECODE_BUFFER_SIZE, C);
+ pitch_downsample(decode_mem, lp_pitch_buf,
+ DECODE_BUFFER_SIZE, C, st->arch);
pitch_search(lp_pitch_buf+(PLC_PITCH_LAG_MAX>>1), lp_pitch_buf,
DECODE_BUFFER_SIZE-PLC_PITCH_LAG_MAX,
- PLC_PITCH_LAG_MAX-PLC_PITCH_LAG_MIN, &pitch_index);
+ PLC_PITCH_LAG_MAX-PLC_PITCH_LAG_MIN, &pitch_index, st->arch);
pitch_index = PLC_PITCH_LAG_MAX-pitch_index;
st->last_pitch_index = pitch_index;
} else {
@@ -481,7 +482,8 @@ static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, opus_val16 * OPUS_R
opus_val32 ac[LPC_ORDER+1];
/* Compute LPC coefficients for the last MAX_PERIOD samples before
the first loss so we can work in the excitation-filter domain. */
- _celt_autocorr(exc, ac, window, overlap, LPC_ORDER, MAX_PERIOD);
+ _celt_autocorr(exc, ac, window, overlap,
+ LPC_ORDER, MAX_PERIOD, st->arch);
/* Add a noise floor of -40 dB. */
#ifdef FIXED_POINT
ac[0] += SHR32(ac[0],13);
@@ -668,7 +670,6 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat
VARDECL(int, fine_priority);
VARDECL(int, tf_res);
VARDECL(unsigned char, collapse_masks);
- celt_sig *out_mem[2] = {NULL, NULL};
celt_sig *decode_mem[2];
celt_sig *out_syn[2];
opus_val16 *lpc;
@@ -709,7 +710,6 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat
c=0; do {
decode_mem[c] = st->_decode_mem + c*(DECODE_BUFFER_SIZE+overlap);
- out_mem[c] = decode_mem[c]+DECODE_BUFFER_SIZE-MAX_PERIOD;
} while (++c<CC);
lpc = (opus_val16*)(st->_decode_mem+(DECODE_BUFFER_SIZE+overlap)*CC);
oldBandE = lpc+CC*LPC_ORDER;
@@ -934,7 +934,6 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat
/* Synthesis */
denormalise_bands(mode, X, freq, oldBandE, st->start, effEnd, C, M);
}
-
c=0; do {
OPUS_MOVE(decode_mem[c], decode_mem[c]+N, DECODE_BUFFER_SIZE-N+overlap/2);
} while (++c<CC);
@@ -948,7 +947,7 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat
} while (++c<C);
c=0; do {
- out_syn[c] = out_mem[c]+MAX_PERIOD-N;
+ out_syn[c] = decode_mem[c]+DECODE_BUFFER_SIZE-N;
} while (++c<CC);
if (CC==2&&C==1)
diff --git a/lib/rbcodec/codecs/libopus/celt/celt_lpc.c b/lib/rbcodec/codecs/libopus/celt/celt_lpc.c
index 7ffe90a357..fa29d626ea 100644
--- a/lib/rbcodec/codecs/libopus/celt/celt_lpc.c
+++ b/lib/rbcodec/codecs/libopus/celt/celt_lpc.c
@@ -226,7 +226,8 @@ int _celt_autocorr(
const opus_val16 *window,
int overlap,
int lag,
- int n
+ int n,
+ int arch
)
{
opus_val32 d;
@@ -275,7 +276,7 @@ int _celt_autocorr(
shift = 0;
}
#endif
- celt_pitch_xcorr(xptr, xptr, ac, fastN, lag+1);
+ celt_pitch_xcorr(xptr, xptr, ac, fastN, lag+1, arch);
for (k=0;k<=lag;k++)
{
for (i = k+fastN, d = 0; i < n; i++)
diff --git a/lib/rbcodec/codecs/libopus/celt/celt_lpc.h b/lib/rbcodec/codecs/libopus/celt/celt_lpc.h
index 19279a0ed6..dc2a0a3d26 100644
--- a/lib/rbcodec/codecs/libopus/celt/celt_lpc.h
+++ b/lib/rbcodec/codecs/libopus/celt/celt_lpc.h
@@ -48,6 +48,7 @@ void celt_iir(const opus_val32 *x,
int ord,
opus_val16 *mem);
-int _celt_autocorr(const opus_val16 *x, opus_val32 *ac, const opus_val16 *window, int overlap, int lag, int n);
+int _celt_autocorr(const opus_val16 *x, opus_val32 *ac,
+ const opus_val16 *window, int overlap, int lag, int n, int arch);
#endif /* PLC_H */
diff --git a/lib/rbcodec/codecs/libopus/celt/cpu_support.h b/lib/rbcodec/codecs/libopus/celt/cpu_support.h
index 41481feb9c..d68dbe62c5 100644
--- a/lib/rbcodec/codecs/libopus/celt/cpu_support.h
+++ b/lib/rbcodec/codecs/libopus/celt/cpu_support.h
@@ -28,7 +28,10 @@
#ifndef CPU_SUPPORT_H
#define CPU_SUPPORT_H
-#if defined(OPUS_HAVE_RTCD) && defined(ARMv4_ASM)
+#include "opus_types.h"
+#include "opus_defines.h"
+
+#if defined(OPUS_HAVE_RTCD) && defined(OPUS_ARM_ASM)
#include "arm/armcpu.h"
/* We currently support 4 ARM variants:
@@ -42,7 +45,7 @@
#else
#define OPUS_ARCHMASK 0
-static inline int opus_select_arch(void)
+static OPUS_INLINE int opus_select_arch(void)
{
return 0;
}
diff --git a/lib/rbcodec/codecs/libopus/celt/cwrs.c b/lib/rbcodec/codecs/libopus/celt/cwrs.c
index eb8fa1c807..03b86985d2 100644
--- a/lib/rbcodec/codecs/libopus/celt/cwrs.c
+++ b/lib/rbcodec/codecs/libopus/celt/cwrs.c
@@ -410,7 +410,7 @@ static const opus_uint32 CELT_PVQ_U_DATA[1272] ICONST_ATTR ={
};
#if defined(CUSTOM_MODES)
-const opus_uint32 *const CELT_PVQ_U_ROW[15]={
+static const opus_uint32 *const CELT_PVQ_U_ROW[15]={
CELT_PVQ_U_DATA+ 0,CELT_PVQ_U_DATA+ 208,CELT_PVQ_U_DATA+ 415,
CELT_PVQ_U_DATA+ 621,CELT_PVQ_U_DATA+ 826,CELT_PVQ_U_DATA+1030,
CELT_PVQ_U_DATA+1233,CELT_PVQ_U_DATA+1336,CELT_PVQ_U_DATA+1389,
@@ -418,7 +418,7 @@ const opus_uint32 *const CELT_PVQ_U_ROW[15]={
CELT_PVQ_U_DATA+1464,CELT_PVQ_U_DATA+1470,CELT_PVQ_U_DATA+1473
};
#else
-const opus_uint32 *const CELT_PVQ_U_ROW[15]={
+static const opus_uint32 *const CELT_PVQ_U_ROW[15]={
CELT_PVQ_U_DATA+ 0,CELT_PVQ_U_DATA+ 176,CELT_PVQ_U_DATA+ 351,
CELT_PVQ_U_DATA+ 525,CELT_PVQ_U_DATA+ 698,CELT_PVQ_U_DATA+ 870,
CELT_PVQ_U_DATA+1041,CELT_PVQ_U_DATA+1131,CELT_PVQ_U_DATA+1178,
@@ -534,7 +534,7 @@ void decode_pulses(int *_y,int _n,int _k,ec_dec *_dec){
/*Computes the next row/column of any recurrence that obeys the relation
u[i][j]=u[i-1][j]+u[i][j-1]+u[i-1][j-1].
_ui0 is the base case for the new row/column.*/
-static inline void unext(opus_uint32 *_ui,unsigned _len,opus_uint32 _ui0){
+static OPUS_INLINE void unext(opus_uint32 *_ui,unsigned _len,opus_uint32 _ui0){
opus_uint32 ui1;
unsigned j;
/*This do-while will overrun the array if we don't have storage for at least
@@ -550,7 +550,7 @@ static inline void unext(opus_uint32 *_ui,unsigned _len,opus_uint32 _ui0){
/*Computes the previous row/column of any recurrence that obeys the relation
u[i-1][j]=u[i][j]-u[i][j-1]-u[i-1][j-1].
_ui0 is the base case for the new row/column.*/
-static inline void uprev(opus_uint32 *_ui,unsigned _n,opus_uint32 _ui0){
+static OPUS_INLINE void uprev(opus_uint32 *_ui,unsigned _n,opus_uint32 _ui0){
opus_uint32 ui1;
unsigned j;
/*This do-while will overrun the array if we don't have storage for at least
@@ -617,7 +617,7 @@ static void cwrsi(int _n,int _k,opus_uint32 _i,int *_y,opus_uint32 *_u){
of size 1 with associated sign bits.
_y: The vector of pulses, whose sum of absolute values is K.
_k: Returns K.*/
-static inline opus_uint32 icwrs1(const int *_y,int *_k){
+static OPUS_INLINE opus_uint32 icwrs1(const int *_y,int *_k){
*_k=abs(_y[0]);
return _y[0]<0;
}
@@ -626,7 +626,7 @@ static inline opus_uint32 icwrs1(const int *_y,int *_k){
of size _n with associated sign bits.
_y: The vector of pulses, whose sum of absolute values must be _k.
_nc: Returns V(_n,_k).*/
-static inline opus_uint32 icwrs(int _n,int _k,opus_uint32 *_nc,const int *_y,
+static OPUS_INLINE opus_uint32 icwrs(int _n,int _k,opus_uint32 *_nc,const int *_y,
opus_uint32 *_u){
opus_uint32 i;
int j;
diff --git a/lib/rbcodec/codecs/libopus/celt/ecintrin.h b/lib/rbcodec/codecs/libopus/celt/ecintrin.h
index be57dd40de..2263cff6bd 100644
--- a/lib/rbcodec/codecs/libopus/celt/ecintrin.h
+++ b/lib/rbcodec/codecs/libopus/celt/ecintrin.h
@@ -33,7 +33,7 @@
#if !defined(_ecintrin_H)
# define _ecintrin_H (1)
-/*Some specific platforms may have optimized intrinsic or inline assembly
+/*Some specific platforms may have optimized intrinsic or OPUS_INLINE assembly
versions of these functions which can substantially improve performance.
We define macros for them to allow easy incorporation of these non-ANSI
features.*/
diff --git a/lib/rbcodec/codecs/libopus/celt/entcode.h b/lib/rbcodec/codecs/libopus/celt/entcode.h
index aebecc0647..dd13e49e50 100644
--- a/lib/rbcodec/codecs/libopus/celt/entcode.h
+++ b/lib/rbcodec/codecs/libopus/celt/entcode.h
@@ -26,6 +26,7 @@
*/
#include "opus_types.h"
+#include "opus_defines.h"
#if !defined(_entcode_H)
# define _entcode_H (1)
@@ -83,15 +84,15 @@ struct ec_ctx{
int error;
};
-static inline opus_uint32 ec_range_bytes(ec_ctx *_this){
+static OPUS_INLINE opus_uint32 ec_range_bytes(ec_ctx *_this){
return _this->offs;
}
-static inline unsigned char *ec_get_buffer(ec_ctx *_this){
+static OPUS_INLINE unsigned char *ec_get_buffer(ec_ctx *_this){
return _this->buf;
}
-static inline int ec_get_error(ec_ctx *_this){
+static OPUS_INLINE int ec_get_error(ec_ctx *_this){
return _this->error;
}
@@ -101,7 +102,7 @@ static inline int ec_get_error(ec_ctx *_this){
Return: The number of bits.
This will always be slightly larger than the exact value (e.g., all
rounding error is in the positive direction).*/
-static inline int ec_tell(ec_ctx *_this){
+static OPUS_INLINE int ec_tell(ec_ctx *_this){
return _this->nbits_total-EC_ILOG(_this->rng);
}
diff --git a/lib/rbcodec/codecs/libopus/celt/fixed_generic.h b/lib/rbcodec/codecs/libopus/celt/fixed_generic.h
index 0e77976e83..ecf018a244 100644
--- a/lib/rbcodec/codecs/libopus/celt/fixed_generic.h
+++ b/lib/rbcodec/codecs/libopus/celt/fixed_generic.h
@@ -40,7 +40,7 @@
#define MULT16_32_Q16(a,b) ADD32(MULT16_16((a),SHR((b),16)), SHR(MULT16_16SU((a),((b)&0x0000ffff)),16))
/** 16x32 multiplication, followed by a 16-bit shift right (round-to-nearest). Results fits in 32 bits */
-#define MULT16_32_P16(a,b) ADD32(MULT16_16((a),SHR((b),16)), PSHR(MULT16_16((a),((b)&0x0000ffff)),16))
+#define MULT16_32_P16(a,b) ADD32(MULT16_16((a),SHR((b),16)), PSHR(MULT16_16SU((a),((b)&0x0000ffff)),16))
/** 16x32 multiplication, followed by a 15-bit shift right. Results fits in 32 bits */
#define MULT16_32_Q15(a,b) ADD32(SHL(MULT16_16((a),SHR((b),16)),1), SHR(MULT16_16SU((a),((b)&0x0000ffff)),15))
@@ -116,6 +116,7 @@
#define MAC16_32_Q15(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15)))
#define MULT16_16_Q11_32(a,b) (SHR(MULT16_16((a),(b)),11))
+#define MULT16_16_Q11(a,b) (SHR(MULT16_16((a),(b)),11))
#define MULT16_16_Q13(a,b) (SHR(MULT16_16((a),(b)),13))
#define MULT16_16_Q14(a,b) (SHR(MULT16_16((a),(b)),14))
#define MULT16_16_Q15(a,b) (SHR(MULT16_16((a),(b)),15))
diff --git a/lib/rbcodec/codecs/libopus/celt/float_cast.h b/lib/rbcodec/codecs/libopus/celt/float_cast.h
index 5ded291599..ede6574860 100644
--- a/lib/rbcodec/codecs/libopus/celt/float_cast.h
+++ b/lib/rbcodec/codecs/libopus/celt/float_cast.h
@@ -101,7 +101,7 @@
#include <math.h>
/* Win32 doesn't seem to have these functions.
- ** Therefore implement inline versions of these functions here.
+ ** Therefore implement OPUS_INLINE versions of these functions here.
*/
__inline long int
@@ -128,7 +128,7 @@
#endif
#ifndef DISABLE_FLOAT_API
-static inline opus_int16 FLOAT2INT16(float x)
+static OPUS_INLINE opus_int16 FLOAT2INT16(float x)
{
x = x*CELT_SIG_SCALE;
x = MAX32(x, -32768);
diff --git a/lib/rbcodec/codecs/libopus/celt/mathops.c b/lib/rbcodec/codecs/libopus/celt/mathops.c
index 21fd942960..3f8c5dcc0e 100644
--- a/lib/rbcodec/codecs/libopus/celt/mathops.c
+++ b/lib/rbcodec/codecs/libopus/celt/mathops.c
@@ -139,7 +139,7 @@ opus_val32 celt_sqrt(opus_val32 x)
#define L3 8277
#define L4 -626
-static inline opus_val16 _celt_cos_pi_2(opus_val16 x)
+static OPUS_INLINE opus_val16 _celt_cos_pi_2(opus_val16 x)
{
opus_val16 x2;
diff --git a/lib/rbcodec/codecs/libopus/celt/mathops.h b/lib/rbcodec/codecs/libopus/celt/mathops.h
index 44fa97c697..a0525a9610 100644
--- a/lib/rbcodec/codecs/libopus/celt/mathops.h
+++ b/lib/rbcodec/codecs/libopus/celt/mathops.h
@@ -44,7 +44,7 @@
unsigned isqrt32(opus_uint32 _val);
#ifndef OVERRIDE_CELT_MAXABS16
-static inline opus_val32 celt_maxabs16(const opus_val16 *x, int len)
+static OPUS_INLINE opus_val32 celt_maxabs16(const opus_val16 *x, int len)
{
int i;
opus_val16 maxval = 0;
@@ -60,7 +60,7 @@ static inline opus_val32 celt_maxabs16(const opus_val16 *x, int len)
#ifndef OVERRIDE_CELT_MAXABS32
#ifdef FIXED_POINT
-static inline opus_val32 celt_maxabs32(const opus_val32 *x, int len)
+static OPUS_INLINE opus_val32 celt_maxabs32(const opus_val32 *x, int len)
{
int i;
opus_val32 maxval = 0;
@@ -95,7 +95,7 @@ static inline opus_val32 celt_maxabs32(const opus_val32 *x, int len)
denorm, +/- inf and NaN are *not* handled */
/** Base-2 log approximation (log2(x)). */
-static inline float celt_log2(float x)
+static OPUS_INLINE float celt_log2(float x)
{
int integer;
float frac;
@@ -113,7 +113,7 @@ static inline float celt_log2(float x)
}
/** Base-2 exponential approximation (2^x). */
-static inline float celt_exp2(float x)
+static OPUS_INLINE float celt_exp2(float x)
{
int integer;
float frac;
@@ -145,7 +145,7 @@ static inline float celt_exp2(float x)
#ifndef OVERRIDE_CELT_ILOG2
/** Integer log in base2. Undefined for zero and negative numbers */
-static inline opus_int16 celt_ilog2(opus_int32 x)
+static OPUS_INLINE opus_int16 celt_ilog2(opus_int32 x)
{
celt_assert2(x>0, "celt_ilog2() only defined for strictly positive numbers");
return EC_ILOG(x)-1;
@@ -154,7 +154,7 @@ static inline opus_int16 celt_ilog2(opus_int32 x)
/** Integer log in base2. Defined for zero, but not for negative numbers */
-static inline opus_int16 celt_zlog2(opus_val32 x)
+static OPUS_INLINE opus_int16 celt_zlog2(opus_val32 x)
{
return x <= 0 ? 0 : celt_ilog2(x);
}
@@ -165,7 +165,8 @@ opus_val32 celt_sqrt(opus_val32 x);
opus_val16 celt_cos_norm(opus_val32 x);
-static inline opus_val16 celt_log2(opus_val32 x)
+/** Base-2 logarithm approximation (log2(x)). (Q14 input, Q10 output) */
+static OPUS_INLINE opus_val16 celt_log2(opus_val32 x)
{
int i;
opus_val16 n, frac;
@@ -191,14 +192,14 @@ static inline opus_val16 celt_log2(opus_val32 x)
#define D2 14819
#define D3 10204
-static inline opus_val32 celt_exp2_frac(opus_val16 x)
+static OPUS_INLINE opus_val32 celt_exp2_frac(opus_val16 x)
{
opus_val16 frac;
frac = SHL16(x, 4);
return ADD16(D0, MULT16_16_Q15(frac, ADD16(D1, MULT16_16_Q15(frac, ADD16(D2 , MULT16_16_Q15(D3,frac))))));
}
/** Base-2 exponential approximation (2^x). (Q10 input, Q16 output) */
-static inline opus_val32 celt_exp2(opus_val16 x)
+static OPUS_INLINE opus_val32 celt_exp2(opus_val16 x)
{
int integer;
opus_val16 frac;
@@ -224,7 +225,7 @@ opus_val32 frac_div32(opus_val32 a, opus_val32 b);
/* Atan approximation using a 4th order polynomial. Input is in Q15 format
and normalized by pi/4. Output is in Q15 format */
-static inline opus_val16 celt_atan01(opus_val16 x)
+static OPUS_INLINE opus_val16 celt_atan01(opus_val16 x)
{
return MULT16_16_P15(x, ADD32(M1, MULT16_16_P15(x, ADD32(M2, MULT16_16_P15(x, ADD32(M3, MULT16_16_P15(M4, x)))))));
}
@@ -235,7 +236,7 @@ static inline opus_val16 celt_atan01(opus_val16 x)
#undef M4
/* atan2() approximation valid for positive input values */
-static inline opus_val16 celt_atan2p(opus_val16 y, opus_val16 x)
+static OPUS_INLINE opus_val16 celt_atan2p(opus_val16 y, opus_val16 x)
{
if (y < x)
{
diff --git a/lib/rbcodec/codecs/libopus/celt/os_support.h b/lib/rbcodec/codecs/libopus/celt/os_support.h
index 2484f0b2f7..5e47e3cff9 100644
--- a/lib/rbcodec/codecs/libopus/celt/os_support.h
+++ b/lib/rbcodec/codecs/libopus/celt/os_support.h
@@ -35,13 +35,16 @@
# include "custom_support.h"
#endif
+#include "opus_types.h"
+#include "opus_defines.h"
+
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
/** Opus wrapper for malloc(). To do your own dynamic allocation, all you need to do is replace this function and opus_free */
#ifndef OVERRIDE_OPUS_ALLOC
-static inline void *opus_alloc (size_t size)
+static OPUS_INLINE void *opus_alloc (size_t size)
{
return malloc(size);
}
@@ -49,7 +52,7 @@ static inline void *opus_alloc (size_t size)
/** Same as celt_alloc(), except that the area is only needed inside a CELT call (might cause problem with wideband though) */
#ifndef OVERRIDE_OPUS_ALLOC_SCRATCH
-static inline void *opus_alloc_scratch (size_t size)
+static OPUS_INLINE void *opus_alloc_scratch (size_t size)
{
/* Scratch space doesn't need to be cleared */
return opus_alloc(size);
@@ -58,7 +61,7 @@ static inline void *opus_alloc_scratch (size_t size)
/** Opus wrapper for free(). To do your own dynamic allocation, all you need to do is replace this function and opus_alloc */
#ifndef OVERRIDE_OPUS_FREE
-static inline void opus_free (void *ptr)
+static OPUS_INLINE void opus_free (void *ptr)
{
free(ptr);
}
diff --git a/lib/rbcodec/codecs/libopus/celt/pitch.c b/lib/rbcodec/codecs/libopus/celt/pitch.c
index 0d8be13025..c28857297a 100644
--- a/lib/rbcodec/codecs/libopus/celt/pitch.c
+++ b/lib/rbcodec/codecs/libopus/celt/pitch.c
@@ -145,7 +145,7 @@ static void celt_fir5(const opus_val16 *x,
void pitch_downsample(celt_sig * OPUS_RESTRICT x[], opus_val16 * OPUS_RESTRICT x_lp,
- int len, int C)
+ int len, int C, int arch)
{
int i;
opus_val32 ac[5];
@@ -180,7 +180,7 @@ void pitch_downsample(celt_sig * OPUS_RESTRICT x[], opus_val16 * OPUS_RESTRICT x
}
_celt_autocorr(x_lp, ac, NULL, 0,
- 4, len>>1);
+ 4, len>>1, arch);
/* Noise floor -40 dB */
#ifdef FIXED_POINT
@@ -250,9 +250,14 @@ opus_val32
#else
void
#endif
-celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y, opus_val32 *xcorr, int len, int max_pitch)
+celt_pitch_xcorr_c(const opus_val16 *_x, const opus_val16 *_y, opus_val32 *xcorr, int len, int max_pitch)
{
int i,j;
+ /*The EDSP version requires that max_pitch is at least 1, and that _x is
+ 32-bit aligned.
+ Since it's hard to put asserts in assembly, put them here.*/
+ celt_assert(max_pitch>0);
+ celt_assert((((unsigned char *)_x-(unsigned char *)NULL)&3)==0);
#ifdef FIXED_POINT
opus_val32 maxcorr=1;
#endif
@@ -289,7 +294,7 @@ celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y, opus_val32 *xcorr,
#endif
void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTRICT y,
- int len, int max_pitch, int *pitch)
+ int len, int max_pitch, int *pitch, int arch)
{
int i, j;
int lag;
@@ -342,7 +347,7 @@ void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTR
#ifdef FIXED_POINT
maxcorr =
#endif
- celt_pitch_xcorr(x_lp4, y_lp4, xcorr, len>>2, max_pitch>>2);
+ celt_pitch_xcorr(x_lp4, y_lp4, xcorr, len>>2, max_pitch>>2, arch);
find_best_pitch(xcorr, y_lp4, len>>2, max_pitch>>2, best_pitch
#ifdef FIXED_POINT
diff --git a/lib/rbcodec/codecs/libopus/celt/pitch.h b/lib/rbcodec/codecs/libopus/celt/pitch.h
index caffd24bc4..df317ecc1d 100644
--- a/lib/rbcodec/codecs/libopus/celt/pitch.h
+++ b/lib/rbcodec/codecs/libopus/celt/pitch.h
@@ -35,16 +35,21 @@
#define PITCH_H
#include "modes.h"
+#include "cpu_support.h"
#if defined(__SSE__) && !defined(FIXED_POINT)
#include "x86/pitch_sse.h"
#endif
+#if defined(OPUS_ARM_ASM) && defined(FIXED_POINT)
+# include "arm/pitch_arm.h"
+#endif
+
void pitch_downsample(celt_sig * OPUS_RESTRICT x[], opus_val16 * OPUS_RESTRICT x_lp,
- int len, int C);
+ int len, int C, int arch);
void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTRICT y,
- int len, int max_pitch, int *pitch);
+ int len, int max_pitch, int *pitch, int arch);
opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
int N, int *T0, int prev_period, opus_val16 prev_gain);
@@ -52,10 +57,11 @@ opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
/* OPT: This is the kernel you really want to optimize. It gets used a lot
by the prefilter and by the PLC. */
#ifndef OVERRIDE_XCORR_KERNEL
-static inline void xcorr_kernel(const opus_val16 * x, const opus_val16 * y, opus_val32 sum[4], int len)
+static OPUS_INLINE void xcorr_kernel(const opus_val16 * x, const opus_val16 * y, opus_val32 sum[4], int len)
{
int j;
opus_val16 y_0, y_1, y_2, y_3;
+ celt_assert(len>=3);
y_3=0; /* gcc doesn't realize that y_3 can't be used uninitialized */
y_0=*y++;
y_1=*y++;
@@ -119,7 +125,7 @@ static inline void xcorr_kernel(const opus_val16 * x, const opus_val16 * y, opus
#endif /* OVERRIDE_XCORR_KERNEL */
#ifndef OVERRIDE_DUAL_INNER_PROD
-static inline void dual_inner_prod(const opus_val16 *x, const opus_val16 *y01, const opus_val16 *y02,
+static OPUS_INLINE void dual_inner_prod(const opus_val16 *x, const opus_val16 *y01, const opus_val16 *y02,
int N, opus_val32 *xy1, opus_val32 *xy2)
{
int i;
@@ -140,6 +146,28 @@ opus_val32
#else
void
#endif
-celt_pitch_xcorr(const opus_val16 *_x, const opus_val16 *_y, opus_val32 *xcorr, int len, int max_pitch);
+celt_pitch_xcorr_c(const opus_val16 *_x, const opus_val16 *_y,
+ opus_val32 *xcorr, int len, int max_pitch);
+
+#if !defined(OVERRIDE_PITCH_XCORR)
+/*Is run-time CPU detection enabled on this platform?*/
+# if defined(OPUS_HAVE_RTCD)
+extern
+# if defined(FIXED_POINT)
+opus_val32
+# else
+void
+# endif
+(*const CELT_PITCH_XCORR_IMPL[OPUS_ARCHMASK+1])(const opus_val16 *,
+ const opus_val16 *, opus_val32 *, int, int);
+
+# define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \
+ ((*CELT_PITCH_XCORR_IMPL[(arch)&OPUS_ARCHMASK])(_x, _y, \
+ xcorr, len, max_pitch))
+# else
+# define celt_pitch_xcorr(_x, _y, xcorr, len, max_pitch, arch) \
+ ((void)(arch),celt_pitch_xcorr_c(_x, _y, xcorr, len, max_pitch))
+# endif
+#endif
#endif
diff --git a/lib/rbcodec/codecs/libopus/celt/quant_bands.c b/lib/rbcodec/codecs/libopus/celt/quant_bands.c
index 79685e17cb..ac6952c266 100644
--- a/lib/rbcodec/codecs/libopus/celt/quant_bands.c
+++ b/lib/rbcodec/codecs/libopus/celt/quant_bands.c
@@ -312,6 +312,7 @@ void quant_coarse_energy(const CELTMode *m, int start, int end, int effEnd,
opus_int32 tell_intra;
opus_uint32 nstart_bytes;
opus_uint32 nintra_bytes;
+ opus_uint32 save_bytes;
int badness2;
VARDECL(unsigned char, intra_bits);
@@ -322,7 +323,10 @@ void quant_coarse_energy(const CELTMode *m, int start, int end, int effEnd,
nstart_bytes = ec_range_bytes(&enc_start_state);
nintra_bytes = ec_range_bytes(&enc_intra_state);
intra_buf = ec_get_buffer(&enc_intra_state) + nstart_bytes;
- ALLOC(intra_bits, nintra_bytes-nstart_bytes, unsigned char);
+ save_bytes = nintra_bytes-nstart_bytes;
+ if (save_bytes == 0)
+ save_bytes = ALLOC_NONE;
+ ALLOC(intra_bits, save_bytes, unsigned char);
/* Copy bits from intra bit-stream */
OPUS_COPY(intra_bits, intra_buf, nintra_bytes - nstart_bytes);
diff --git a/lib/rbcodec/codecs/libopus/celt/rate.c b/lib/rbcodec/codecs/libopus/celt/rate.c
index e474cf5004..e13d839d63 100644
--- a/lib/rbcodec/codecs/libopus/celt/rate.c
+++ b/lib/rbcodec/codecs/libopus/celt/rate.c
@@ -245,7 +245,7 @@ void compute_pulse_cache(CELTMode *m, int LM)
#define ALLOC_STEPS 6
-static inline int interp_bits2pulses(const CELTMode *m, int start, int end, int skip_start,
+static OPUS_INLINE int interp_bits2pulses(const CELTMode *m, int start, int end, int skip_start,
const int *bits1, const int *bits2, const int *thresh, const int *cap, opus_int32 total, opus_int32 *_balance,
int skip_rsv, int *intensity, int intensity_rsv, int *dual_stereo, int dual_stereo_rsv, int *bits,
int *ebits, int *fine_priority, int C, int LM, ec_ctx *ec, int encode, int prev, int signalBandwidth)
diff --git a/lib/rbcodec/codecs/libopus/celt/rate.h b/lib/rbcodec/codecs/libopus/celt/rate.h
index 263fde9820..f1e0661129 100644
--- a/lib/rbcodec/codecs/libopus/celt/rate.h
+++ b/lib/rbcodec/codecs/libopus/celt/rate.h
@@ -45,12 +45,12 @@
void compute_pulse_cache(CELTMode *m, int LM);
-static inline int get_pulses(int i)
+static OPUS_INLINE int get_pulses(int i)
{
return i<8 ? i : (8 + (i&7)) << ((i>>3)-1);
}
-static inline int bits2pulses(const CELTMode *m, int band, int LM, int bits)
+static OPUS_INLINE int bits2pulses(const CELTMode *m, int band, int LM, int bits)
{
int i;
int lo, hi;
@@ -77,7 +77,7 @@ static inline int bits2pulses(const CELTMode *m, int band, int LM, int bits)
return hi;
}
-static inline int pulses2bits(const CELTMode *m, int band, int LM, int pulses)
+static OPUS_INLINE int pulses2bits(const CELTMode *m, int band, int LM, int pulses)
{
const unsigned char *cache;
diff --git a/lib/rbcodec/codecs/libopus/celt/stack_alloc.h b/lib/rbcodec/codecs/libopus/celt/stack_alloc.h
index 1c093a8cdc..316a6ce12c 100644
--- a/lib/rbcodec/codecs/libopus/celt/stack_alloc.h
+++ b/lib/rbcodec/codecs/libopus/celt/stack_alloc.h
@@ -32,6 +32,9 @@
#ifndef STACK_ALLOC_H
#define STACK_ALLOC_H
+#include "opus_types.h"
+#include "opus_defines.h"
+
#if (!defined (VAR_ARRAYS) && !defined (USE_ALLOCA) && !defined (NONTHREADSAFE_PSEUDOSTACK))
#error "Opus requires one of VAR_ARRAYS, USE_ALLOCA, or NONTHREADSAFE_PSEUDOSTACK be defined to select the temporary allocation mode."
#endif
@@ -92,6 +95,8 @@
#define SAVE_STACK
#define RESTORE_STACK
#define ALLOC_STACK
+/* C99 does not allow VLAs of size zero */
+#define ALLOC_NONE 1
#elif defined(USE_ALLOCA)
@@ -106,6 +111,7 @@
#define SAVE_STACK
#define RESTORE_STACK
#define ALLOC_STACK
+#define ALLOC_NONE 0
#else
@@ -143,6 +149,7 @@ extern char *global_stack_top;
#define VARDECL(type, var) type *var
#define ALLOC(var, size, type) var = PUSH(global_stack, size, type)
#define SAVE_STACK char *_saved_stack = global_stack;
+#define ALLOC_NONE 0
#endif /* VAR_ARRAYS */
@@ -159,7 +166,7 @@ extern char *global_stack_top;
#else
-static inline int _opus_false(void) {return 0;}
+static OPUS_INLINE int _opus_false(void) {return 0;}
#define OPUS_CHECK_ARRAY(ptr, len) _opus_false()
#define OPUS_CHECK_VALUE(value) _opus_false()
#define OPUS_PRINT_INT(value) do{}while(0)
diff --git a/lib/rbcodec/codecs/libopus/config.h b/lib/rbcodec/codecs/libopus/config.h
index e2d9b1e9aa..1ce75ff590 100644
--- a/lib/rbcodec/codecs/libopus/config.h
+++ b/lib/rbcodec/codecs/libopus/config.h
@@ -41,14 +41,14 @@
#if defined(CPU_ARM)
#if ARM_ARCH == 4
-#define ARMv4_ASM
+#define OPUS_ARM_INLINE_ASM
#elif ARM_ARCH > 4
-#define ARMv5E_ASM
+#define OPUS_ARM_INLINE_EDSP
#endif
#endif
#if defined(CPU_COLDFIRE)
-#define CF_ASM
+#define OPUS_CF_INLINE_ASM
#endif
#endif /* CONFIG_H */
diff --git a/lib/rbcodec/codecs/libopus/opus.c b/lib/rbcodec/codecs/libopus/opus.c
new file mode 100644
index 0000000000..989c6537cb
--- /dev/null
+++ b/lib/rbcodec/codecs/libopus/opus.c
@@ -0,0 +1,333 @@
+/* Copyright (c) 2011 Xiph.Org Foundation, Skype Limited
+ Written by Jean-Marc Valin and Koen Vos */
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "opus.h"
+#include "opus_private.h"
+
+#ifndef DISABLE_FLOAT_API
+OPUS_EXPORT void opus_pcm_soft_clip(float *_x, int N, int C, float *declip_mem)
+{
+ int c;
+ int i;
+ float *x;
+
+ if (C<1 || N<1 || !_x || !declip_mem) return;
+
+ /* First thing: saturate everything to +/- 2 which is the highest level our
+ non-linearity can handle. At the point where the signal reaches +/-2,
+ the derivative will be zero anyway, so this doesn't introduce any
+ discontinuity in the derivative. */
+ for (i=0;i<N*C;i++)
+ _x[i] = MAX16(-2.f, MIN16(2.f, _x[i]));
+ for (c=0;c<C;c++)
+ {
+ float a;
+ float x0;
+ int curr;
+
+ x = _x+c;
+ a = declip_mem[c];
+ /* Continue applying the non-linearity from the previous frame to avoid
+ any discontinuity. */
+ for (i=0;i<N;i++)
+ {
+ if (x[i*C]*a>=0)
+ break;
+ x[i*C] = x[i*C]+a*x[i*C]*x[i*C];
+ }
+
+ curr=0;
+ x0 = x[0];
+ while(1)
+ {
+ int start, end;
+ float maxval;
+ int special=0;
+ int peak_pos;
+ for (i=curr;i<N;i++)
+ {
+ if (x[i*C]>1 || x[i*C]<-1)
+ break;
+ }
+ if (i==N)
+ {
+ a=0;
+ break;
+ }
+ peak_pos = i;
+ start=end=i;
+ maxval=ABS16(x[i*C]);
+ /* Look for first zero crossing before clipping */
+ while (start>0 && x[i*C]*x[(start-1)*C]>=0)
+ start--;
+ /* Look for first zero crossing after clipping */
+ while (end<N && x[i*C]*x[end*C]>=0)
+ {
+ /* Look for other peaks until the next zero-crossing. */
+ if (ABS16(x[end*C])>maxval)
+ {
+ maxval = ABS16(x[end*C]);
+ peak_pos = end;
+ }
+ end++;
+ }
+ /* Detect the special case where we clip before the first zero crossing */
+ special = (start==0 && x[i*C]*x[0]>=0);
+
+ /* Compute a such that maxval + a*maxval^2 = 1 */
+ a=(maxval-1)/(maxval*maxval);
+ if (x[i*C]>0)
+ a = -a;
+ /* Apply soft clipping */
+ for (i=start;i<end;i++)
+ x[i*C] = x[i*C]+a*x[i*C]*x[i*C];
+
+ if (special && peak_pos>=2)
+ {
+ /* Add a linear ramp from the first sample to the signal peak.
+ This avoids a discontinuity at the beginning of the frame. */
+ float delta;
+ float offset = x0-x[0];
+ delta = offset / peak_pos;
+ for (i=curr;i<peak_pos;i++)
+ {
+ offset -= delta;
+ x[i*C] += offset;
+ x[i*C] = MAX16(-1.f, MIN16(1.f, x[i*C]));
+ }
+ }
+ curr = end;
+ if (curr==N)
+ break;
+ }
+ declip_mem[c] = a;
+ }
+}
+#endif
+
+#if 0
+int encode_size(int size, unsigned char *data)
+{
+ if (size < 252)
+ {
+ data[0] = size;
+ return 1;
+ } else {
+ data[0] = 252+(size&0x3);
+ data[1] = (size-(int)data[0])>>2;
+ return 2;
+ }
+}
+#endif
+
+static int parse_size(const unsigned char *data, opus_int32 len, opus_int16 *size)
+{
+ if (len<1)
+ {
+ *size = -1;
+ return -1;
+ } else if (data[0]<252)
+ {
+ *size = data[0];
+ return 1;
+ } else if (len<2)
+ {
+ *size = -1;
+ return -1;
+ } else {
+ *size = 4*data[1] + data[0];
+ return 2;
+ }
+}
+
+int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
+ int self_delimited, unsigned char *out_toc,
+ const unsigned char *frames[48], opus_int16 size[48],
+ int *payload_offset, opus_int32 *packet_offset)
+{
+ int i, bytes;
+ int count;
+ int cbr;
+ unsigned char ch, toc;
+ int framesize;
+ opus_int32 last_size;
+ opus_int32 pad = 0;
+ const unsigned char *data0 = data;
+
+ if (size==NULL)
+ return OPUS_BAD_ARG;
+
+ framesize = opus_packet_get_samples_per_frame(data, 48000);
+
+ cbr = 0;
+ toc = *data++;
+ len--;
+ last_size = len;
+ switch (toc&0x3)
+ {
+ /* One frame */
+ case 0:
+ count=1;
+ break;
+ /* Two CBR frames */
+ case 1:
+ count=2;
+ cbr = 1;
+ if (!self_delimited)
+ {
+ if (len&0x1)
+ return OPUS_INVALID_PACKET;
+ last_size = len/2;
+ /* If last_size doesn't fit in size[0], we'll catch it later */
+ size[0] = (opus_int16)last_size;
+ }
+ break;
+ /* Two VBR frames */
+ case 2:
+ count = 2;
+ bytes = parse_size(data, len, size);
+ len -= bytes;
+ if (size[0]<0 || size[0] > len)
+ return OPUS_INVALID_PACKET;
+ data += bytes;
+ last_size = len-size[0];
+ break;
+ /* Multiple CBR/VBR frames (from 0 to 120 ms) */
+ default: /*case 3:*/
+ if (len<1)
+ return OPUS_INVALID_PACKET;
+ /* Number of frames encoded in bits 0 to 5 */
+ ch = *data++;
+ count = ch&0x3F;
+ if (count <= 0 || framesize*count > 5760)
+ return OPUS_INVALID_PACKET;
+ len--;
+ /* Padding flag is bit 6 */
+ if (ch&0x40)
+ {
+ int p;
+ do {
+ int tmp;
+ if (len<=0)
+ return OPUS_INVALID_PACKET;
+ p = *data++;
+ len--;
+ tmp = p==255 ? 254: p;
+ len -= tmp;
+ pad += tmp;
+ } while (p==255);
+ }
+ if (len<0)
+ return OPUS_INVALID_PACKET;
+ /* VBR flag is bit 7 */
+ cbr = !(ch&0x80);
+ if (!cbr)
+ {
+ /* VBR case */
+ last_size = len;
+ for (i=0;i<count-1;i++)
+ {
+ bytes = parse_size(data, len, size+i);
+ len -= bytes;
+ if (size[i]<0 || size[i] > len)
+ return OPUS_INVALID_PACKET;
+ data += bytes;
+ last_size -= bytes+size[i];
+ }
+ if (last_size<0)
+ return OPUS_INVALID_PACKET;
+ } else if (!self_delimited)
+ {
+ /* CBR case */
+ last_size = len/count;
+ if (last_size*count!=len)
+ return OPUS_INVALID_PACKET;
+ for (i=0;i<count-1;i++)
+ size[i] = (opus_int16)last_size;
+ }
+ break;
+ }
+ /* Self-delimited framing has an extra size for the last frame. */
+ if (self_delimited)
+ {
+ bytes = parse_size(data, len, size+count-1);
+ len -= bytes;
+ if (size[count-1]<0 || size[count-1] > len)
+ return OPUS_INVALID_PACKET;
+ data += bytes;
+ /* For CBR packets, apply the size to all the frames. */
+ if (cbr)
+ {
+ if (size[count-1]*count > len)
+ return OPUS_INVALID_PACKET;
+ for (i=0;i<count-1;i++)
+ size[i] = size[count-1];
+ } else if (bytes+size[count-1] > last_size)
+ return OPUS_INVALID_PACKET;
+ } else
+ {
+ /* Because it's not encoded explicitly, it's possible the size of the
+ last packet (or all the packets, for the CBR case) is larger than
+ 1275. Reject them here.*/
+ if (last_size > 1275)
+ return OPUS_INVALID_PACKET;
+ size[count-1] = (opus_int16)last_size;
+ }
+
+ if (payload_offset)
+ *payload_offset = (int)(data-data0);
+
+ for (i=0;i<count;i++)
+ {
+ if (frames)
+ frames[i] = data;
+ data += size[i];
+ }
+
+ if (packet_offset)
+ *packet_offset = pad+(opus_int32)(data-data0);
+
+ if (out_toc)
+ *out_toc = toc;
+
+ return count;
+}
+
+#if 0
+int opus_packet_parse(const unsigned char *data, opus_int32 len,
+ unsigned char *out_toc, const unsigned char *frames[48],
+ opus_int16 size[48], int *payload_offset)
+{
+ return opus_packet_parse_impl(data, len, 0, out_toc,
+ frames, size, payload_offset, NULL);
+}
+#endif
+
diff --git a/lib/rbcodec/codecs/libopus/opus.h b/lib/rbcodec/codecs/libopus/opus.h
index 38817b405a..93a53a2ffc 100644
--- a/lib/rbcodec/codecs/libopus/opus.h
+++ b/lib/rbcodec/codecs/libopus/opus.h
@@ -911,6 +911,64 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_nb_frames(OpusRepa
*/
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1);
+/** Pads a given Opus packet to a larger size (possibly changing the TOC sequence).
+ * @param[in,out] data <tt>const unsigned char*</tt>: The buffer containing the
+ * packet to pad.
+ * @param len <tt>opus_int32</tt>: The size of the packet.
+ * This must be at least 1.
+ * @param new_len <tt>opus_int32</tt>: The desired size of the packet after padding.
+ * This must be at least as large as len.
+ * @returns an error code
+ * @retval #OPUS_OK \a on success.
+ * @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len.
+ * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.
+ */
+OPUS_EXPORT int opus_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len);
+
+/** Remove all padding from a given Opus packet and rewrite the TOC sequence to
+ * minimize space usage.
+ * @param[in,out] data <tt>const unsigned char*</tt>: The buffer containing the
+ * packet to strip.
+ * @param len <tt>opus_int32</tt>: The size of the packet.
+ * This must be at least 1.
+ * @returns The new size of the output packet on success, or an error code
+ * on failure.
+ * @retval #OPUS_BAD_ARG \a len was less than 1.
+ * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.
+ */
+OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_packet_unpad(unsigned char *data, opus_int32 len);
+
+/** Pads a given Opus multi-stream packet to a larger size (possibly changing the TOC sequence).
+ * @param[in,out] data <tt>const unsigned char*</tt>: The buffer containing the
+ * packet to pad.
+ * @param len <tt>opus_int32</tt>: The size of the packet.
+ * This must be at least 1.
+ * @param new_len <tt>opus_int32</tt>: The desired size of the packet after padding.
+ * This must be at least 1.
+ * @param nb_streams <tt>opus_int32</tt>: The number of streams (not channels) in the packet.
+ * This must be at least as large as len.
+ * @returns an error code
+ * @retval #OPUS_OK \a on success.
+ * @retval #OPUS_BAD_ARG \a len was less than 1.
+ * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.
+ */
+OPUS_EXPORT int opus_multistream_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len, int nb_streams);
+
+/** Remove all padding from a given Opus multi-stream packet and rewrite the TOC sequence to
+ * minimize space usage.
+ * @param[in,out] data <tt>const unsigned char*</tt>: The buffer containing the
+ * packet to strip.
+ * @param len <tt>opus_int32</tt>: The size of the packet.
+ * This must be at least 1.
+ * @param nb_streams <tt>opus_int32</tt>: The number of streams (not channels) in the packet.
+ * This must be at least 1.
+ * @returns The new size of the output packet on success, or an error code
+ * on failure.
+ * @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len.
+ * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.
+ */
+OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_packet_unpad(unsigned char *data, opus_int32 len, int nb_streams);
+
/**@}*/
#ifdef __cplusplus
diff --git a/lib/rbcodec/codecs/libopus/opus_custom.h b/lib/rbcodec/codecs/libopus/opus_custom.h
index 6cf3963076..41f36bf2fb 100644
--- a/lib/rbcodec/codecs/libopus/opus_custom.h
+++ b/lib/rbcodec/codecs/libopus/opus_custom.h
@@ -47,7 +47,7 @@ extern "C" {
#else
# define OPUS_CUSTOM_EXPORT
# ifdef OPUS_BUILD
-# define OPUS_CUSTOM_EXPORT_STATIC static inline
+# define OPUS_CUSTOM_EXPORT_STATIC static OPUS_INLINE
# else
# define OPUS_CUSTOM_EXPORT_STATIC
# endif
@@ -140,6 +140,7 @@ OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_si
int channels
) OPUS_ARG_NONNULL(1);
+# ifdef CUSTOM_MODES
/** Initializes a previously allocated encoder state
* The memory pointed to by st must be the size returned by opus_custom_encoder_get_size.
* This is intended for applications which use their own allocator instead of malloc.
@@ -152,12 +153,12 @@ OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_si
* @param [in] channels <tt>int</tt>: Number of channels
* @return OPUS_OK Success or @ref opus_errorcodes
*/
-OPUS_CUSTOM_EXPORT_STATIC int opus_custom_encoder_init(
+OPUS_CUSTOM_EXPORT int opus_custom_encoder_init(
OpusCustomEncoder *st,
const OpusCustomMode *mode,
int channels
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
-
+# endif
#endif
diff --git a/lib/rbcodec/codecs/libopus/opus_decoder.c b/lib/rbcodec/codecs/libopus/opus_decoder.c
index b430a4df07..198d168898 100644
--- a/lib/rbcodec/codecs/libopus/opus_decoder.c
+++ b/lib/rbcodec/codecs/libopus/opus_decoder.c
@@ -26,11 +26,15 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
#endif
#ifndef OPUS_BUILD
-#error "OPUS_BUILD _MUST_ be defined to build Opus. This probably means you need other defines as well, as in a config.h. See the included build files for details."
+# error "OPUS_BUILD _MUST_ be defined to build Opus. This probably means you need other defines as well, as in a config.h. See the included build files for details."
+#endif
+
+#if defined(__GNUC__) && (__GNUC__ >= 2) && !defined(__OPTIMIZE__)
+# pragma message "You appear to be compiling without optimization, if so opus will be very slow."
#endif
#include <stdarg.h>
@@ -71,11 +75,10 @@ struct OpusDecoder {
#endif
opus_uint32 rangeFinal;
- int arch;
};
#ifdef FIXED_POINT
-static inline opus_int16 SAT16(opus_int32 x) {
+static OPUS_INLINE opus_int16 SAT16(opus_int32 x) {
return x > 32767 ? 32767 : x < -32768 ? -32768 : (opus_int16)x;
}
#endif
@@ -121,7 +124,6 @@ int opus_decoder_init(OpusDecoder *st, opus_int32 Fs, int channels)
st->Fs = Fs;
st->DecControl.API_sampleRate = st->Fs;
st->DecControl.nChannelsAPI = st->channels;
- st->arch = opus_select_arch();
/* Reset decoder */
ret = silk_InitDecoder( silk_dec );
@@ -152,7 +154,6 @@ OpusDecoder *opus_decoder_create(opus_int32 Fs, int channels, int *error)
*error = OPUS_BAD_ARG;
return NULL;
}
-
if (STATIC_DECODER_SIZE >= opus_decoder_get_size(channels))
st = (OpusDecoder *)s_dec;
else
@@ -265,26 +266,44 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
ec_dec_init(&dec,(unsigned char*)data,len);
} else {
audiosize = frame_size;
+ mode = st->prev_mode;
- if (st->prev_mode == 0)
+ if (mode == 0)
{
/* If we haven't got any packet yet, all we can do is return zeros */
for (i=0;i<audiosize*st->channels;i++)
pcm[i] = 0;
RESTORE_STACK;
return audiosize;
- } else {
- mode = st->prev_mode;
}
- }
- /* For CELT/hybrid PLC of more than 20 ms, opus_decode_native() will do
- multiple calls */
- if (data==NULL && mode != MODE_SILK_ONLY)
- frame_size = IMIN(frame_size, F20);
+ /* Avoids trying to run the PLC on sizes other than 2.5 (CELT), 5 (CELT),
+ 10, or 20 (e.g. 12.5 or 30 ms). */
+ if (audiosize > F20)
+ {
+ do {
+ int ret = opus_decode_frame(st, NULL, 0, pcm, IMIN(audiosize, F20), 0);
+ if (ret<0)
+ {
+ RESTORE_STACK;
+ return ret;
+ }
+ pcm += ret*st->channels;
+ audiosize -= ret;
+ } while (audiosize > 0);
+ RESTORE_STACK;
+ return frame_size;
+ } else if (audiosize < F20)
+ {
+ if (audiosize > F10)
+ audiosize = F10;
+ else if (mode != MODE_SILK_ONLY && audiosize > F5 && audiosize < F10)
+ audiosize = F5;
+ }
+ }
- pcm_transition_silk_size = 0;
- pcm_transition_celt_size = 0;
+ pcm_transition_silk_size = ALLOC_NONE;
+ pcm_transition_celt_size = ALLOC_NONE;
if (data!=NULL && st->prev_mode > 0 && (
(mode == MODE_CELT_ONLY && st->prev_mode != MODE_CELT_ONLY && !st->prev_redundancy)
|| (mode != MODE_CELT_ONLY && st->prev_mode == MODE_CELT_ONLY) )
@@ -313,7 +332,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
}
/* Don't allocate any memory when in CELT-only mode */
- pcm_silk_size = (mode != MODE_CELT_ONLY) ? IMAX(F10, frame_size)*st->channels : 0;
+ pcm_silk_size = (mode != MODE_CELT_ONLY) ? IMAX(F10, frame_size)*st->channels : ALLOC_NONE;
ALLOC(pcm_silk, pcm_silk_size, opus_int16);
/* SILK processing */
@@ -363,7 +382,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
pcm_ptr[i] = 0;
} else {
RESTORE_STACK;
- return OPUS_INVALID_PACKET;
+ return OPUS_INTERNAL_ERROR;
}
}
pcm_ptr += silk_frame_size * st->channels;
@@ -430,7 +449,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
if (redundancy)
{
transition = 0;
- pcm_transition_silk_size=0;
+ pcm_transition_silk_size=ALLOC_NONE;
}
ALLOC(pcm_transition_silk, pcm_transition_silk_size, opus_val16);
@@ -442,7 +461,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
}
/* Only allocation memory for redundancy if/when needed */
- redundant_audio_size = redundancy ? F5*st->channels : 0;
+ redundant_audio_size = redundancy ? F5*st->channels : ALLOC_NONE;
ALLOC(redundant_audio, redundant_audio_size, opus_val16);
/* 5 ms redundant frame for CELT->SILK*/
@@ -569,189 +588,13 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
}
-static int parse_size(const unsigned char *data, opus_int32 len, opus_int16 *size)
-{
- if (len<1)
- {
- *size = -1;
- return -1;
- } else if (data[0]<252)
- {
- *size = data[0];
- return 1;
- } else if (len<2)
- {
- *size = -1;
- return -1;
- } else {
- *size = 4*data[1] + data[0];
- return 2;
- }
-}
-
-static int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
- int self_delimited, unsigned char *out_toc,
- const unsigned char *frames[48], opus_int16 size[48], int *payload_offset)
-{
- int i, bytes;
- int count;
- int cbr;
- unsigned char ch, toc;
- int framesize;
- opus_int32 last_size;
- const unsigned char *data0 = data;
-
- if (size==NULL)
- return OPUS_BAD_ARG;
-
- framesize = opus_packet_get_samples_per_frame(data, 48000);
-
- cbr = 0;
- toc = *data++;
- len--;
- last_size = len;
- switch (toc&0x3)
- {
- /* One frame */
- case 0:
- count=1;
- break;
- /* Two CBR frames */
- case 1:
- count=2;
- cbr = 1;
- if (!self_delimited)
- {
- if (len&0x1)
- return OPUS_INVALID_PACKET;
- last_size = len/2;
- /* If last_size doesn't fit in size[0], we'll catch it later */
- size[0] = (opus_int16)last_size;
- }
- break;
- /* Two VBR frames */
- case 2:
- count = 2;
- bytes = parse_size(data, len, size);
- len -= bytes;
- if (size[0]<0 || size[0] > len)
- return OPUS_INVALID_PACKET;
- data += bytes;
- last_size = len-size[0];
- break;
- /* Multiple CBR/VBR frames (from 0 to 120 ms) */
- default: /*case 3:*/
- if (len<1)
- return OPUS_INVALID_PACKET;
- /* Number of frames encoded in bits 0 to 5 */
- ch = *data++;
- count = ch&0x3F;
- if (count <= 0 || framesize*count > 5760)
- return OPUS_INVALID_PACKET;
- len--;
- /* Padding flag is bit 6 */
- if (ch&0x40)
- {
- int p;
- do {
- if (len<=0)
- return OPUS_INVALID_PACKET;
- p = *data++;
- len--;
- len -= p==255 ? 254: p;
- } while (p==255);
- }
- if (len<0)
- return OPUS_INVALID_PACKET;
- /* VBR flag is bit 7 */
- cbr = !(ch&0x80);
- if (!cbr)
- {
- /* VBR case */
- last_size = len;
- for (i=0;i<count-1;i++)
- {
- bytes = parse_size(data, len, size+i);
- len -= bytes;
- if (size[i]<0 || size[i] > len)
- return OPUS_INVALID_PACKET;
- data += bytes;
- last_size -= bytes+size[i];
- }
- if (last_size<0)
- return OPUS_INVALID_PACKET;
- } else if (!self_delimited)
- {
- /* CBR case */
- last_size = len/count;
- if (last_size*count!=len)
- return OPUS_INVALID_PACKET;
- for (i=0;i<count-1;i++)
- size[i] = (opus_int16)last_size;
- }
- break;
- }
- /* Self-delimited framing has an extra size for the last frame. */
- if (self_delimited)
- {
- bytes = parse_size(data, len, size+count-1);
- len -= bytes;
- if (size[count-1]<0 || size[count-1] > len)
- return OPUS_INVALID_PACKET;
- data += bytes;
- /* For CBR packets, apply the size to all the frames. */
- if (cbr)
- {
- if (size[count-1]*count > len)
- return OPUS_INVALID_PACKET;
- for (i=0;i<count-1;i++)
- size[i] = size[count-1];
- } else if(size[count-1] > last_size)
- return OPUS_INVALID_PACKET;
- } else
- {
- /* Because it's not encoded explicitly, it's possible the size of the
- last packet (or all the packets, for the CBR case) is larger than
- 1275. Reject them here.*/
- if (last_size > 1275)
- return OPUS_INVALID_PACKET;
- size[count-1] = (opus_int16)last_size;
- }
-
- if (frames)
- {
- for (i=0;i<count;i++)
- {
- frames[i] = data;
- data += size[i];
- }
- }
-
- if (out_toc)
- *out_toc = toc;
-
- if (payload_offset)
- *payload_offset = (int)(data-data0);
-
- return count;
-}
-
-int opus_packet_parse(const unsigned char *data, opus_int32 len,
- unsigned char *out_toc, const unsigned char *frames[48],
- opus_int16 size[48], int *payload_offset)
-{
- return opus_packet_parse_impl(data, len, 0, out_toc,
- frames, size, payload_offset);
-}
-
int opus_decode_native(OpusDecoder *st, const unsigned char *data,
opus_int32 len, opus_val16 *pcm, int frame_size, int decode_fec,
- int self_delimited, int *packet_offset, int soft_clip)
+ int self_delimited, opus_int32 *packet_offset, int soft_clip)
{
int i, nb_samples;
int count, offset;
unsigned char toc;
- int tot_offset;
int packet_frame_size, packet_bandwidth, packet_mode, packet_stream_channels;
/* 48 x 2.5 ms = 120 ms */
opus_int16 size[48];
@@ -783,7 +626,10 @@ int opus_decode_native(OpusDecoder *st, const unsigned char *data,
packet_frame_size = opus_packet_get_samples_per_frame(data, st->Fs);
packet_stream_channels = opus_packet_get_nb_channels(data);
- count = opus_packet_parse_impl(data, len, self_delimited, &toc, NULL, size, &offset);
+ count = opus_packet_parse_impl(data, len, self_delimited, &toc, NULL,
+ size, &offset, packet_offset);
+ if (count<0)
+ return count;
data += offset;
@@ -822,11 +668,6 @@ int opus_decode_native(OpusDecoder *st, const unsigned char *data,
return frame_size;
}
}
- tot_offset = 0;
- if (count < 0)
- return count;
-
- tot_offset += offset;
if (count*packet_frame_size > frame_size)
return OPUS_BUFFER_TOO_SMALL;
@@ -846,11 +687,8 @@ int opus_decode_native(OpusDecoder *st, const unsigned char *data,
return ret;
celt_assert(ret==packet_frame_size);
data += size[i];
- tot_offset += size[i];
nb_samples += ret;
}
- if (packet_offset != NULL)
- *packet_offset = tot_offset;
st->last_packet_duration = nb_samples;
if (OPUS_CHECK_ARRAY(pcm, nb_samples*st->channels))
OPUS_PRINT_INT(nb_samples);
@@ -868,6 +706,8 @@ int opus_decode_native(OpusDecoder *st, const unsigned char *data,
int opus_decode(OpusDecoder *st, const unsigned char *data,
opus_int32 len, opus_val16 *pcm, int frame_size, int decode_fec)
{
+ if(frame_size<=0)
+ return OPUS_BAD_ARG;
return opus_decode_native(st, data, len, pcm, frame_size, decode_fec, 0, NULL, 0);
}
@@ -879,6 +719,11 @@ int opus_decode_float(OpusDecoder *st, const unsigned char *data,
int ret, i;
ALLOC_STACK;
+ if(frame_size<=0)
+ {
+ RESTORE_STACK;
+ return OPUS_BAD_ARG;
+ }
ALLOC(out, frame_size*st->channels, opus_int16);
ret = opus_decode_native(st, data, len, out, frame_size, decode_fec, 0, NULL, 0);
@@ -901,7 +746,7 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
int ret, i;
ALLOC_STACK;
- if(frame_size<0)
+ if(frame_size<=0)
{
RESTORE_STACK;
return OPUS_BAD_ARG;
@@ -922,6 +767,8 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
int opus_decode_float(OpusDecoder *st, const unsigned char *data,
opus_int32 len, opus_val16 *pcm, int frame_size, int decode_fec)
{
+ if(frame_size<=0)
+ return OPUS_BAD_ARG;
return opus_decode_native(st, data, len, pcm, frame_size, decode_fec, 0, NULL, 0);
}
diff --git a/lib/rbcodec/codecs/libopus/opus_defines.h b/lib/rbcodec/codecs/libopus/opus_defines.h
index 3474e84c43..265089f65e 100644
--- a/lib/rbcodec/codecs/libopus/opus_defines.h
+++ b/lib/rbcodec/codecs/libopus/opus_defines.h
@@ -98,6 +98,18 @@ extern "C" {
# define OPUS_RESTRICT restrict
#endif
+#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) )
+# if OPUS_GNUC_PREREQ(2,7)
+# define OPUS_INLINE __inline__
+# elif (defined(_MSC_VER))
+# define OPUS_INLINE __inline
+# else
+# define OPUS_INLINE
+# endif
+#else
+# define OPUS_INLINE inline
+#endif
+
/**Warning attributes for opus functions
* NONNULL is not used in OPUS_BUILD to avoid the compiler optimizing out
* some paranoid null checks. */
@@ -151,6 +163,8 @@ extern "C" {
#define OPUS_GET_LAST_PACKET_DURATION_REQUEST 4039
#define OPUS_SET_EXPERT_FRAME_DURATION_REQUEST 4040
#define OPUS_GET_EXPERT_FRAME_DURATION_REQUEST 4041
+#define OPUS_SET_PREDICTION_DISABLED_REQUEST 4042
+#define OPUS_GET_PREDICTION_DISABLED_REQUEST 4043
/* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */
@@ -194,7 +208,6 @@ extern "C" {
#define OPUS_FRAMESIZE_20_MS 5004 /**< Use 20 ms frames */
#define OPUS_FRAMESIZE_40_MS 5005 /**< Use 40 ms frames */
#define OPUS_FRAMESIZE_60_MS 5006 /**< Use 60 ms frames */
-#define OPUS_FRAMESIZE_VARIABLE 5010 /**< Optimize the frame size dynamically */
/**@}*/
@@ -575,6 +588,14 @@ extern "C" {
* @hideinitializer */
#define OPUS_GET_EXPERT_FRAME_DURATION(x) OPUS_GET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int_ptr(x)
+/** If set to 1, disables almost all use of prediction, making frames almost
+ completely independent. This reduces quality. (default : 0)
+ * @hideinitializer */
+#define OPUS_SET_PREDICTION_DISABLED(x) OPUS_SET_PREDICTION_DISABLED_REQUEST, __opus_check_int(x)
+/** Gets the encoder's configured prediction status.
+ * @hideinitializer */
+#define OPUS_GET_PREDICTION_DISABLED(x) OPUS_GET_PREDICTION_DISABLED_REQUEST, __opus_check_int_ptr(x)
+
/**@}*/
/** @defgroup opus_genericctls Generic CTLs
diff --git a/lib/rbcodec/codecs/libopus/opus_private.h b/lib/rbcodec/codecs/libopus/opus_private.h
index 9d8210b5f0..83225f2b6c 100644
--- a/lib/rbcodec/codecs/libopus/opus_private.h
+++ b/lib/rbcodec/codecs/libopus/opus_private.h
@@ -82,35 +82,48 @@ int get_mono_channel(const ChannelLayout *layout, int stream_id, int prev);
#define OPUS_SET_FORCE_MODE_REQUEST 11002
#define OPUS_SET_FORCE_MODE(x) OPUS_SET_FORCE_MODE_REQUEST, __opus_check_int(x)
-typedef void (*downmix_func)(const void *, float *, int, int, int);
-void downmix_float(const void *_x, float *sub, int subframe, int offset, int C);
-void downmix_int(const void *_x, float *sub, int subframe, int offset, int C);
+typedef void (*downmix_func)(const void *, opus_val32 *, int, int, int, int, int);
+void downmix_float(const void *_x, opus_val32 *sub, int subframe, int offset, int c1, int c2, int C);
+void downmix_int(const void *_x, opus_val32 *sub, int subframe, int offset, int c1, int c2, int C);
int optimize_framesize(const opus_val16 *x, int len, int C, opus_int32 Fs,
- int bitrate, opus_val16 tonality, opus_val32 *mem, int buffering,
+ int bitrate, opus_val16 tonality, float *mem, int buffering,
downmix_func downmix);
int encode_size(int size, unsigned char *data);
opus_int32 frame_size_select(opus_int32 frame_size, int variable_duration, opus_int32 Fs);
-opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_size,
- unsigned char *data, opus_int32 out_data_bytes, int lsb_depth
-#ifndef FIXED_POINT
- , AnalysisInfo *analysis_info
+opus_int32 compute_frame_size(const void *analysis_pcm, int frame_size,
+ int variable_duration, int C, opus_int32 Fs, int bitrate_bps,
+ int delay_compensation, downmix_func downmix
+#ifndef DISABLE_FLOAT_API
+ , float *subframe_mem
#endif
);
+opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_size,
+ unsigned char *data, opus_int32 out_data_bytes, int lsb_depth,
+ const void *analysis_pcm, opus_int32 analysis_size, int c1, int c2, int analysis_channels, downmix_func downmix);
+
int opus_decode_native(OpusDecoder *st, const unsigned char *data, opus_int32 len,
opus_val16 *pcm, int frame_size, int decode_fec, int self_delimited,
- int *packet_offset, int soft_clip);
+ opus_int32 *packet_offset, int soft_clip);
/* Make sure everything's aligned to sizeof(void *) bytes */
-static inline int align(int i)
+static OPUS_INLINE int align(int i)
{
return (i+(int)sizeof(void *)-1)&-(int)sizeof(void *);
}
-opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen, int self_delimited);
+int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
+ int self_delimited, unsigned char *out_toc,
+ const unsigned char *frames[48], opus_int16 size[48],
+ int *payload_offset, opus_int32 *packet_offset);
+
+opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int end,
+ unsigned char *data, opus_int32 maxlen, int self_delimited, int pad);
+
+int pad_frame(unsigned char *data, opus_int32 len, opus_int32 new_len);
#endif /* OPUS_PRIVATE_H */
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -64,6 +64,7 @@ opus_int silk_Get_Encoder_Size( /* O Returns error co
/*************************/
opus_int silk_InitEncoder( /* O Returns error code */
void *encState, /* I/O State */
+ int arch, /* I Run-time architecture */
silk_EncControlStruct *encStatus /* O Encoder Status */
);
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "stack_alloc.h"
/* Generates excitation for CNG LPC synthesis */
-static inline void silk_CNG_exc(
+static OPUS_INLINE void silk_CNG_exc(
opus_int32 residual_Q10[], /* O CNG residual signal Q10 */
opus_int32 exc_buf_Q14[], /* I Random samples buffer Q10 */
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -26,7 +26,7 @@ POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
/*! \file silk_Inlines.h
- * \brief silk_Inlines.h defines inline signal processing functions.
+ * \brief silk_Inlines.h defines OPUS_INLINE signal processing functions.
*/
#ifndef SILK_FIX_INLINES_H
@@ -38,7 +38,7 @@ extern "C"
#endif
/* count leading zeros of opus_int64 */
-static inline opus_int32 silk_CLZ64( opus_int64 in )
+static OPUS_INLINE opus_int32 silk_CLZ64( opus_int64 in )
{
opus_int32 in_upper;
@@ -53,7 +53,7 @@ static inline opus_int32 silk_CLZ64( opus_int64 in )
}
/* get number of leading zeros and fractional part (the bits right after the leading one */
-static inline void silk_CLZ_FRAC(
+static OPUS_INLINE void silk_CLZ_FRAC(
opus_int32 in, /* I input */
opus_int32 *lz, /* O number of leading zeros */
opus_int32 *frac_Q7 /* O the 7 bits right after the leading one */
@@ -68,7 +68,7 @@ static inline void silk_CLZ_FRAC(
/* Approximation of square root */
/* Accuracy: < +/- 10% for output values > 15 */
/* < +/- 2.5% for output values > 120 */
-static inline opus_int32 silk_SQRT_APPROX( opus_int32 x )
+static OPUS_INLINE opus_int32 silk_SQRT_APPROX( opus_int32 x )
{
opus_int32 y, lz, frac_Q7;
@@ -94,7 +94,7 @@ static inline opus_int32 silk_SQRT_APPROX( opus_int32 x )
}
/* Divide two int32 values and return result as int32 in a given Q-domain */
-static inline opus_int32 silk_DIV32_varQ( /* O returns a good approximation of "(a32 << Qres) / b32" */
+static OPUS_INLINE opus_int32 silk_DIV32_varQ( /* O returns a good approximation of "(a32 << Qres) / b32" */
const opus_int32 a32, /* I numerator (Q0) */
const opus_int32 b32, /* I denominator (Q0) */
const opus_int Qres /* I Q-domain of result (>= 0) */
@@ -140,7 +140,7 @@ static inline opus_int32 silk_DIV32_varQ( /* O returns a good approximation
}
/* Invert int32 value and return result as int32 in a given Q-domain */
-static inline opus_int32 silk_INVERSE32_varQ( /* O returns a good approximation of "(1 << Qres) / b32" */
+static OPUS_INLINE opus_int32 silk_INVERSE32_varQ( /* O returns a good approximation of "(1 << Qres) / b32" */
const opus_int32 b32, /* I denominator (Q0) */
const opus_int Qres /* I Q-domain of result (> 0) */
)
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -34,11 +34,11 @@ POSSIBILITY OF SUCH DAMAGE.
extern opus_int64 ops_count;
-static inline opus_int64 silk_SaveCount(){
+static OPUS_INLINE opus_int64 silk_SaveCount(){
return(ops_count);
}
-static inline opus_int64 silk_SaveResetCount(){
+static OPUS_INLINE opus_int64 silk_SaveResetCount(){
opus_int64 ret;
ret = ops_count;
@@ -46,12 +46,12 @@ static inline opus_int64 silk_SaveResetCount(){
return(ret);
}
-static inline silk_PrintCount(){
+static OPUS_INLINE silk_PrintCount(){
printf("ops_count = %d \n ", (opus_int32)ops_count);
}
#undef silk_MUL
-static inline opus_int32 silk_MUL(opus_int32 a32, opus_int32 b32){
+static OPUS_INLINE opus_int32 silk_MUL(opus_int32 a32, opus_int32 b32){
opus_int32 ret;
ops_count += 4;
ret = a32 * b32;
@@ -59,14 +59,14 @@ static inline opus_int32 silk_MUL(opus_int32 a32, opus_int32 b32){
}
#undef silk_MUL_uint
-static inline opus_uint32 silk_MUL_uint(opus_uint32 a32, opus_uint32 b32){
+static OPUS_INLINE opus_uint32 silk_MUL_uint(opus_uint32 a32, opus_uint32 b32){
opus_uint32 ret;
ops_count += 4;
ret = a32 * b32;
return ret;
}
#undef silk_MLA
-static inline opus_int32 silk_MLA(opus_int32 a32, opus_int32 b32, opus_int32 c32){
+static OPUS_INLINE opus_int32 silk_MLA(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret;
ops_count += 4;
ret = a32 + b32 * c32;
@@ -74,7 +74,7 @@ static inline opus_int32 silk_MLA(opus_int32 a32, opus_int32 b32, opus_int32 c32
}
#undef silk_MLA_uint
-static inline opus_int32 silk_MLA_uint(opus_uint32 a32, opus_uint32 b32, opus_uint32 c32){
+static OPUS_INLINE opus_int32 silk_MLA_uint(opus_uint32 a32, opus_uint32 b32, opus_uint32 c32){
opus_uint32 ret;
ops_count += 4;
ret = a32 + b32 * c32;
@@ -82,14 +82,14 @@ static inline opus_int32 silk_MLA_uint(opus_uint32 a32, opus_uint32 b32, opus_ui
}
#undef silk_SMULWB
-static inline opus_int32 silk_SMULWB(opus_int32 a32, opus_int32 b32){
+static OPUS_INLINE opus_int32 silk_SMULWB(opus_int32 a32, opus_int32 b32){
opus_int32 ret;
ops_count += 5;
ret = (a32 >> 16) * (opus_int32)((opus_int16)b32) + (((a32 & 0x0000FFFF) * (opus_int32)((opus_int16)b32)) >> 16);
return ret;
}
#undef silk_SMLAWB
-static inline opus_int32 silk_SMLAWB(opus_int32 a32, opus_int32 b32, opus_int32 c32){
+static OPUS_INLINE opus_int32 silk_SMLAWB(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret;
ops_count += 5;
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
}
#undef silk_SMULWT
-static inline opus_int32 silk_SMULWT(opus_int32 a32, opus_int32 b32){
+static OPUS_INLINE opus_int32 silk_SMULWT(opus_int32 a32, opus_int32 b32){
opus_int32 ret;
ops_count += 4;
ret = (a32 >> 16) * (b32 >> 16) + (((a32 & 0x0000FFFF) * (b32 >> 16)) >> 16);
return ret;
}
#undef silk_SMLAWT
-static inline opus_int32 silk_SMLAWT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
+static OPUS_INLINE opus_int32 silk_SMLAWT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret;
ops_count += 4;
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
}
#undef silk_SMULBB
-static inline opus_int32 silk_SMULBB(opus_int32 a32, opus_int32 b32){
+static OPUS_INLINE opus_int32 silk_SMULBB(opus_int32 a32, opus_int32 b32){
opus_int32 ret;
ops_count += 1;
ret = (opus_int32)((opus_int16)a32) * (opus_int32)((opus_int16)b32);
return ret;
}
#undef silk_SMLABB
-static inline opus_int32 silk_SMLABB(opus_int32 a32, opus_int32 b32, opus_int32 c32){
+static OPUS_INLINE opus_int32 silk_SMLABB(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret;
ops_count += 1;
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
}
#undef silk_SMULBT
-static inline opus_int32 silk_SMULBT(opus_int32 a32, opus_int32 b32 ){
+static OPUS_INLINE opus_int32 silk_SMULBT(opus_int32 a32, opus_int32 b32 ){
opus_int32 ret;
ops_count += 4;
ret = ((opus_int32)((opus_int16)a32)) * (b32 >> 16);
@@ -135,7 +135,7 @@ static inline opus_int32 silk_SMULBT(opus_int32 a32, opus_int32 b32 ){
}
#undef silk_SMLABT
-static inline opus_int32 silk_SMLABT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
+static OPUS_INLINE opus_int32 silk_SMLABT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret;
ops_count += 1;
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
}
#undef silk_SMULTT
-static inline opus_int32 silk_SMULTT(opus_int32 a32, opus_int32 b32){
+static OPUS_INLINE opus_int32 silk_SMULTT(opus_int32 a32, opus_int32 b32){
opus_int32 ret;
ops_count += 1;
ret = (a32 >> 16) * (b32 >> 16);
@@ -151,7 +151,7 @@ static inline opus_int32 silk_SMULTT(opus_int32 a32, opus_int32 b32){
}
#undef silk_SMLATT
-static inline opus_int32 silk_SMLATT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
+static OPUS_INLINE opus_int32 silk_SMLATT(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret;
ops_count += 1;
ret = a32 + (b32 >> 16) * (c32 >> 16);
@@ -179,7 +179,7 @@ static inline opus_int32 silk_SMLATT(opus_int32 a32, opus_int32 b32, opus_int32
#define silk_SMLAWT_ovflw silk_SMLAWT
#undef silk_SMULL
-static inline opus_int64 silk_SMULL(opus_int32 a32, opus_int32 b32){
+static OPUS_INLINE opus_int64 silk_SMULL(opus_int32 a32, opus_int32 b32){
opus_int64 ret;
ops_count += 8;
ret = ((opus_int64)(a32) * /*(opus_int64)*/(b32));
@@ -187,14 +187,14 @@ static inline opus_int64 silk_SMULL(opus_int32 a32, opus_int32 b32){
}
#undef silk_SMLAL
-static inline opus_int64 silk_SMLAL(opus_int64 a64, opus_int32 b32, opus_int32 c32){
+static OPUS_INLINE opus_int64 silk_SMLAL(opus_int64 a64, opus_int32 b32, opus_int32 c32){
opus_int64 ret;
ops_count += 8;
ret = a64 + ((opus_int64)(b32) * /*(opus_int64)*/(c32));
return ret;
}
#undef silk_SMLALBB
-static inline opus_int64 silk_SMLALBB(opus_int64 a64, opus_int16 b16, opus_int16 c16){
+static OPUS_INLINE opus_int64 silk_SMLALBB(opus_int64 a64, opus_int16 b16, opus_int16 c16){
opus_int64 ret;
ops_count += 4;
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
}
#undef SigProcFIX_CLZ16
-static inline opus_int32 SigProcFIX_CLZ16(opus_int16 in16)
+static OPUS_INLINE opus_int32 SigProcFIX_CLZ16(opus_int16 in16)
{
opus_int32 out32 = 0;
ops_count += 10;
@@ -240,7 +240,7 @@ static inline opus_int32 SigProcFIX_CLZ16(opus_int16 in16)
}
#undef SigProcFIX_CLZ32
-static inline opus_int32 SigProcFIX_CLZ32(opus_int32 in32)
+static OPUS_INLINE opus_int32 SigProcFIX_CLZ32(opus_int32 in32)
{
/* test highest 16 bits and convert to opus_int16 */
ops_count += 2;
@@ -252,19 +252,19 @@ static inline opus_int32 SigProcFIX_CLZ32(opus_int32 in32)
}
#undef silk_DIV32
-static inline opus_int32 silk_DIV32(opus_int32 a32, opus_int32 b32){
+static OPUS_INLINE opus_int32 silk_DIV32(opus_int32 a32, opus_int32 b32){
ops_count += 64;
return a32 / b32;
}
#undef silk_DIV32_16
-static inline opus_int32 silk_DIV32_16(opus_int32 a32, opus_int32 b32){
+static OPUS_INLINE opus_int32 silk_DIV32_16(opus_int32 a32, opus_int32 b32){
ops_count += 32;
return a32 / b32;
}
#undef silk_SAT8
-static inline opus_int8 silk_SAT8(opus_int64 a){
+static OPUS_INLINE opus_int8 silk_SAT8(opus_int64 a){
opus_int8 tmp;
ops_count += 1;
tmp = (opus_int8)((a) > silk_int8_MAX ? silk_int8_MAX : \
@@ -273,7 +273,7 @@ static inline opus_int8 silk_SAT8(opus_int64 a){
}
#undef silk_SAT16
-static inline opus_int16 silk_SAT16(opus_int64 a){
+static OPUS_INLINE opus_int16 silk_SAT16(opus_int64 a){
opus_int16 tmp;
ops_count += 1;
tmp = (opus_int16)((a) > silk_int16_MAX ? silk_int16_MAX : \
@@ -281,7 +281,7 @@ static inline opus_int16 silk_SAT16(opus_int64 a){
return(tmp);
}
#undef silk_SAT32
-static inline opus_int32 silk_SAT32(opus_int64 a){
+static OPUS_INLINE opus_int32 silk_SAT32(opus_int64 a){
opus_int32 tmp;
ops_count += 1;
tmp = (opus_int32)((a) > silk_int32_MAX ? silk_int32_MAX : \
@@ -289,7 +289,7 @@ static inline opus_int32 silk_SAT32(opus_int64 a){
return(tmp);
}
#undef silk_POS_SAT32
-static inline opus_int32 silk_POS_SAT32(opus_int64 a){
+static OPUS_INLINE opus_int32 silk_POS_SAT32(opus_int64 a){
opus_int32 tmp;
ops_count += 1;
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){
}
#undef silk_ADD_POS_SAT8
-static inline opus_int8 silk_ADD_POS_SAT8(opus_int64 a, opus_int64 b){
+static OPUS_INLINE opus_int8 silk_ADD_POS_SAT8(opus_int64 a, opus_int64 b){
opus_int8 tmp;
ops_count += 1;
tmp = (opus_int8)((((a)+(b)) & 0x80) ? silk_int8_MAX : ((a)+(b)));
return(tmp);
}
#undef silk_ADD_POS_SAT16
-static inline opus_int16 silk_ADD_POS_SAT16(opus_int64 a, opus_int64 b){
+static OPUS_INLINE opus_int16 silk_ADD_POS_SAT16(opus_int64 a, opus_int64 b){
opus_int16 tmp;
ops_count += 1;
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){
}
#undef silk_ADD_POS_SAT32
-static inline opus_int32 silk_ADD_POS_SAT32(opus_int64 a, opus_int64 b){
+static OPUS_INLINE opus_int32 silk_ADD_POS_SAT32(opus_int64 a, opus_int64 b){
opus_int32 tmp;
ops_count += 1;
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){
}
#undef silk_ADD_POS_SAT64
-static inline opus_int64 silk_ADD_POS_SAT64(opus_int64 a, opus_int64 b){
+static OPUS_INLINE opus_int64 silk_ADD_POS_SAT64(opus_int64 a, opus_int64 b){
opus_int64 tmp;
ops_count += 1;
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){
}
#undef silk_LSHIFT8
-static inline opus_int8 silk_LSHIFT8(opus_int8 a, opus_int32 shift){
+static OPUS_INLINE opus_int8 silk_LSHIFT8(opus_int8 a, opus_int32 shift){
opus_int8 ret;
ops_count += 1;
ret = a << shift;
return ret;
}
#undef silk_LSHIFT16
-static inline opus_int16 silk_LSHIFT16(opus_int16 a, opus_int32 shift){
+static OPUS_INLINE opus_int16 silk_LSHIFT16(opus_int16 a, opus_int32 shift){
opus_int16 ret;
ops_count += 1;
ret = a << shift;
return ret;
}
#undef silk_LSHIFT32
-static inline opus_int32 silk_LSHIFT32(opus_int32 a, opus_int32 shift){
+static OPUS_INLINE opus_int32 silk_LSHIFT32(opus_int32 a, opus_int32 shift){
opus_int32 ret;
ops_count += 1;
ret = a << shift;
return ret;
}
#undef silk_LSHIFT64
-static inline opus_int64 silk_LSHIFT64(opus_int64 a, opus_int shift){
+static OPUS_INLINE opus_int64 silk_LSHIFT64(opus_int64 a, opus_int shift){
ops_count += 1;
return a << shift;
}
#undef silk_LSHIFT_ovflw
-static inline opus_int32 silk_LSHIFT_ovflw(opus_int32 a, opus_int32 shift){
+static OPUS_INLINE opus_int32 silk_LSHIFT_ovflw(opus_int32 a, opus_int32 shift){
ops_count += 1;
return a << shift;
}
#undef silk_LSHIFT_uint
-static inline opus_uint32 silk_LSHIFT_uint(opus_uint32 a, opus_int32 shift){
+static OPUS_INLINE opus_uint32 silk_LSHIFT_uint(opus_uint32 a, opus_int32 shift){
opus_uint32 ret;
ops_count += 1;
ret = a << shift;
@@ -369,83 +369,83 @@ static inline opus_uint32 silk_LSHIFT_uint(opus_uint32 a, opus_int32 shift){
}
#undef silk_RSHIFT8
-static inline opus_int8 silk_RSHIFT8(opus_int8 a, opus_int32 shift){
+static OPUS_INLINE opus_int8 silk_RSHIFT8(opus_int8 a, opus_int32 shift){
ops_count += 1;
return a >> shift;
}
#undef silk_RSHIFT16
-static inline opus_int16 silk_RSHIFT16(opus_int16 a, opus_int32 shift){
+static OPUS_INLINE opus_int16 silk_RSHIFT16(opus_int16 a, opus_int32 shift){
ops_count += 1;
return a >> shift;
}
#undef silk_RSHIFT32
-static inline opus_int32 silk_RSHIFT32(opus_int32 a, opus_int32 shift){
+static OPUS_INLINE opus_int32 silk_RSHIFT32(opus_int32 a, opus_int32 shift){
ops_count += 1;
return a >> shift;
}
#undef silk_RSHIFT64
-static inline opus_int64 silk_RSHIFT64(opus_int64 a, opus_int64 shift){
+static OPUS_INLINE opus_int64 silk_RSHIFT64(opus_int64 a, opus_int64 shift){
ops_count += 1;
return a >> shift;
}
#undef silk_RSHIFT_uint
-static inline opus_uint32 silk_RSHIFT_uint(opus_uint32 a, opus_int32 shift){
+static OPUS_INLINE opus_uint32 silk_RSHIFT_uint(opus_uint32 a, opus_int32 shift){
ops_count += 1;
return a >> shift;
}
#undef silk_ADD_LSHIFT
-static inline opus_int32 silk_ADD_LSHIFT(opus_int32 a, opus_int32 b, opus_int32 shift){
+static OPUS_INLINE opus_int32 silk_ADD_LSHIFT(opus_int32 a, opus_int32 b, opus_int32 shift){
opus_int32 ret;
ops_count += 1;
ret = a + (b << shift);
return ret; /* shift >= 0*/
}
#undef silk_ADD_LSHIFT32
-static inline opus_int32 silk_ADD_LSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
+static OPUS_INLINE opus_int32 silk_ADD_LSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
opus_int32 ret;
ops_count += 1;
ret = a + (b << shift);
return ret; /* shift >= 0*/
}
#undef silk_ADD_LSHIFT_uint
-static inline opus_uint32 silk_ADD_LSHIFT_uint(opus_uint32 a, opus_uint32 b, opus_int32 shift){
+static OPUS_INLINE opus_uint32 silk_ADD_LSHIFT_uint(opus_uint32 a, opus_uint32 b, opus_int32 shift){
opus_uint32 ret;
ops_count += 1;
ret = a + (b << shift);
return ret; /* shift >= 0*/
}
#undef silk_ADD_RSHIFT
-static inline opus_int32 silk_ADD_RSHIFT(opus_int32 a, opus_int32 b, opus_int32 shift){
+static OPUS_INLINE opus_int32 silk_ADD_RSHIFT(opus_int32 a, opus_int32 b, opus_int32 shift){
opus_int32 ret;
ops_count += 1;
ret = a + (b >> shift);
return ret; /* shift > 0*/
}
#undef silk_ADD_RSHIFT32
-static inline opus_int32 silk_ADD_RSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
+static OPUS_INLINE opus_int32 silk_ADD_RSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
opus_int32 ret;
ops_count += 1;
ret = a + (b >> shift);
return ret; /* shift > 0*/
}
#undef silk_ADD_RSHIFT_uint
-static inline opus_uint32 silk_ADD_RSHIFT_uint(opus_uint32 a, opus_uint32 b, opus_int32 shift){
+static OPUS_INLINE opus_uint32 silk_ADD_RSHIFT_uint(opus_uint32 a, opus_uint32 b, opus_int32 shift){
opus_uint32 ret;
ops_count += 1;
ret = a + (b >> shift);
return ret; /* shift > 0*/
}
#undef silk_SUB_LSHIFT32
-static inline opus_int32 silk_SUB_LSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
+static OPUS_INLINE opus_int32 silk_SUB_LSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
opus_int32 ret;
ops_count += 1;
ret = a - (b << shift);
return ret; /* shift >= 0*/
}
#undef silk_SUB_RSHIFT32
-static inline opus_int32 silk_SUB_RSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
+static OPUS_INLINE opus_int32 silk_SUB_RSHIFT32(opus_int32 a, opus_int32 b, opus_int32 shift){
opus_int32 ret;
ops_count += 1;
ret = a - (b >> shift);
@@ -453,7 +453,7 @@ static inline opus_int32 silk_SUB_RSHIFT32(opus_int32 a, opus_int32 b, opus_int3
}
#undef silk_RSHIFT_ROUND
-static inline opus_int32 silk_RSHIFT_ROUND(opus_int32 a, opus_int32 shift){
+static OPUS_INLINE opus_int32 silk_RSHIFT_ROUND(opus_int32 a, opus_int32 shift){
opus_int32 ret;
ops_count += 3;
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){
}
#undef silk_RSHIFT_ROUND64
-static inline opus_int64 silk_RSHIFT_ROUND64(opus_int64 a, opus_int32 shift){
+static OPUS_INLINE opus_int64 silk_RSHIFT_ROUND64(opus_int64 a, opus_int32 shift){
opus_int64 ret;
ops_count += 6;
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){
}
#undef silk_abs_int64
-static inline opus_int64 silk_abs_int64(opus_int64 a){
+static OPUS_INLINE opus_int64 silk_abs_int64(opus_int64 a){
ops_count += 1;
return (((a) > 0) ? (a) : -(a)); /* Be careful, silk_abs returns wrong when input equals to silk_intXX_MIN*/
}
#undef silk_abs_int32
-static inline opus_int32 silk_abs_int32(opus_int32 a){
+static OPUS_INLINE opus_int32 silk_abs_int32(opus_int32 a){
ops_count += 1;
return silk_abs(a);
}
@@ -498,7 +498,7 @@ static silk_sign(a){
}
#undef silk_ADD16
-static inline opus_int16 silk_ADD16(opus_int16 a, opus_int16 b){
+static OPUS_INLINE opus_int16 silk_ADD16(opus_int16 a, opus_int16 b){
opus_int16 ret;
ops_count += 1;
ret = a + b;
@@ -506,7 +506,7 @@ static inline opus_int16 silk_ADD16(opus_int16 a, opus_int16 b){
}
#undef silk_ADD32
-static inline opus_int32 silk_ADD32(opus_int32 a, opus_int32 b){
+static OPUS_INLINE opus_int32 silk_ADD32(opus_int32 a, opus_int32 b){
opus_int32 ret;
ops_count += 1;
ret = a + b;
@@ -514,7 +514,7 @@ static inline opus_int32 silk_ADD32(opus_int32 a, opus_int32 b){
}
#undef silk_ADD64
-static inline opus_int64 silk_ADD64(opus_int64 a, opus_int64 b){
+static OPUS_INLINE opus_int64 silk_ADD64(opus_int64 a, opus_int64 b){
opus_int64 ret;
ops_count += 2;
ret = a + b;
@@ -522,7 +522,7 @@ static inline opus_int64 silk_ADD64(opus_int64 a, opus_int64 b){
}
#undef silk_SUB16
-static inline opus_int16 silk_SUB16(opus_int16 a, opus_int16 b){
+static OPUS_INLINE opus_int16 silk_SUB16(opus_int16 a, opus_int16 b){
opus_int16 ret;
ops_count += 1;
ret = a - b;
@@ -530,7 +530,7 @@ static inline opus_int16 silk_SUB16(opus_int16 a, opus_int16 b){
}
#undef silk_SUB32
-static inline opus_int32 silk_SUB32(opus_int32 a, opus_int32 b){
+static OPUS_INLINE opus_int32 silk_SUB32(opus_int32 a, opus_int32 b){
opus_int32 ret;
ops_count += 1;
ret = a - b;
@@ -538,7 +538,7 @@ static inline opus_int32 silk_SUB32(opus_int32 a, opus_int32 b){
}
#undef silk_SUB64
-static inline opus_int64 silk_SUB64(opus_int64 a, opus_int64 b){
+static OPUS_INLINE opus_int64 silk_SUB64(opus_int64 a, opus_int64 b){
opus_int64 ret;
ops_count += 2;
ret = a - b;
@@ -546,7 +546,7 @@ static inline opus_int64 silk_SUB64(opus_int64 a, opus_int64 b){
}
#undef silk_ADD_SAT16
-static inline opus_int16 silk_ADD_SAT16( opus_int16 a16, opus_int16 b16 ) {
+static OPUS_INLINE opus_int16 silk_ADD_SAT16( opus_int16 a16, opus_int16 b16 ) {
opus_int16 res;
/* Nb will be counted in AKP_add32 and silk_SAT16*/
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 ) {
}
#undef silk_ADD_SAT32
-static inline opus_int32 silk_ADD_SAT32(opus_int32 a32, opus_int32 b32){
+static OPUS_INLINE opus_int32 silk_ADD_SAT32(opus_int32 a32, opus_int32 b32){
opus_int32 res;
ops_count += 1;
res = ((((a32) + (b32)) & 0x80000000) == 0 ? \
@@ -564,7 +564,7 @@ static inline opus_int32 silk_ADD_SAT32(opus_int32 a32, opus_int32 b32){
}
#undef silk_ADD_SAT64
-static inline opus_int64 silk_ADD_SAT64( opus_int64 a64, opus_int64 b64 ) {
+static OPUS_INLINE opus_int64 silk_ADD_SAT64( opus_int64 a64, opus_int64 b64 ) {
opus_int64 res;
ops_count += 1;
res = ((((a64) + (b64)) & 0x8000000000000000LL) == 0 ? \
@@ -574,7 +574,7 @@ static inline opus_int64 silk_ADD_SAT64( opus_int64 a64, opus_int64 b64 ) {
}
#undef silk_SUB_SAT16
-static inline opus_int16 silk_SUB_SAT16( opus_int16 a16, opus_int16 b16 ) {
+static OPUS_INLINE opus_int16 silk_SUB_SAT16( opus_int16 a16, opus_int16 b16 ) {
opus_int16 res;
silk_assert(0);
/* Nb will be counted in sub-macros*/
@@ -583,7 +583,7 @@ static inline opus_int16 silk_SUB_SAT16( opus_int16 a16, opus_int16 b16 ) {
}
#undef silk_SUB_SAT32
-static inline opus_int32 silk_SUB_SAT32( opus_int32 a32, opus_int32 b32 ) {
+static OPUS_INLINE opus_int32 silk_SUB_SAT32( opus_int32 a32, opus_int32 b32 ) {
opus_int32 res;
ops_count += 1;
res = ((((a32)-(b32)) & 0x80000000) == 0 ? \
@@ -593,7 +593,7 @@ static inline opus_int32 silk_SUB_SAT32( opus_int32 a32, opus_int32 b32 ) {
}
#undef silk_SUB_SAT64
-static inline opus_int64 silk_SUB_SAT64( opus_int64 a64, opus_int64 b64 ) {
+static OPUS_INLINE opus_int64 silk_SUB_SAT64( opus_int64 a64, opus_int64 b64 ) {
opus_int64 res;
ops_count += 1;
res = ((((a64)-(b64)) & 0x8000000000000000LL) == 0 ? \
@@ -604,7 +604,7 @@ static inline opus_int64 silk_SUB_SAT64( opus_int64 a64, opus_int64 b64 ) {
}
#undef silk_SMULWW
-static inline opus_int32 silk_SMULWW(opus_int32 a32, opus_int32 b32){
+static OPUS_INLINE opus_int32 silk_SMULWW(opus_int32 a32, opus_int32 b32){
opus_int32 ret;
/* Nb will be counted in sub-macros*/
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){
}
#undef silk_SMLAWW
-static inline opus_int32 silk_SMLAWW(opus_int32 a32, opus_int32 b32, opus_int32 c32){
+static OPUS_INLINE opus_int32 silk_SMLAWW(opus_int32 a32, opus_int32 b32, opus_int32 c32){
opus_int32 ret;
/* Nb will be counted in sub-macros*/
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
}
#undef silk_min_int
-static inline opus_int silk_min_int(opus_int a, opus_int b)
+static OPUS_INLINE opus_int silk_min_int(opus_int a, opus_int b)
{
ops_count += 1;
return (((a) < (b)) ? (a) : (b));
}
#undef silk_min_16
-static inline opus_int16 silk_min_16(opus_int16 a, opus_int16 b)
+static OPUS_INLINE opus_int16 silk_min_16(opus_int16 a, opus_int16 b)
{
ops_count += 1;
return (((a) < (b)) ? (a) : (b));
}
#undef silk_min_32
-static inline opus_int32 silk_min_32(opus_int32 a, opus_int32 b)
+static OPUS_INLINE opus_int32 silk_min_32(opus_int32 a, opus_int32 b)
{
ops_count += 1;
return (((a) < (b)) ? (a) : (b));
}
#undef silk_min_64
-static inline opus_int64 silk_min_64(opus_int64 a, opus_int64 b)
+static OPUS_INLINE opus_int64 silk_min_64(opus_int64 a, opus_int64 b)
{
ops_count += 1;
return (((a) < (b)) ? (a) : (b));
@@ -647,26 +647,26 @@ static inline opus_int64 silk_min_64(opus_int64 a, opus_int64 b)
/* silk_min() versions with typecast in the function call */
#undef silk_max_int
-static inline opus_int silk_max_int(opus_int a, opus_int b)
+static OPUS_INLINE opus_int silk_max_int(opus_int a, opus_int b)
{
ops_count += 1;
return (((a) > (b)) ? (a) : (b));
}
#undef silk_max_16
-static inline opus_int16 silk_max_16(opus_int16 a, opus_int16 b)
+static OPUS_INLINE opus_int16 silk_max_16(opus_int16 a, opus_int16 b)
{
ops_count += 1;
return (((a) > (b)) ? (a) : (b));
}
#undef silk_max_32
-static inline opus_int32 silk_max_32(opus_int32 a, opus_int32 b)
+static OPUS_INLINE opus_int32 silk_max_32(opus_int32 a, opus_int32 b)
{
ops_count += 1;
return (((a) > (b)) ? (a) : (b));
}
#undef silk_max_64
-static inline opus_int64 silk_max_64(opus_int64 a, opus_int64 b)
+static OPUS_INLINE opus_int64 silk_max_64(opus_int64 a, opus_int64 b)
{
ops_count += 1;
return (((a) > (b)) ? (a) : (b));
@@ -674,7 +674,7 @@ static inline opus_int64 silk_max_64(opus_int64 a, opus_int64 b)
#undef silk_LIMIT_int
-static inline opus_int silk_LIMIT_int(opus_int a, opus_int limit1, opus_int limit2)
+static OPUS_INLINE opus_int silk_LIMIT_int(opus_int a, opus_int limit1, opus_int limit2)
{
opus_int ret;
ops_count += 6;
@@ -686,7 +686,7 @@ static inline opus_int silk_LIMIT_int(opus_int a, opus_int limit1, opus_int limi
}
#undef silk_LIMIT_16
-static inline opus_int16 silk_LIMIT_16(opus_int16 a, opus_int16 limit1, opus_int16 limit2)
+static OPUS_INLINE opus_int16 silk_LIMIT_16(opus_int16 a, opus_int16 limit1, opus_int16 limit2)
{
opus_int16 ret;
ops_count += 6;
@@ -699,7 +699,7 @@ return(ret);
#undef silk_LIMIT_32
-static inline opus_int silk_LIMIT_32(opus_int32 a, opus_int32 limit1, opus_int32 limit2)
+static OPUS_INLINE opus_int silk_LIMIT_32(opus_int32 a, opus_int32 limit1, opus_int32 limit2)
{
opus_int32 ret;
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -36,7 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
#undef silk_ADD16
#define silk_ADD16(a,b) silk_ADD16_((a), (b), __FILE__, __LINE__)
-static inline opus_int16 silk_ADD16_(opus_int16 a, opus_int16 b, char *file, int line){
+static OPUS_INLINE opus_int16 silk_ADD16_(opus_int16 a, opus_int16 b, char *file, int line){
opus_int16 ret;
ret = a + b;
@@ -52,7 +52,7 @@ static inline opus_int16 silk_ADD16_(opus_int16 a, opus_int16 b, char *file, int
#undef silk_ADD32
#define silk_ADD32(a,b) silk_ADD32_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_ADD32_(opus_int32 a, opus_int32 b, char *file, int line){
+static OPUS_INLINE opus_int32 silk_ADD32_(opus_int32 a, opus_int32 b, char *file, int line){
opus_int32 ret;
ret = a + b;
@@ -68,7 +68,7 @@ static inline opus_int32 silk_ADD32_(opus_int32 a, opus_int32 b, char *file, int
#undef silk_ADD64
#define silk_ADD64(a,b) silk_ADD64_((a), (b), __FILE__, __LINE__)
-static inline opus_int64 silk_ADD64_(opus_int64 a, opus_int64 b, char *file, int line){
+static OPUS_INLINE opus_int64 silk_ADD64_(opus_int64 a, opus_int64 b, char *file, int line){
opus_int64 ret;
ret = a + b;
@@ -84,7 +84,7 @@ static inline opus_int64 silk_ADD64_(opus_int64 a, opus_int64 b, char *file, int
#undef silk_SUB16
#define silk_SUB16(a,b) silk_SUB16_((a), (b), __FILE__, __LINE__)
-static inline opus_int16 silk_SUB16_(opus_int16 a, opus_int16 b, char *file, int line){
+static OPUS_INLINE opus_int16 silk_SUB16_(opus_int16 a, opus_int16 b, char *file, int line){
opus_int16 ret;
ret = a - b;
@@ -100,7 +100,7 @@ static inline opus_int16 silk_SUB16_(opus_int16 a, opus_int16 b, char *file, int
#undef silk_SUB32
#define silk_SUB32(a,b) silk_SUB32_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_SUB32_(opus_int32 a, opus_int32 b, char *file, int line){
+static OPUS_INLINE opus_int32 silk_SUB32_(opus_int32 a, opus_int32 b, char *file, int line){
opus_int32 ret;
ret = a - b;
@@ -116,7 +116,7 @@ static inline opus_int32 silk_SUB32_(opus_int32 a, opus_int32 b, char *file, int
#undef silk_SUB64
#define silk_SUB64(a,b) silk_SUB64_((a), (b), __FILE__, __LINE__)
-static inline opus_int64 silk_SUB64_(opus_int64 a, opus_int64 b, char *file, int line){
+static OPUS_INLINE opus_int64 silk_SUB64_(opus_int64 a, opus_int64 b, char *file, int line){
opus_int64 ret;
ret = a - b;
@@ -132,7 +132,7 @@ static inline opus_int64 silk_SUB64_(opus_int64 a, opus_int64 b, char *file, int
#undef silk_ADD_SAT16
#define silk_ADD_SAT16(a,b) silk_ADD_SAT16_((a), (b), __FILE__, __LINE__)
-static inline opus_int16 silk_ADD_SAT16_( opus_int16 a16, opus_int16 b16, char *file, int line) {
+static OPUS_INLINE opus_int16 silk_ADD_SAT16_( opus_int16 a16, opus_int16 b16, char *file, int line) {
opus_int16 res;
res = (opus_int16)silk_SAT16( silk_ADD32( (opus_int32)(a16), (b16) ) );
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 *
#undef silk_ADD_SAT32
#define silk_ADD_SAT32(a,b) silk_ADD_SAT32_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_ADD_SAT32_(opus_int32 a32, opus_int32 b32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_ADD_SAT32_(opus_int32 a32, opus_int32 b32, char *file, int line){
opus_int32 res;
res = ((((opus_uint32)(a32) + (opus_uint32)(b32)) & 0x80000000) == 0 ? \
((((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
#undef silk_ADD_SAT64
#define silk_ADD_SAT64(a,b) silk_ADD_SAT64_((a), (b), __FILE__, __LINE__)
-static inline opus_int64 silk_ADD_SAT64_( opus_int64 a64, opus_int64 b64, char *file, int line) {
+static OPUS_INLINE opus_int64 silk_ADD_SAT64_( opus_int64 a64, opus_int64 b64, char *file, int line) {
opus_int64 res;
int fail = 0;
res = ((((a64) + (b64)) & 0x8000000000000000LL) == 0 ? \
@@ -193,7 +193,7 @@ static inline opus_int64 silk_ADD_SAT64_( opus_int64 a64, opus_int64 b64, char *
#undef silk_SUB_SAT16
#define silk_SUB_SAT16(a,b) silk_SUB_SAT16_((a), (b), __FILE__, __LINE__)
-static inline opus_int16 silk_SUB_SAT16_( opus_int16 a16, opus_int16 b16, char *file, int line ) {
+static OPUS_INLINE opus_int16 silk_SUB_SAT16_( opus_int16 a16, opus_int16 b16, char *file, int line ) {
opus_int16 res;
res = (opus_int16)silk_SAT16( silk_SUB32( (opus_int32)(a16), (b16) ) );
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 *
#undef silk_SUB_SAT32
#define silk_SUB_SAT32(a,b) silk_SUB_SAT32_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_SUB_SAT32_( opus_int32 a32, opus_int32 b32, char *file, int line ) {
+static OPUS_INLINE opus_int32 silk_SUB_SAT32_( opus_int32 a32, opus_int32 b32, char *file, int line ) {
opus_int32 res;
res = ((((opus_uint32)(a32)-(opus_uint32)(b32)) & 0x80000000) == 0 ? \
(( (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 *
#undef silk_SUB_SAT64
#define silk_SUB_SAT64(a,b) silk_SUB_SAT64_((a), (b), __FILE__, __LINE__)
-static inline opus_int64 silk_SUB_SAT64_( opus_int64 a64, opus_int64 b64, char *file, int line ) {
+static OPUS_INLINE opus_int64 silk_SUB_SAT64_( opus_int64 a64, opus_int64 b64, char *file, int line ) {
opus_int64 res;
int fail = 0;
res = ((((a64)-(b64)) & 0x8000000000000000LL) == 0 ? \
@@ -254,7 +254,7 @@ static inline opus_int64 silk_SUB_SAT64_( opus_int64 a64, opus_int64 b64, char *
#undef silk_MUL
#define silk_MUL(a,b) silk_MUL_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_MUL_(opus_int32 a32, opus_int32 b32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_MUL_(opus_int32 a32, opus_int32 b32, char *file, int line){
opus_int32 ret;
opus_int64 ret64;
ret = a32 * b32;
@@ -271,7 +271,7 @@ static inline opus_int32 silk_MUL_(opus_int32 a32, opus_int32 b32, char *file, i
#undef silk_MUL_uint
#define silk_MUL_uint(a,b) silk_MUL_uint_((a), (b), __FILE__, __LINE__)
-static inline opus_uint32 silk_MUL_uint_(opus_uint32 a32, opus_uint32 b32, char *file, int line){
+static OPUS_INLINE opus_uint32 silk_MUL_uint_(opus_uint32 a32, opus_uint32 b32, char *file, int line){
opus_uint32 ret;
ret = a32 * b32;
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
#undef silk_MLA
#define silk_MLA(a,b,c) silk_MLA_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_int32 silk_MLA_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_MLA_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
opus_int32 ret;
ret = a32 + b32 * c32;
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
#undef silk_MLA_uint
#define silk_MLA_uint(a,b,c) silk_MLA_uint_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_int32 silk_MLA_uint_(opus_uint32 a32, opus_uint32 b32, opus_uint32 c32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_MLA_uint_(opus_uint32 a32, opus_uint32 b32, opus_uint32 c32, char *file, int line){
opus_uint32 ret;
ret = a32 + b32 * c32;
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
#undef silk_SMULWB
#define silk_SMULWB(a,b) silk_SMULWB_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_SMULWB_(opus_int32 a32, opus_int32 b32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_SMULWB_(opus_int32 a32, opus_int32 b32, char *file, int line){
opus_int32 ret;
ret = (a32 >> 16) * (opus_int32)((opus_int16)b32) + (((a32 & 0x0000FFFF) * (opus_int32)((opus_int16)b32)) >> 16);
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
#undef silk_SMLAWB
#define silk_SMLAWB(a,b,c) silk_SMLAWB_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_int32 silk_SMLAWB_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_SMLAWB_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
opus_int32 ret;
ret = silk_ADD32( a32, silk_SMULWB( b32, c32 ) );
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
#undef silk_SMULWT
#define silk_SMULWT(a,b) silk_SMULWT_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_SMULWT_(opus_int32 a32, opus_int32 b32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_SMULWT_(opus_int32 a32, opus_int32 b32, char *file, int line){
opus_int32 ret;
ret = (a32 >> 16) * (b32 >> 16) + (((a32 & 0x0000FFFF) * (b32 >> 16)) >> 16);
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
#undef silk_SMLAWT
#define silk_SMLAWT(a,b,c) silk_SMLAWT_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_int32 silk_SMLAWT_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_SMLAWT_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
opus_int32 ret;
ret = a32 + ((b32 >> 16) * (c32 >> 16)) + (((b32 & 0x0000FFFF) * ((c32 >> 16)) >> 16));
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
#undef silk_SMULL
#define silk_SMULL(a,b) silk_SMULL_((a), (b), __FILE__, __LINE__)
-static inline opus_int64 silk_SMULL_(opus_int64 a64, opus_int64 b64, char *file, int line){
+static OPUS_INLINE opus_int64 silk_SMULL_(opus_int64 a64, opus_int64 b64, char *file, int line){
opus_int64 ret64;
int fail = 0;
ret64 = a64 * b64;
@@ -398,7 +398,7 @@ static inline opus_int64 silk_SMULL_(opus_int64 a64, opus_int64 b64, char *file,
/* no checking needed for silk_SMULBB */
#undef silk_SMLABB
#define silk_SMLABB(a,b,c) silk_SMLABB_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_int32 silk_SMLABB_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_SMLABB_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
opus_int32 ret;
ret = a32 + (opus_int32)((opus_int16)b32) * (opus_int32)((opus_int16)c32);
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
/* no checking needed for silk_SMULBT */
#undef silk_SMLABT
#define silk_SMLABT(a,b,c) silk_SMLABT_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_int32 silk_SMLABT_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_SMLABT_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
opus_int32 ret;
ret = a32 + ((opus_int32)((opus_int16)b32)) * (c32 >> 16);
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
/* no checking needed for silk_SMULTT */
#undef silk_SMLATT
#define silk_SMLATT(a,b,c) silk_SMLATT_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_int32 silk_SMLATT_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_SMLATT_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
opus_int32 ret;
ret = a32 + (b32 >> 16) * (c32 >> 16);
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
#undef silk_SMULWW
#define silk_SMULWW(a,b) silk_SMULWW_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_SMULWW_(opus_int32 a32, opus_int32 b32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_SMULWW_(opus_int32 a32, opus_int32 b32, char *file, int line){
opus_int32 ret, tmp1, tmp2;
opus_int64 ret64;
int fail = 0;
@@ -476,7 +476,7 @@ static inline opus_int32 silk_SMULWW_(opus_int32 a32, opus_int32 b32, char *file
#undef silk_SMLAWW
#define silk_SMLAWW(a,b,c) silk_SMLAWW_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_int32 silk_SMLAWW_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_SMLAWW_(opus_int32 a32, opus_int32 b32, opus_int32 c32, char *file, int line){
opus_int32 ret, tmp;
tmp = silk_SMULWW( b32, c32 );
@@ -505,7 +505,7 @@ static inline opus_int32 silk_SMLAWW_(opus_int32 a32, opus_int32 b32, opus_int32
#undef silk_DIV32
#define silk_DIV32(a,b) silk_DIV32_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_DIV32_(opus_int32 a32, opus_int32 b32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_DIV32_(opus_int32 a32, opus_int32 b32, char *file, int line){
if ( b32 == 0 )
{
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,
#undef silk_DIV32_16
#define silk_DIV32_16(a,b) silk_DIV32_16_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_DIV32_16_(opus_int32 a32, opus_int32 b32, char *file, int line){
+static OPUS_INLINE opus_int32 silk_DIV32_16_(opus_int32 a32, opus_int32 b32, char *file, int line){
int fail = 0;
fail |= b32 == 0;
fail |= b32 > silk_int16_MAX;
@@ -544,7 +544,7 @@ static inline opus_int32 silk_DIV32_16_(opus_int32 a32, opus_int32 b32, char *fi
#undef silk_LSHIFT8
#define silk_LSHIFT8(a,b) silk_LSHIFT8_((a), (b), __FILE__, __LINE__)
-static inline opus_int8 silk_LSHIFT8_(opus_int8 a, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_int8 silk_LSHIFT8_(opus_int8 a, opus_int32 shift, char *file, int line){
opus_int8 ret;
int fail = 0;
ret = a << shift;
@@ -563,7 +563,7 @@ static inline opus_int8 silk_LSHIFT8_(opus_int8 a, opus_int32 shift, char *file,
#undef silk_LSHIFT16
#define silk_LSHIFT16(a,b) silk_LSHIFT16_((a), (b), __FILE__, __LINE__)
-static inline opus_int16 silk_LSHIFT16_(opus_int16 a, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_int16 silk_LSHIFT16_(opus_int16 a, opus_int32 shift, char *file, int line){
opus_int16 ret;
int fail = 0;
ret = a << shift;
@@ -582,7 +582,7 @@ static inline opus_int16 silk_LSHIFT16_(opus_int16 a, opus_int32 shift, char *fi
#undef silk_LSHIFT32
#define silk_LSHIFT32(a,b) silk_LSHIFT32_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_LSHIFT32_(opus_int32 a, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_int32 silk_LSHIFT32_(opus_int32 a, opus_int32 shift, char *file, int line){
opus_int32 ret;
int fail = 0;
ret = a << shift;
@@ -601,7 +601,7 @@ static inline opus_int32 silk_LSHIFT32_(opus_int32 a, opus_int32 shift, char *fi
#undef silk_LSHIFT64
#define silk_LSHIFT64(a,b) silk_LSHIFT64_((a), (b), __FILE__, __LINE__)
-static inline opus_int64 silk_LSHIFT64_(opus_int64 a, opus_int shift, char *file, int line){
+static OPUS_INLINE opus_int64 silk_LSHIFT64_(opus_int64 a, opus_int shift, char *file, int line){
opus_int64 ret;
int fail = 0;
ret = a << shift;
@@ -620,7 +620,7 @@ static inline opus_int64 silk_LSHIFT64_(opus_int64 a, opus_int shift, char *file
#undef silk_LSHIFT_ovflw
#define silk_LSHIFT_ovflw(a,b) silk_LSHIFT_ovflw_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_LSHIFT_ovflw_(opus_int32 a, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_int32 silk_LSHIFT_ovflw_(opus_int32 a, opus_int32 shift, char *file, int line){
if ( (shift < 0) || (shift >= 32) ) /* no check for overflow */
{
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
#undef silk_LSHIFT_uint
#define silk_LSHIFT_uint(a,b) silk_LSHIFT_uint_((a), (b), __FILE__, __LINE__)
-static inline opus_uint32 silk_LSHIFT_uint_(opus_uint32 a, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_uint32 silk_LSHIFT_uint_(opus_uint32 a, opus_int32 shift, char *file, int line){
opus_uint32 ret;
ret = a << shift;
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
#undef silk_RSHIFT8
#define silk_RSHITF8(a,b) silk_RSHIFT8_((a), (b), __FILE__, __LINE__)
-static inline opus_int8 silk_RSHIFT8_(opus_int8 a, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_int8 silk_RSHIFT8_(opus_int8 a, opus_int32 shift, char *file, int line){
if ( (shift < 0) || (shift>=8) )
{
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,
#undef silk_RSHIFT16
#define silk_RSHITF16(a,b) silk_RSHIFT16_((a), (b), __FILE__, __LINE__)
-static inline opus_int16 silk_RSHIFT16_(opus_int16 a, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_int16 silk_RSHIFT16_(opus_int16 a, opus_int32 shift, char *file, int line){
if ( (shift < 0) || (shift>=16) )
{
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
#undef silk_RSHIFT32
#define silk_RSHIFT32(a,b) silk_RSHIFT32_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_RSHIFT32_(opus_int32 a, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_int32 silk_RSHIFT32_(opus_int32 a, opus_int32 shift, char *file, int line){
if ( (shift < 0) || (shift>=32) )
{
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
#undef silk_RSHIFT64
#define silk_RSHIFT64(a,b) silk_RSHIFT64_((a), (b), __FILE__, __LINE__)
-static inline opus_int64 silk_RSHIFT64_(opus_int64 a, opus_int64 shift, char *file, int line){
+static OPUS_INLINE opus_int64 silk_RSHIFT64_(opus_int64 a, opus_int64 shift, char *file, int line){
if ( (shift < 0) || (shift>=64) )
{
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
#undef silk_RSHIFT_uint
#define silk_RSHIFT_uint(a,b) silk_RSHIFT_uint_((a), (b), __FILE__, __LINE__)
-static inline opus_uint32 silk_RSHIFT_uint_(opus_uint32 a, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_uint32 silk_RSHIFT_uint_(opus_uint32 a, opus_int32 shift, char *file, int line){
if ( (shift < 0) || (shift>32) )
{
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
#undef silk_ADD_LSHIFT
#define silk_ADD_LSHIFT(a,b,c) silk_ADD_LSHIFT_((a), (b), (c), __FILE__, __LINE__)
-static inline int silk_ADD_LSHIFT_(int a, int b, int shift, char *file, int line){
+static OPUS_INLINE int silk_ADD_LSHIFT_(int a, int b, int shift, char *file, int line){
opus_int16 ret;
ret = a + (b << shift);
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
#undef silk_ADD_LSHIFT32
#define silk_ADD_LSHIFT32(a,b,c) silk_ADD_LSHIFT32_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_int32 silk_ADD_LSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_int32 silk_ADD_LSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){
opus_int32 ret;
ret = a + (b << shift);
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
#undef silk_ADD_LSHIFT_uint
#define silk_ADD_LSHIFT_uint(a,b,c) silk_ADD_LSHIFT_uint_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_uint32 silk_ADD_LSHIFT_uint_(opus_uint32 a, opus_uint32 b, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_uint32 silk_ADD_LSHIFT_uint_(opus_uint32 a, opus_uint32 b, opus_int32 shift, char *file, int line){
opus_uint32 ret;
ret = a + (b << shift);
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
#undef silk_ADD_RSHIFT
#define silk_ADD_RSHIFT(a,b,c) silk_ADD_RSHIFT_((a), (b), (c), __FILE__, __LINE__)
-static inline int silk_ADD_RSHIFT_(int a, int b, int shift, char *file, int line){
+static OPUS_INLINE int silk_ADD_RSHIFT_(int a, int b, int shift, char *file, int line){
opus_int16 ret;
ret = a + (b >> shift);
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
#undef silk_ADD_RSHIFT32
#define silk_ADD_RSHIFT32(a,b,c) silk_ADD_RSHIFT32_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_int32 silk_ADD_RSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_int32 silk_ADD_RSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){
opus_int32 ret;
ret = a + (b >> shift);
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
#undef silk_ADD_RSHIFT_uint
#define silk_ADD_RSHIFT_uint(a,b,c) silk_ADD_RSHIFT_uint_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_uint32 silk_ADD_RSHIFT_uint_(opus_uint32 a, opus_uint32 b, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_uint32 silk_ADD_RSHIFT_uint_(opus_uint32 a, opus_uint32 b, opus_int32 shift, char *file, int line){
opus_uint32 ret;
ret = a + (b >> shift);
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
#undef silk_SUB_LSHIFT32
#define silk_SUB_LSHIFT32(a,b,c) silk_SUB_LSHIFT32_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_int32 silk_SUB_LSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_int32 silk_SUB_LSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){
opus_int32 ret;
ret = a - (b << shift);
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
#undef silk_SUB_RSHIFT32
#define silk_SUB_RSHIFT32(a,b,c) silk_SUB_RSHIFT32_((a), (b), (c), __FILE__, __LINE__)
-static inline opus_int32 silk_SUB_RSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_int32 silk_SUB_RSHIFT32_(opus_int32 a, opus_int32 b, opus_int32 shift, char *file, int line){
opus_int32 ret;
ret = a - (b >> shift);
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
#undef silk_RSHIFT_ROUND
#define silk_RSHIFT_ROUND(a,b) silk_RSHIFT_ROUND_((a), (b), __FILE__, __LINE__)
-static inline opus_int32 silk_RSHIFT_ROUND_(opus_int32 a, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_int32 silk_RSHIFT_ROUND_(opus_int32 a, opus_int32 shift, char *file, int line){
opus_int32 ret;
ret = shift == 1 ? (a >> 1) + (a & 1) : ((a >> (shift - 1)) + 1) >> 1;
/* 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
#undef silk_RSHIFT_ROUND64
#define silk_RSHIFT_ROUND64(a,b) silk_RSHIFT_ROUND64_((a), (b), __FILE__, __LINE__)
-static inline opus_int64 silk_RSHIFT_ROUND64_(opus_int64 a, opus_int32 shift, char *file, int line){
+static OPUS_INLINE opus_int64 silk_RSHIFT_ROUND64_(opus_int64 a, opus_int32 shift, char *file, int line){
opus_int64 ret;
/* the marco definition can't handle a shift of zero */
if ( (shift <= 0) || (shift>=64) )
@@ -865,14 +865,14 @@ static inline opus_int64 silk_RSHIFT_ROUND64_(opus_int64 a, opus_int32 shift, ch
/* silk_abs is used on floats also, so doesn't work... */
/*#undef silk_abs
-static inline opus_int32 silk_abs(opus_int32 a){
+static OPUS_INLINE opus_int32 silk_abs(opus_int32 a){
silk_assert(a != 0x80000000);
return (((a) > 0) ? (a) : -(a)); // Be careful, silk_abs returns wrong when input equals to silk_intXX_MIN
}*/
#undef silk_abs_int64
#define silk_abs_int64(a) silk_abs_int64_((a), __FILE__, __LINE__)
-static inline opus_int64 silk_abs_int64_(opus_int64 a, char *file, int line){
+static OPUS_INLINE opus_int64 silk_abs_int64_(opus_int64 a, char *file, int line){
if ( a == silk_int64_MIN )
{
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){
#undef silk_abs_int32
#define silk_abs_int32(a) silk_abs_int32_((a), __FILE__, __LINE__)
-static inline opus_int32 silk_abs_int32_(opus_int32 a, char *file, int line){
+static OPUS_INLINE opus_int32 silk_abs_int32_(opus_int32 a, char *file, int line){
if ( a == silk_int32_MIN )
{
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){
#undef silk_CHECK_FIT8
#define silk_CHECK_FIT8(a) silk_CHECK_FIT8_((a), __FILE__, __LINE__)
-static inline opus_int8 silk_CHECK_FIT8_( opus_int64 a, char *file, int line ){
+static OPUS_INLINE opus_int8 silk_CHECK_FIT8_( opus_int64 a, char *file, int line ){
opus_int8 ret;
ret = (opus_int8)a;
if ( (opus_int64)ret != a )
@@ -913,7 +913,7 @@ static inline opus_int8 silk_CHECK_FIT8_( opus_int64 a, char *file, int line ){
#undef silk_CHECK_FIT16
#define silk_CHECK_FIT16(a) silk_CHECK_FIT16_((a), __FILE__, __LINE__)
-static inline opus_int16 silk_CHECK_FIT16_( opus_int64 a, char *file, int line ){
+static OPUS_INLINE opus_int16 silk_CHECK_FIT16_( opus_int64 a, char *file, int line ){
opus_int16 ret;
ret = (opus_int16)a;
if ( (opus_int64)ret != a )
@@ -928,7 +928,7 @@ static inline opus_int16 silk_CHECK_FIT16_( opus_int64 a, char *file, int line )
#undef silk_CHECK_FIT32
#define silk_CHECK_FIT32(a) silk_CHECK_FIT32_((a), __FILE__, __LINE__)
-static inline opus_int32 silk_CHECK_FIT32_( opus_int64 a, char *file, int line ){
+static OPUS_INLINE opus_int32 silk_CHECK_FIT32_( opus_int64 a, char *file, int line ){
opus_int32 ret;
ret = (opus_int32)a;
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -41,7 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define QA 16
/* helper function for NLSF2A(..) */
-static inline void silk_NLSF2A_find_poly(
+static OPUS_INLINE void silk_NLSF2A_find_poly(
opus_int32 *out, /* O intermediate polynomial, QA [dd+1] */
const opus_int32 *cLSF, /* I vector of interleaved 2*cos(LSFs), QA [d] */
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "main.h"
/* Predictive dequantizer for NLSF residuals */
-static inline void silk_NLSF_residual_dequant( /* O Returns RD value in Q30 */
+static OPUS_INLINE void silk_NLSF_residual_dequant( /* O Returns RD value in Q30 */
opus_int16 x_Q10[], /* O Output [ order ] */
const opus_int8 indices[], /* I Quantization indices [ order ] */
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -38,12 +38,12 @@ static const opus_int16 HARM_ATT_Q15[NB_ATT] = { 32440, 31130 }; /*
static const opus_int16 PLC_RAND_ATTENUATE_V_Q15[NB_ATT] = { 31130, 26214 }; /* 0.95, 0.8 */
static const opus_int16 PLC_RAND_ATTENUATE_UV_Q15[NB_ATT] = { 32440, 29491 }; /* 0.99, 0.9 */
-static inline void silk_PLC_update(
+static OPUS_INLINE void silk_PLC_update(
silk_decoder_state *psDec, /* I/O Decoder state */
silk_decoder_control *psDecCtrl /* I/O Decoder control */
);
-static inline void silk_PLC_conceal(
+static OPUS_INLINE void silk_PLC_conceal(
silk_decoder_state *psDec, /* I/O Decoder state */
silk_decoder_control *psDecCtrl, /* I/O Decoder control */
opus_int16 frame[] /* O LPC residual signal */
@@ -92,7 +92,7 @@ void silk_PLC(
/**************************************************/
/* Update state of PLC */
/**************************************************/
-static inline void silk_PLC_update(
+static OPUS_INLINE void silk_PLC_update(
silk_decoder_state *psDec, /* I/O Decoder state */
silk_decoder_control *psDecCtrl /* I/O Decoder control */
)
@@ -165,7 +165,7 @@ static inline void silk_PLC_update(
psPLC->nb_subfr = psDec->nb_subfr;
}
-static inline void silk_PLC_conceal(
+static OPUS_INLINE void silk_PLC_conceal(
silk_decoder_state *psDec, /* I/O Decoder state */
silk_decoder_control *psDecCtrl, /* I/O Decoder control */
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -227,7 +227,8 @@ void silk_autocorr(
opus_int *scale, /* O Scaling of the correlation vector */
const opus_int16 *inputData, /* I Input data to correlate */
const opus_int inputDataSize, /* I Length of input */
- const opus_int correlationCount /* I Number of correlation taps to compute */
+ const opus_int correlationCount, /* I Number of correlation taps to compute */
+ int arch /* I Run-time architecture */
);
void silk_decode_pitch(
@@ -249,7 +250,8 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0
const opus_int search_thres2_Q13, /* I Final threshold for lag candidates 0 - 1 */
const opus_int Fs_kHz, /* I Sample frequency (kHz) */
const opus_int complexity, /* I Complexity setting, 0-2, where 2 is highest */
- const opus_int nb_subfr /* I number of 5 ms subframes */
+ const opus_int nb_subfr, /* I number of 5 ms subframes */
+ int arch /* I Run-time architecture */
);
/* Compute Normalized Line Spectral Frequencies (NLSFs) from whitening filter coefficients */
@@ -309,7 +311,8 @@ void silk_burg_modified(
const opus_int32 minInvGain_Q30, /* I Inverse of max prediction gain */
const opus_int subfr_length, /* I Input signal subframe length (incl. D preceding samples) */
const opus_int nb_subfr, /* I Number of subframes stacked in x */
- const opus_int D /* I Order */
+ const opus_int D, /* I Order */
+ int arch /* I Run-time architecture */
);
/* Copy and multiply a vector by a constant */
@@ -358,8 +361,8 @@ opus_int64 silk_inner_prod16_aligned_64(
/* Rotate a32 right by 'rot' bits. Negative rot values result in rotating
left. Output is 32bit int.
Note: contemporary compilers recognize the C expression below and
- compile it into a 'ror' instruction if available. No need for inline ASM! */
-static inline opus_int32 silk_ROR32( opus_int32 a32, opus_int rot )
+ compile it into a 'ror' instruction if available. No need for OPUS_INLINE ASM! */
+static OPUS_INLINE opus_int32 silk_ROR32( opus_int32 a32, opus_int rot )
{
opus_uint32 x = (opus_uint32) a32;
opus_uint32 r = (opus_uint32) rot;
@@ -508,37 +511,37 @@ static inline opus_int32 silk_ROR32( opus_int32 a32, opus_int rot )
#define SILK_FIX_CONST( C, Q ) ((opus_int32)((C) * ((opus_int64)1 << (Q)) + 0.5))
/* silk_min() versions with typecast in the function call */
-static inline opus_int silk_min_int(opus_int a, opus_int b)
+static OPUS_INLINE opus_int silk_min_int(opus_int a, opus_int b)
{
return (((a) < (b)) ? (a) : (b));
}
-static inline opus_int16 silk_min_16(opus_int16 a, opus_int16 b)
+static OPUS_INLINE opus_int16 silk_min_16(opus_int16 a, opus_int16 b)
{
return (((a) < (b)) ? (a) : (b));
}
-static inline opus_int32 silk_min_32(opus_int32 a, opus_int32 b)
+static OPUS_INLINE opus_int32 silk_min_32(opus_int32 a, opus_int32 b)
{
return (((a) < (b)) ? (a) : (b));
}
-static inline opus_int64 silk_min_64(opus_int64 a, opus_int64 b)
+static OPUS_INLINE opus_int64 silk_min_64(opus_int64 a, opus_int64 b)
{
return (((a) < (b)) ? (a) : (b));
}
/* silk_min() versions with typecast in the function call */
-static inline opus_int silk_max_int(opus_int a, opus_int b)
+static OPUS_INLINE opus_int silk_max_int(opus_int a, opus_int b)
{
return (((a) > (b)) ? (a) : (b));
}
-static inline opus_int16 silk_max_16(opus_int16 a, opus_int16 b)
+static OPUS_INLINE opus_int16 silk_max_16(opus_int16 a, opus_int16 b)
{
return (((a) > (b)) ? (a) : (b));
}
-static inline opus_int32 silk_max_32(opus_int32 a, opus_int32 b)
+static OPUS_INLINE opus_int32 silk_max_32(opus_int32 a, opus_int32 b)
{
return (((a) > (b)) ? (a) : (b));
}
-static inline opus_int64 silk_max_64(opus_int64 a, opus_int64 b)
+static OPUS_INLINE opus_int64 silk_max_64(opus_int64 a, opus_int64 b)
{
return (((a) > (b)) ? (a) : (b));
}
@@ -576,11 +579,11 @@ static inline opus_int64 silk_max_64(opus_int64 a, opus_int64 b)
#include "MacroCount.h"
#include "MacroDebug.h"
-#ifdef ARMv4_ASM
+#ifdef OPUS_ARM_INLINE_ASM
#include "arm/SigProc_FIX_armv4.h"
#endif
-#ifdef ARMv5E_ASM
+#ifdef OPUS_ARM_INLINE_EDSP
#include "arm/SigProc_FIX_armv5e.h"
#endif
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.
#define SILK_SIGPROC_FIX_ARMv4_H
#undef silk_MLA
-static inline opus_int32 silk_MLA_armv4(opus_int32 a, opus_int32 b,
+static OPUS_INLINE opus_int32 silk_MLA_armv4(opus_int32 a, opus_int32 b,
opus_int32 c)
{
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.
#define SILK_SIGPROC_FIX_ARMv5E_H
#undef silk_SMULTT
-static inline opus_int32 silk_SMULTT_armv5e(opus_int32 a, opus_int32 b)
+static OPUS_INLINE opus_int32 silk_SMULTT_armv5e(opus_int32 a, opus_int32 b)
{
opus_int32 res;
__asm__(
@@ -44,7 +44,7 @@ static inline opus_int32 silk_SMULTT_armv5e(opus_int32 a, opus_int32 b)
#define silk_SMULTT(a, b) (silk_SMULTT_armv5e(a, b))
#undef silk_SMLATT
-static inline opus_int32 silk_SMLATT_armv5e(opus_int32 a, opus_int32 b,
+static OPUS_INLINE opus_int32 silk_SMLATT_armv5e(opus_int32 a, opus_int32 b,
opus_int32 c)
{
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.
/* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */
#undef silk_SMULWB
-static inline opus_int32 silk_SMULWB_armv4(opus_int32 a, opus_int16 b)
+static OPUS_INLINE opus_int32 silk_SMULWB_armv4(opus_int32 a, opus_int16 b)
{
unsigned rd_lo;
int rd_hi;
@@ -50,7 +50,7 @@ static inline opus_int32 silk_SMULWB_armv4(opus_int32 a, opus_int16 b)
/* (a32 * (b32 >> 16)) >> 16 */
#undef silk_SMULWT
-static inline opus_int32 silk_SMULWT_armv4(opus_int32 a, opus_int32 b)
+static OPUS_INLINE opus_int32 silk_SMULWT_armv4(opus_int32 a, opus_int32 b)
{
unsigned rd_lo;
int rd_hi;
@@ -70,7 +70,7 @@ static inline opus_int32 silk_SMULWT_armv4(opus_int32 a, opus_int32 b)
/* (a32 * b32) >> 16 */
#undef silk_SMULWW
-static inline opus_int32 silk_SMULWW_armv4(opus_int32 a, opus_int32 b)
+static OPUS_INLINE opus_int32 silk_SMULWW_armv4(opus_int32 a, opus_int32 b)
{
unsigned rd_lo;
int rd_hi;
@@ -85,7 +85,7 @@ static inline opus_int32 silk_SMULWW_armv4(opus_int32 a, opus_int32 b)
#define silk_SMULWW(a, b) (silk_SMULWW_armv4(a, b))
#undef silk_SMLAWW
-static inline opus_int32 silk_SMLAWW_armv4(opus_int32 a, opus_int32 b,
+static OPUS_INLINE opus_int32 silk_SMLAWW_armv4(opus_int32 a, opus_int32 b,
opus_int32 c)
{
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.
/* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */
#undef silk_SMULWB
-static inline opus_int32 silk_SMULWB_armv5e(opus_int32 a, opus_int16 b)
+static OPUS_INLINE opus_int32 silk_SMULWB_armv5e(opus_int32 a, opus_int16 b)
{
int res;
__asm__(
@@ -46,7 +46,7 @@ static inline opus_int32 silk_SMULWB_armv5e(opus_int32 a, opus_int16 b)
/* a32 + (b32 * (opus_int32)((opus_int16)(c32))) >> 16 output have to be 32bit int */
#undef silk_SMLAWB
-static inline opus_int32 silk_SMLAWB_armv5e(opus_int32 a, opus_int32 b,
+static OPUS_INLINE opus_int32 silk_SMLAWB_armv5e(opus_int32 a, opus_int32 b,
opus_int16 c)
{
int res;
@@ -62,7 +62,7 @@ static inline opus_int32 silk_SMLAWB_armv5e(opus_int32 a, opus_int32 b,
/* (a32 * (b32 >> 16)) >> 16 */
#undef silk_SMULWT
-static inline opus_int32 silk_SMULWT_armv5e(opus_int32 a, opus_int32 b)
+static OPUS_INLINE opus_int32 silk_SMULWT_armv5e(opus_int32 a, opus_int32 b)
{
int res;
__asm__(
@@ -77,7 +77,7 @@ static inline opus_int32 silk_SMULWT_armv5e(opus_int32 a, opus_int32 b)
/* a32 + (b32 * (c32 >> 16)) >> 16 */
#undef silk_SMLAWT
-static inline opus_int32 silk_SMLAWT_armv5e(opus_int32 a, opus_int32 b,
+static OPUS_INLINE opus_int32 silk_SMLAWT_armv5e(opus_int32 a, opus_int32 b,
opus_int32 c)
{
int res;
@@ -93,7 +93,7 @@ static inline opus_int32 silk_SMLAWT_armv5e(opus_int32 a, opus_int32 b,
/* (opus_int32)((opus_int16)(a3))) * (opus_int32)((opus_int16)(b32)) output have to be 32bit int */
#undef silk_SMULBB
-static inline opus_int32 silk_SMULBB_armv5e(opus_int32 a, opus_int32 b)
+static OPUS_INLINE opus_int32 silk_SMULBB_armv5e(opus_int32 a, opus_int32 b)
{
int res;
__asm__(
@@ -108,7 +108,7 @@ static inline opus_int32 silk_SMULBB_armv5e(opus_int32 a, opus_int32 b)
/* a32 + (opus_int32)((opus_int16)(b32)) * (opus_int32)((opus_int16)(c32)) output have to be 32bit int */
#undef silk_SMLABB
-static inline opus_int32 silk_SMLABB_armv5e(opus_int32 a, opus_int32 b,
+static OPUS_INLINE opus_int32 silk_SMLABB_armv5e(opus_int32 a, opus_int32 b,
opus_int32 c)
{
int res;
@@ -124,7 +124,7 @@ static inline opus_int32 silk_SMLABB_armv5e(opus_int32 a, opus_int32 b,
/* (opus_int32)((opus_int16)(a32)) * (b32 >> 16) */
#undef silk_SMULBT
-static inline opus_int32 silk_SMULBT_armv5e(opus_int32 a, opus_int32 b)
+static OPUS_INLINE opus_int32 silk_SMULBT_armv5e(opus_int32 a, opus_int32 b)
{
int res;
__asm__(
@@ -139,7 +139,7 @@ static inline opus_int32 silk_SMULBT_armv5e(opus_int32 a, opus_int32 b)
/* a32 + (opus_int32)((opus_int16)(b32)) * (c32 >> 16) */
#undef silk_SMLABT
-static inline opus_int32 silk_SMLABT_armv5e(opus_int32 a, opus_int32 b,
+static OPUS_INLINE opus_int32 silk_SMLABT_armv5e(opus_int32 a, opus_int32 b,
opus_int32 c)
{
int res;
@@ -155,7 +155,7 @@ static inline opus_int32 silk_SMLABT_armv5e(opus_int32 a, opus_int32 b,
/* add/subtract with output saturated */
#undef silk_ADD_SAT32
-static inline opus_int32 silk_ADD_SAT32_armv5e(opus_int32 a, opus_int32 b)
+static OPUS_INLINE opus_int32 silk_ADD_SAT32_armv5e(opus_int32 a, opus_int32 b)
{
int res;
__asm__(
@@ -169,7 +169,7 @@ static inline opus_int32 silk_ADD_SAT32_armv5e(opus_int32 a, opus_int32 b)
#define silk_ADD_SAT32(a, b) (silk_ADD_SAT32_armv5e(a, b))
#undef silk_SUB_SAT32
-static inline opus_int32 silk_SUB_SAT32_armv5e(opus_int32 a, opus_int32 b)
+static OPUS_INLINE opus_int32 silk_SUB_SAT32_armv5e(opus_int32 a, opus_int32 b)
{
int res;
__asm__(
@@ -183,7 +183,7 @@ static inline opus_int32 silk_SUB_SAT32_armv5e(opus_int32 a, opus_int32 b)
#define silk_SUB_SAT32(a, b) (silk_SUB_SAT32_armv5e(a, b))
#undef silk_CLZ16
-static inline opus_int32 silk_CLZ16_armv5(opus_int16 in16)
+static OPUS_INLINE opus_int32 silk_CLZ16_armv5(opus_int16 in16)
{
int res;
__asm__(
@@ -197,7 +197,7 @@ static inline opus_int32 silk_CLZ16_armv5(opus_int16 in16)
#define silk_CLZ16(in16) (silk_CLZ16_armv5(in16))
#undef silk_CLZ32
-static inline opus_int32 silk_CLZ32_armv5(opus_int32 in32)
+static OPUS_INLINE opus_int32 silk_CLZ32_armv5(opus_int32 in32)
{
int res;
__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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -92,6 +92,9 @@ typedef struct {
/* I: Opus encoder is allowing us to switch bandwidth */
opus_int opusCanSwitch;
+ /* I: Make frames as independent as possible (but still use LPC) */
+ opus_int reducedDependency;
+
/* O: Internal sampling rate used, in Hertz; 8000/12000/16000 */
opus_int32 internalSampleRate;
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -305,7 +305,7 @@ opus_int silk_Decode( /* O Returns error co
/* Set up pointers to temp buffers */
ALLOC( samplesOut2_tmp,
- decControl->nChannelsAPI == 2 ? *nSamplesOut : 0, opus_int16 );
+ decControl->nChannelsAPI == 2 ? *nSamplesOut : ALLOC_NONE, opus_int16 );
if( decControl->nChannelsAPI == 2 ) {
resample_out_ptr = samplesOut2_tmp;
} 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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -41,7 +41,9 @@ opus_int32 silk_log2lin(
if( inLog_Q7 < 0 ) {
return 0;
- }
+ } else if ( inLog_Q7 >= 3967 ) {
+ return silk_int32_MAX;
+ }
out = silk_LSHIFT( 1, silk_RSHIFT( inLog_Q7, 7 ) );
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -32,7 +32,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include "config.h"
#endif
-/* This is an inline header file for general platform. */
+#include "opus_types.h"
+#include "opus_defines.h"
+
+/* This is an OPUS_INLINE header file for general platform. */
/* (a32 * (opus_int32)((opus_int16)(b32))) >> 16 output have to be 32bit int */
#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.
#include "ecintrin.h"
-static inline opus_int32 silk_CLZ16(opus_int16 in16)
+static OPUS_INLINE opus_int32 silk_CLZ16(opus_int16 in16)
{
return 32 - EC_ILOG(in16<<16|0x8000);
}
-static inline opus_int32 silk_CLZ32(opus_int32 in32)
+static OPUS_INLINE opus_int32 silk_CLZ32(opus_int32 in32)
{
return in32 ? 32 - EC_ILOG(in32) : 32;
}
@@ -100,15 +103,15 @@ static inline opus_int32 silk_CLZ32(opus_int32 in32)
(*((Matrix_base_adr) + ((row)+(M)*(column))))
#endif
-#ifdef ARMv4_ASM
+#ifdef OPUS_ARM_INLINE_ASM
#include "arm/macros_armv4.h"
#endif
-#ifdef ARMv5E_ASM
+#ifdef OPUS_ARM_INLINE_EDSP
#include "arm/macros_armv5e.h"
#endif
-#ifdef CF_ASM
+#ifdef OPUS_CF_INLINE_ASM
#include "cf/macros_cf.h"
#endif
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -204,6 +204,7 @@ void silk_quant_LTP_gains(
opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (un)quantized LTP gains */
opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook Index */
opus_int8 *periodicity_index, /* O Periodicity Index */
+ opus_int32 *sum_gain_dB_Q7, /* I/O Cumulative max prediction gain */
const opus_int32 W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I Error Weights in Q18 */
opus_int mu_Q9, /* I Mu value (R/D tradeoff) */
opus_int lowComplexity, /* I Flag for low complexity */
@@ -214,11 +215,14 @@ void silk_quant_LTP_gains(
void silk_VQ_WMat_EC(
opus_int8 *ind, /* O index of best codebook vector */
opus_int32 *rate_dist_Q14, /* O best weighted quant error + mu * rate */
+ opus_int *gain_Q7, /* O sum of absolute LTP coefficients */
const opus_int16 *in_Q14, /* I input vector to be quantized */
const opus_int32 *W_Q18, /* I weighting matrix */
const opus_int8 *cb_Q7, /* I codebook */
+ const opus_uint8 *cb_gain_Q7, /* I codebook effective gain */
const opus_uint8 *cl_Q5, /* I code length for each codebook vector */
const opus_int mu_Q9, /* I tradeoff betw. weighted error and rate */
+ const opus_int32 max_gain_Q7, /* I maximum sum of absolute LTP coefficients */
opus_int L /* I number of vectors in codebook */
);
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "resampler_private.h"
#include "stack_alloc.h"
-static inline opus_int16 *silk_resampler_private_IIR_FIR_INTERPOL(
+static OPUS_INLINE opus_int16 *silk_resampler_private_IIR_FIR_INTERPOL(
opus_int16 *out,
opus_int16 *buf,
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "resampler_private.h"
#include "stack_alloc.h"
-static inline opus_int16 *silk_resampler_private_down_FIR_INTERPOL(
+static OPUS_INLINE opus_int16 *silk_resampler_private_down_FIR_INTERPOL(
opus_int16 *out,
opus_int32 *buf,
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
/* shell coder; pulse-subframe length is hardcoded */
-static inline void combine_pulses(
+static OPUS_INLINE void combine_pulses(
opus_int *out, /* O combined pulses vector [len] */
const opus_int *in, /* I input vector [2 * len] */
const opus_int len /* I number of OUTPUT samples */
@@ -46,7 +46,7 @@ static inline void combine_pulses(
}
#if 0
-static inline void encode_split(
+static OPUS_INLINE void encode_split(
ec_enc *psRangeEnc, /* I/O compressor data structure */
const opus_int p_child1, /* I pulse amplitude of first child subframe */
const opus_int p, /* I pulse amplitude of current subframe */
@@ -59,7 +59,7 @@ static inline void encode_split(
}
#endif
-static inline void decode_split(
+static OPUS_INLINE void decode_split(
opus_int *p_child1, /* O pulse amplitude of first child subframe */
opus_int *p_child2, /* O pulse amplitude of second child subframe */
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -83,6 +83,7 @@ void silk_insertion_sort_increasing(
}
}
}
+#endif
#ifdef FIXED_POINT
/* This function is only used by the fixed-point build */
@@ -132,7 +133,6 @@ void silk_insertion_sort_decreasing_int16(
}
}
#endif
-#endif
void silk_insertion_sort_increasing_all_values_int16(
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -171,6 +171,7 @@ typedef struct {
opus_int32 pitchEstimationThreshold_Q16; /* Threshold for pitch estimator */
opus_int LTPQuantLowComplexity; /* Flag for low complexity LTP quantization */
opus_int mu_LTP_Q9; /* Rate-distortion tradeoff in LTP quantization */
+ opus_int32 sum_log_gain_Q7; /* Cumulative max prediction gain */
opus_int NLSF_MSVQ_Survivors; /* Number of survivors in NLSF MSVQ */
opus_int first_frame_after_reset; /* Flag for deactivating NLSF interpolation, pitch prediction */
opus_int controlled_since_last_payload; /* Flag for ensuring codec_control only runs once per packet */
@@ -191,6 +192,8 @@ typedef struct {
SideInfoIndices indices;
opus_int8 pulses[ MAX_FRAME_LENGTH ];
+ int arch;
+
/* Input/output buffering */
opus_int16 inputBuf[ MAX_FRAME_LENGTH + 2 ]; /* Buffer containing input signal */
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -78,6 +78,8 @@ extern const opus_uint8 * const silk_LTP_gain_iCDF_ptrs[ NB_LTP_CBKS ];
extern const opus_uint8 * const silk_LTP_gain_BITS_Q5_ptrs[ NB_LTP_CBKS ]; /* 3 */
extern const opus_int16 silk_LTP_gain_middle_avg_RD_Q14;
extern const opus_int8 * const silk_LTP_vq_ptrs_Q7[ NB_LTP_CBKS ]; /* 168 */
+extern const opus_uint8 * const silk_LTP_vq_gain_ptrs_Q7[NB_LTP_CBKS];
+
extern const opus_int8 silk_LTP_vq_sizes[ NB_LTP_CBKS ]; /* 3 */
extern 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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -51,6 +51,7 @@ static const opus_uint8 silk_LTP_gain_iCDF_2[32] = {
24, 20, 16, 12, 9, 5, 2, 0
};
+#if 0
const opus_int16 silk_LTP_gain_middle_avg_RD_Q14 = 12304;
static 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] = {
160, 160, 166, 166, 173, 173, 182, 192,
182, 192, 192, 192, 205, 192, 205, 224
};
+#endif
const opus_uint8 * const silk_LTP_gain_iCDF_ptrs[NB_LTP_CBKS] = {
silk_LTP_gain_iCDF_0,
@@ -75,11 +77,13 @@ const opus_uint8 * const silk_LTP_gain_iCDF_ptrs[NB_LTP_CBKS] = {
silk_LTP_gain_iCDF_2
};
+#if 0
const opus_uint8 * const silk_LTP_gain_BITS_Q5_ptrs[NB_LTP_CBKS] = {
silk_LTP_gain_BITS_Q5_0,
silk_LTP_gain_BITS_Q5_1,
silk_LTP_gain_BITS_Q5_2
};
+#endif
static const opus_int8 silk_LTP_gain_vq_0[8][5] =
{
@@ -267,6 +271,32 @@ const opus_int8 * const silk_LTP_vq_ptrs_Q7[NB_LTP_CBKS] = {
(opus_int8 *)&silk_LTP_gain_vq_2[0][0]
};
+#if 0
+/* Maximum frequency-dependent response of the pitch taps above,
+ computed as max(abs(freqz(taps))) */
+static const opus_uint8 silk_LTP_gain_vq_0_gain[8] = {
+ 46, 2, 90, 87, 93, 91, 82, 98
+};
+
+static const opus_uint8 silk_LTP_gain_vq_1_gain[16] = {
+ 109, 120, 118, 12, 113, 115, 117, 119,
+ 99, 59, 87, 111, 63, 111, 112, 80
+};
+
+static const opus_uint8 silk_LTP_gain_vq_2_gain[32] = {
+ 126, 124, 125, 124, 129, 121, 126, 23,
+ 132, 127, 127, 127, 126, 127, 122, 133,
+ 130, 134, 101, 118, 119, 145, 126, 86,
+ 124, 120, 123, 119, 170, 173, 107, 109
+};
+
+const opus_uint8 * const silk_LTP_vq_gain_ptrs_Q7[NB_LTP_CBKS] = {
+ &silk_LTP_gain_vq_0_gain[0],
+ &silk_LTP_gain_vq_1_gain[0],
+ &silk_LTP_gain_vq_2_gain[0]
+};
+
const opus_int8 silk_LTP_vq_sizes[NB_LTP_CBKS] = {
8, 16, 32
};
+#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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
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.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -29,6 +29,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define SILK_TYPEDEF_H
#include "opus_types.h"
+#include "opus_defines.h"
#ifndef FIXED_POINT
# include <float.h>
@@ -63,7 +64,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifdef __GNUC__
__attribute__((noreturn))
#endif
-static inline void _silk_fatal(const char *str, const char *file, int line)
+static OPUS_INLINE void _silk_fatal(const char *str, const char *file, int line)
{
fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str);
abort();