summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libopus/celt/celt.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs/libopus/celt/celt.h')
-rw-r--r--lib/rbcodec/codecs/libopus/celt/celt.h31
1 files changed, 18 insertions, 13 deletions
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" {
52 52
53typedef struct { 53typedef struct {
54 int valid; 54 int valid;
55 opus_val16 tonality; 55 float tonality;
56 opus_val16 tonality_slope; 56 float tonality_slope;
57 opus_val16 noisiness; 57 float noisiness;
58 opus_val16 activity; 58 float activity;
59 opus_val16 music_prob; 59 float music_prob;
60 int bandwidth; 60 int bandwidth;
61}AnalysisInfo; 61}AnalysisInfo;
62 62
@@ -66,6 +66,10 @@ typedef struct {
66 66
67/* Encoder/decoder Requests */ 67/* Encoder/decoder Requests */
68 68
69/* Expose this option again when variable framesize actually works */
70#define OPUS_FRAMESIZE_VARIABLE 5010 /**< Optimize the frame size dynamically */
71
72
69#define CELT_SET_PREDICTION_REQUEST 10002 73#define CELT_SET_PREDICTION_REQUEST 10002
70/** Controls the use of interframe prediction. 74/** Controls the use of interframe prediction.
71 0=Independent frames 75 0=Independent frames
@@ -109,10 +113,7 @@ typedef struct {
109#define OPUS_SET_LFE_REQUEST 10024 113#define OPUS_SET_LFE_REQUEST 10024
110#define OPUS_SET_LFE(x) OPUS_SET_LFE_REQUEST, __opus_check_int(x) 114#define OPUS_SET_LFE(x) OPUS_SET_LFE_REQUEST, __opus_check_int(x)
111 115
112#define OPUS_SET_ENERGY_SAVE_REQUEST 10026 116#define OPUS_SET_ENERGY_MASK_REQUEST 10026
113#define OPUS_SET_ENERGY_SAVE(x) OPUS_SET_ENERGY_SAVE_REQUEST, __opus_check_val16_ptr(x)
114
115#define OPUS_SET_ENERGY_MASK_REQUEST 10028
116#define OPUS_SET_ENERGY_MASK(x) OPUS_SET_ENERGY_MASK_REQUEST, __opus_check_val16_ptr(x) 117#define OPUS_SET_ENERGY_MASK(x) OPUS_SET_ENERGY_MASK_REQUEST, __opus_check_val16_ptr(x)
117 118
118/* Encoder stuff */ 119/* Encoder stuff */
@@ -121,7 +122,8 @@ int celt_encoder_get_size(int channels);
121 122
122int celt_encode_with_ec(OpusCustomEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, int frame_size, unsigned char *compressed, int nbCompressedBytes, ec_enc *enc); 123int celt_encode_with_ec(OpusCustomEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, int frame_size, unsigned char *compressed, int nbCompressedBytes, ec_enc *enc);
123 124
124int celt_encoder_init(CELTEncoder *st, opus_int32 sampling_rate, int channels); 125int celt_encoder_init(CELTEncoder *st, opus_int32 sampling_rate, int channels,
126 int arch);
125 127
126 128
127 129
@@ -141,7 +143,7 @@ int celt_decode_with_ec(OpusCustomDecoder * OPUS_RESTRICT st, const unsigned cha
141#ifdef CUSTOM_MODES 143#ifdef CUSTOM_MODES
142#define OPUS_CUSTOM_NOSTATIC 144#define OPUS_CUSTOM_NOSTATIC
143#else 145#else
144#define OPUS_CUSTOM_NOSTATIC static inline 146#define OPUS_CUSTOM_NOSTATIC static OPUS_INLINE
145#endif 147#endif
146 148
147static const unsigned char trim_icdf[11] = {126, 124, 119, 109, 87, 41, 19, 9, 4, 2, 0}; 149static 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] = {
166 0x00, 0x08, 0x10, 0x18 168 0x00, 0x08, 0x10, 0x18
167}; 169};
168 170
169static inline int toOpus(unsigned char c) 171static OPUS_INLINE int toOpus(unsigned char c)
170{ 172{
171 int ret=0; 173 int ret=0;
172 if (c<0xA0) 174 if (c<0xA0)
@@ -177,7 +179,7 @@ static inline int toOpus(unsigned char c)
177 return ret|(c&0x7); 179 return ret|(c&0x7);
178} 180}
179 181
180static inline int fromOpus(unsigned char c) 182static OPUS_INLINE int fromOpus(unsigned char c)
181{ 183{
182 if (c<0x80) 184 if (c<0x80)
183 return -1; 185 return -1;
@@ -193,6 +195,9 @@ extern const signed char tf_select_table[4][8];
193 195
194int resampling_factor(opus_int32 rate); 196int resampling_factor(opus_int32 rate);
195 197
198void celt_preemphasis(const opus_val16 * OPUS_RESTRICT pcmp, celt_sig * OPUS_RESTRICT inp,
199 int N, int CC, int upsample, const opus_val16 *coef, celt_sig *mem, int clip);
200
196void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N, 201void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N,
197 opus_val16 g0, opus_val16 g1, int tapset0, int tapset1, 202 opus_val16 g0, opus_val16 g1, int tapset0, int tapset1,
198 const opus_val16 *window, int overlap); 203 const opus_val16 *window, int overlap);