diff options
author | William Wilgus <me.theuser@yahoo.com> | 2019-01-04 02:01:18 -0600 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2021-04-23 14:23:04 +0000 |
commit | 14c6bb798d6bebc80f07e863236adbaf8d156a9c (patch) | |
tree | 551a4b641906c2626af844fa3239c1b2b1ff0ad3 /lib/rbcodec/codecs/libopus/celt/celt.h | |
parent | 75d93937965ec4df70d37df6d4feea04577c996b (diff) | |
download | rockbox-14c6bb798d6bebc80f07e863236adbaf8d156a9c.tar.gz rockbox-14c6bb798d6bebc80f07e863236adbaf8d156a9c.zip |
Sync opus codec to upstream git
Change-Id: I0cfcc0005c4ad7bfbb1aaf454188ce70fb043dc1
Diffstat (limited to 'lib/rbcodec/codecs/libopus/celt/celt.h')
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/celt.h | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/celt.h b/lib/rbcodec/codecs/libopus/celt/celt.h index b1967516dc..24b6b2b520 100644 --- a/lib/rbcodec/codecs/libopus/celt/celt.h +++ b/lib/rbcodec/codecs/libopus/celt/celt.h | |||
@@ -50,6 +50,8 @@ extern "C" { | |||
50 | #define CELTDecoder OpusCustomDecoder | 50 | #define CELTDecoder OpusCustomDecoder |
51 | #define CELTMode OpusCustomMode | 51 | #define CELTMode OpusCustomMode |
52 | 52 | ||
53 | #define LEAK_BANDS 19 | ||
54 | |||
53 | typedef struct { | 55 | typedef struct { |
54 | int valid; | 56 | int valid; |
55 | float tonality; | 57 | float tonality; |
@@ -57,17 +59,27 @@ typedef struct { | |||
57 | float noisiness; | 59 | float noisiness; |
58 | float activity; | 60 | float activity; |
59 | float music_prob; | 61 | float music_prob; |
60 | int bandwidth; | 62 | float music_prob_min; |
61 | }AnalysisInfo; | 63 | float music_prob_max; |
64 | int bandwidth; | ||
65 | float activity_probability; | ||
66 | float max_pitch_ratio; | ||
67 | /* Store as Q6 char to save space. */ | ||
68 | unsigned char leak_boost[LEAK_BANDS]; | ||
69 | } AnalysisInfo; | ||
70 | |||
71 | typedef struct { | ||
72 | int signalType; | ||
73 | int offset; | ||
74 | } SILKInfo; | ||
62 | 75 | ||
63 | #define __celt_check_mode_ptr_ptr(ptr) ((ptr) + ((ptr) - (const CELTMode**)(ptr))) | 76 | #define __celt_check_mode_ptr_ptr(ptr) ((ptr) + ((ptr) - (const CELTMode**)(ptr))) |
64 | 77 | ||
65 | #define __celt_check_analysis_ptr(ptr) ((ptr) + ((ptr) - (const AnalysisInfo*)(ptr))) | 78 | #define __celt_check_analysis_ptr(ptr) ((ptr) + ((ptr) - (const AnalysisInfo*)(ptr))) |
66 | 79 | ||
67 | /* Encoder/decoder Requests */ | 80 | #define __celt_check_silkinfo_ptr(ptr) ((ptr) + ((ptr) - (const SILKInfo*)(ptr))) |
68 | 81 | ||
69 | /* Expose this option again when variable framesize actually works */ | 82 | /* Encoder/decoder Requests */ |
70 | #define OPUS_FRAMESIZE_VARIABLE 5010 /**< Optimize the frame size dynamically */ | ||
71 | 83 | ||
72 | 84 | ||
73 | #define CELT_SET_PREDICTION_REQUEST 10002 | 85 | #define CELT_SET_PREDICTION_REQUEST 10002 |
@@ -116,6 +128,9 @@ typedef struct { | |||
116 | #define OPUS_SET_ENERGY_MASK_REQUEST 10026 | 128 | #define OPUS_SET_ENERGY_MASK_REQUEST 10026 |
117 | #define OPUS_SET_ENERGY_MASK(x) OPUS_SET_ENERGY_MASK_REQUEST, __opus_check_val16_ptr(x) | 129 | #define OPUS_SET_ENERGY_MASK(x) OPUS_SET_ENERGY_MASK_REQUEST, __opus_check_val16_ptr(x) |
118 | 130 | ||
131 | #define CELT_SET_SILK_INFO_REQUEST 10028 | ||
132 | #define CELT_SET_SILK_INFO(x) CELT_SET_SILK_INFO_REQUEST, __celt_check_silkinfo_ptr(x) | ||
133 | |||
119 | /* Encoder stuff */ | 134 | /* Encoder stuff */ |
120 | 135 | ||
121 | int celt_encoder_get_size(int channels); | 136 | int celt_encoder_get_size(int channels); |
@@ -194,6 +209,13 @@ static OPUS_INLINE int fromOpus(unsigned char c) | |||
194 | 209 | ||
195 | extern const signed char tf_select_table[4][8]; | 210 | extern const signed char tf_select_table[4][8]; |
196 | 211 | ||
212 | #if defined(ENABLE_HARDENING) || defined(ENABLE_ASSERTIONS) | ||
213 | void validate_celt_decoder(CELTDecoder *st); | ||
214 | #define VALIDATE_CELT_DECODER(st) validate_celt_decoder(st) | ||
215 | #else | ||
216 | #define VALIDATE_CELT_DECODER(st) | ||
217 | #endif | ||
218 | |||
197 | int resampling_factor(opus_int32 rate); | 219 | int resampling_factor(opus_int32 rate); |
198 | 220 | ||
199 | void celt_preemphasis(const opus_val16 * OPUS_RESTRICT pcmp, celt_sig * OPUS_RESTRICT inp, | 221 | void celt_preemphasis(const opus_val16 * OPUS_RESTRICT pcmp, celt_sig * OPUS_RESTRICT inp, |
@@ -201,7 +223,17 @@ void celt_preemphasis(const opus_val16 * OPUS_RESTRICT pcmp, celt_sig * OPUS_RES | |||
201 | 223 | ||
202 | void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N, | 224 | void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N, |
203 | opus_val16 g0, opus_val16 g1, int tapset0, int tapset1, | 225 | opus_val16 g0, opus_val16 g1, int tapset0, int tapset1, |
204 | const opus_val16 *window, int overlap); | 226 | const opus_val16 *window, int overlap, int arch); |
227 | |||
228 | #ifdef NON_STATIC_COMB_FILTER_CONST_C | ||
229 | void comb_filter_const_c(opus_val32 *y, opus_val32 *x, int T, int N, | ||
230 | opus_val16 g10, opus_val16 g11, opus_val16 g12); | ||
231 | #endif | ||
232 | |||
233 | #ifndef OVERRIDE_COMB_FILTER_CONST | ||
234 | # define comb_filter_const(y, x, T, N, g10, g11, g12, arch) \ | ||
235 | ((void)(arch),comb_filter_const_c(y, x, T, N, g10, g11, g12)) | ||
236 | #endif | ||
205 | 237 | ||
206 | void init_caps(const CELTMode *m,int *cap,int LM,int C); | 238 | void init_caps(const CELTMode *m,int *cap,int LM,int C); |
207 | 239 | ||