diff options
Diffstat (limited to 'apps/codecs/libspeex/speex')
-rw-r--r-- | apps/codecs/libspeex/speex/speex.h | 14 | ||||
-rw-r--r-- | apps/codecs/libspeex/speex/speex_bits.h | 3 | ||||
-rw-r--r-- | apps/codecs/libspeex/speex/speex_jitter.h | 4 | ||||
-rw-r--r-- | apps/codecs/libspeex/speex/speex_resampler.h | 133 |
4 files changed, 86 insertions, 68 deletions
diff --git a/apps/codecs/libspeex/speex/speex.h b/apps/codecs/libspeex/speex/speex.h index 0ae1abad34..0ff4be135f 100644 --- a/apps/codecs/libspeex/speex/speex.h +++ b/apps/codecs/libspeex/speex/speex.h | |||
@@ -155,6 +155,10 @@ extern "C" { | |||
155 | /** Get status of input/output high-pass filtering */ | 155 | /** Get status of input/output high-pass filtering */ |
156 | #define SPEEX_GET_HIGHPASS 45 | 156 | #define SPEEX_GET_HIGHPASS 45 |
157 | 157 | ||
158 | /** Get "activity level" of the last decoded frame, i.e. | ||
159 | now much damage we cause if we remove the frame */ | ||
160 | #define SPEEX_GET_ACTIVITY 47 | ||
161 | |||
158 | 162 | ||
159 | /* Preserving compatibility:*/ | 163 | /* Preserving compatibility:*/ |
160 | /** Equivalent to SPEEX_SET_ENH */ | 164 | /** Equivalent to SPEEX_SET_ENH */ |
@@ -297,7 +301,7 @@ typedef struct SpeexMode { | |||
297 | * encode, you need one state per channel. | 301 | * encode, you need one state per channel. |
298 | * | 302 | * |
299 | * @param mode The mode to use (either speex_nb_mode or speex_wb.mode) | 303 | * @param mode The mode to use (either speex_nb_mode or speex_wb.mode) |
300 | * @return A newly created encoder | 304 | * @return A newly created encoder state or NULL if state allocation fails |
301 | */ | 305 | */ |
302 | void *speex_encoder_init(const SpeexMode *mode); | 306 | void *speex_encoder_init(const SpeexMode *mode); |
303 | 307 | ||
@@ -330,7 +334,7 @@ int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits); | |||
330 | * @param state Encoder state | 334 | * @param state Encoder state |
331 | * @param request ioctl-type request (one of the SPEEX_* macros) | 335 | * @param request ioctl-type request (one of the SPEEX_* macros) |
332 | * @param ptr Data exchanged to-from function | 336 | * @param ptr Data exchanged to-from function |
333 | * @return 0 if no error, -1 if request in unknown | 337 | * @return 0 if no error, -1 if request in unknown, -2 for invalid parameter |
334 | */ | 338 | */ |
335 | int speex_encoder_ctl(void *state, int request, void *ptr); | 339 | int speex_encoder_ctl(void *state, int request, void *ptr); |
336 | 340 | ||
@@ -341,7 +345,7 @@ int speex_encoder_ctl(void *state, int request, void *ptr); | |||
341 | * decode, you need one state per channel. | 345 | * decode, you need one state per channel. |
342 | * | 346 | * |
343 | * @param mode Speex mode (one of speex_nb_mode or speex_wb_mode) | 347 | * @param mode Speex mode (one of speex_nb_mode or speex_wb_mode) |
344 | * @return A newly created decoder state | 348 | * @return A newly created decoder state or NULL if state allocation fails |
345 | */ | 349 | */ |
346 | void *speex_decoder_init(const SpeexMode *mode); | 350 | void *speex_decoder_init(const SpeexMode *mode); |
347 | 351 | ||
@@ -376,7 +380,7 @@ int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out); | |||
376 | * @param state Decoder state | 380 | * @param state Decoder state |
377 | * @param request ioctl-type request (one of the SPEEX_* macros) | 381 | * @param request ioctl-type request (one of the SPEEX_* macros) |
378 | * @param ptr Data exchanged to-from function | 382 | * @param ptr Data exchanged to-from function |
379 | * @return 0 if no error, -1 if request in unknown | 383 | * @return 0 if no error, -1 if request in unknown, -2 for invalid parameter |
380 | */ | 384 | */ |
381 | int speex_decoder_ctl(void *state, int request, void *ptr); | 385 | int speex_decoder_ctl(void *state, int request, void *ptr); |
382 | 386 | ||
@@ -386,12 +390,14 @@ int speex_decoder_ctl(void *state, int request, void *ptr); | |||
386 | * @param mode Speex mode | 390 | * @param mode Speex mode |
387 | * @param request ioctl-type request (one of the SPEEX_* macros) | 391 | * @param request ioctl-type request (one of the SPEEX_* macros) |
388 | * @param ptr Data exchanged to-from function | 392 | * @param ptr Data exchanged to-from function |
393 | * @return 0 if no error, -1 if request in unknown, -2 for invalid parameter | ||
389 | */ | 394 | */ |
390 | int speex_mode_query(const SpeexMode *mode, int request, void *ptr); | 395 | int speex_mode_query(const SpeexMode *mode, int request, void *ptr); |
391 | 396 | ||
392 | /** Functions for controlling the behavior of libspeex | 397 | /** Functions for controlling the behavior of libspeex |
393 | * @param request ioctl-type request (one of the SPEEX_LIB_* macros) | 398 | * @param request ioctl-type request (one of the SPEEX_LIB_* macros) |
394 | * @param ptr Data exchanged to-from function | 399 | * @param ptr Data exchanged to-from function |
400 | * @return 0 if no error, -1 if request in unknown, -2 for invalid parameter | ||
395 | */ | 401 | */ |
396 | int speex_lib_ctl(int request, void *ptr); | 402 | int speex_lib_ctl(int request, void *ptr); |
397 | 403 | ||
diff --git a/apps/codecs/libspeex/speex/speex_bits.h b/apps/codecs/libspeex/speex/speex_bits.h index 88334c4214..a26fb4ce0c 100644 --- a/apps/codecs/libspeex/speex/speex_bits.h +++ b/apps/codecs/libspeex/speex/speex_bits.h | |||
@@ -64,6 +64,9 @@ void speex_bits_init(SpeexBits *bits); | |||
64 | /** Initializes SpeexBits struct using a pre-allocated buffer*/ | 64 | /** Initializes SpeexBits struct using a pre-allocated buffer*/ |
65 | void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size); | 65 | void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size); |
66 | 66 | ||
67 | /** Sets the bits in a SpeexBits struct to use data from an existing buffer (for decoding without copying data) */ | ||
68 | void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size); | ||
69 | |||
67 | /** Frees all resources associated to a SpeexBits struct. Right now this does nothing since no resources are allocated, but this could change in the future.*/ | 70 | /** Frees all resources associated to a SpeexBits struct. Right now this does nothing since no resources are allocated, but this could change in the future.*/ |
68 | void speex_bits_destroy(SpeexBits *bits); | 71 | void speex_bits_destroy(SpeexBits *bits); |
69 | 72 | ||
diff --git a/apps/codecs/libspeex/speex/speex_jitter.h b/apps/codecs/libspeex/speex/speex_jitter.h index a5314d6e0a..570e22b1e2 100644 --- a/apps/codecs/libspeex/speex/speex_jitter.h +++ b/apps/codecs/libspeex/speex/speex_jitter.h | |||
@@ -121,7 +121,7 @@ void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *packet); | |||
121 | * @param packet Returned packet | 121 | * @param packet Returned packet |
122 | * @param current_timestamp Timestamp for the returned packet | 122 | * @param current_timestamp Timestamp for the returned packet |
123 | */ | 123 | */ |
124 | int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_uint32_t *current_timestamp); | 124 | int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t *start_offset); |
125 | 125 | ||
126 | /** Get pointer timestamp of jitter buffer | 126 | /** Get pointer timestamp of jitter buffer |
127 | * | 127 | * |
@@ -144,7 +144,7 @@ void jitter_buffer_tick(JitterBuffer *jitter); | |||
144 | */ | 144 | */ |
145 | int jitter_buffer_ctl(JitterBuffer *jitter, int request, void *ptr); | 145 | int jitter_buffer_ctl(JitterBuffer *jitter, int request, void *ptr); |
146 | 146 | ||
147 | int jitter_buffer_update_delay(JitterBuffer *jitter, JitterBufferPacket *packet, spx_uint32_t *start_offset); | 147 | int jitter_buffer_update_delay(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t *start_offset); |
148 | 148 | ||
149 | /* @} */ | 149 | /* @} */ |
150 | 150 | ||
diff --git a/apps/codecs/libspeex/speex/speex_resampler.h b/apps/codecs/libspeex/speex/speex_resampler.h index 93642ced2f..c44fbcd0d1 100644 --- a/apps/codecs/libspeex/speex/speex_resampler.h +++ b/apps/codecs/libspeex/speex/speex_resampler.h | |||
@@ -69,29 +69,20 @@ | |||
69 | #define speex_resampler_get_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_get_quality) | 69 | #define speex_resampler_get_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_get_quality) |
70 | #define speex_resampler_set_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_set_input_stride) | 70 | #define speex_resampler_set_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_set_input_stride) |
71 | #define speex_resampler_get_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_input_stride) | 71 | #define speex_resampler_get_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_input_stride) |
72 | #define speex_resample_set_output_stride CAT_PREFIX(RANDOM_PREFIX,_resample_set_output_stride) | 72 | #define speex_resampler_set_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_set_output_stride) |
73 | #define speex_resample_get_output_stride CAT_PREFIX(RANDOM_PREFIX,_resample_get_output_stride) | 73 | #define speex_resampler_get_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_output_stride) |
74 | #define speex_resampler_skip_zeros CAT_PREFIX(RANDOM_PREFIX,_resampler_skip_zeros) | 74 | #define speex_resampler_skip_zeros CAT_PREFIX(RANDOM_PREFIX,_resampler_skip_zeros) |
75 | #define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset_mem) | 75 | #define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset_mem) |
76 | #define speex_resampler_strerror CAT_PREFIX(RANDOM_PREFIX,_resampler_strerror) | ||
76 | 77 | ||
77 | #define spx_int16_t short | 78 | #define spx_int16_t short |
78 | 79 | #define spx_int32_t int | |
79 | #ifdef FIXED_POINT | 80 | #define spx_uint16_t unsigned short |
80 | #define spx_word16_t short | 81 | #define spx_uint32_t unsigned int |
81 | #define spx_word32_t int | 82 | |
82 | |||
83 | #else /* FIXED_POINT */ | ||
84 | |||
85 | #define spx_word16_t float | ||
86 | #define spx_word32_t float | ||
87 | #define MULT16_16(a,b) ((a)*(b)) | ||
88 | #define MULT16_32_Q15(a,b) ((a)*(b)) | ||
89 | #define PSHR32(a,b) (a) | ||
90 | #endif /* FIXED_POINT */ | ||
91 | |||
92 | #else /* OUTSIDE_SPEEX */ | 83 | #else /* OUTSIDE_SPEEX */ |
93 | 84 | ||
94 | #include "speex_types.h" | 85 | #include "speex/speex_types.h" |
95 | 86 | ||
96 | #endif /* OUTSIDE_SPEEX */ | 87 | #endif /* OUTSIDE_SPEEX */ |
97 | 88 | ||
@@ -104,7 +95,17 @@ extern "C" { | |||
104 | #define SPEEX_RESAMPLER_QUALITY_DEFAULT 4 | 95 | #define SPEEX_RESAMPLER_QUALITY_DEFAULT 4 |
105 | #define SPEEX_RESAMPLER_QUALITY_VOIP 3 | 96 | #define SPEEX_RESAMPLER_QUALITY_VOIP 3 |
106 | #define SPEEX_RESAMPLER_QUALITY_DESKTOP 5 | 97 | #define SPEEX_RESAMPLER_QUALITY_DESKTOP 5 |
98 | |||
99 | enum { | ||
100 | RESAMPLER_ERR_SUCCESS = 0, | ||
101 | RESAMPLER_ERR_ALLOC_FAILED = 1, | ||
102 | RESAMPLER_ERR_BAD_STATE = 2, | ||
103 | RESAMPLER_ERR_INVALID_ARG = 3, | ||
104 | RESAMPLER_ERR_PTR_OVERLAP = 4, | ||
107 | 105 | ||
106 | RESAMPLER_ERR_MAX_ERROR | ||
107 | }; | ||
108 | |||
108 | struct SpeexResamplerState_; | 109 | struct SpeexResamplerState_; |
109 | typedef struct SpeexResamplerState_ SpeexResamplerState; | 110 | typedef struct SpeexResamplerState_ SpeexResamplerState; |
110 | 111 | ||
@@ -117,10 +118,11 @@ typedef struct SpeexResamplerState_ SpeexResamplerState; | |||
117 | * @return Newly created resampler state | 118 | * @return Newly created resampler state |
118 | * @retval NULL Error: not enough memory | 119 | * @retval NULL Error: not enough memory |
119 | */ | 120 | */ |
120 | SpeexResamplerState *speex_resampler_init(int nb_channels, | 121 | SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, |
121 | int in_rate, | 122 | spx_uint32_t in_rate, |
122 | int out_rate, | 123 | spx_uint32_t out_rate, |
123 | int quality); | 124 | int quality, |
125 | int *err); | ||
124 | 126 | ||
125 | /** Create a new resampler with fractional input/output rates. The sampling | 127 | /** Create a new resampler with fractional input/output rates. The sampling |
126 | * rate ratio is an arbitrary rational number with both the numerator and | 128 | * rate ratio is an arbitrary rational number with both the numerator and |
@@ -135,12 +137,13 @@ SpeexResamplerState *speex_resampler_init(int nb_channels, | |||
135 | * @return Newly created resampler state | 137 | * @return Newly created resampler state |
136 | * @retval NULL Error: not enough memory | 138 | * @retval NULL Error: not enough memory |
137 | */ | 139 | */ |
138 | SpeexResamplerState *speex_resampler_init_frac(int nb_channels, | 140 | SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, |
139 | int ratio_num, | 141 | spx_uint32_t ratio_num, |
140 | int ratio_den, | 142 | spx_uint32_t ratio_den, |
141 | int in_rate, | 143 | spx_uint32_t in_rate, |
142 | int out_rate, | 144 | spx_uint32_t out_rate, |
143 | int quality); | 145 | int quality, |
146 | int *err); | ||
144 | 147 | ||
145 | /** Destroy a resampler state. | 148 | /** Destroy a resampler state. |
146 | * @param st Resampler state | 149 | * @param st Resampler state |
@@ -157,12 +160,12 @@ void speex_resampler_destroy(SpeexResamplerState *st); | |||
157 | * @param out Output buffer | 160 | * @param out Output buffer |
158 | * @param out_len Size of the output buffer. Returns the number of samples written | 161 | * @param out_len Size of the output buffer. Returns the number of samples written |
159 | */ | 162 | */ |
160 | void speex_resampler_process_float(SpeexResamplerState *st, | 163 | int speex_resampler_process_float(SpeexResamplerState *st, |
161 | int channel_index, | 164 | spx_uint32_t channel_index, |
162 | const float *in, | 165 | const float *in, |
163 | int *in_len, | 166 | spx_uint32_t *in_len, |
164 | float *out, | 167 | float *out, |
165 | int *out_len); | 168 | spx_uint32_t *out_len); |
166 | 169 | ||
167 | /** Resample an int array. The input and output buffers must *not* overlap. | 170 | /** Resample an int array. The input and output buffers must *not* overlap. |
168 | * @param st Resampler state | 171 | * @param st Resampler state |
@@ -174,12 +177,12 @@ void speex_resampler_process_float(SpeexResamplerState *st, | |||
174 | * @param out Output buffer | 177 | * @param out Output buffer |
175 | * @param out_len Size of the output buffer. Returns the number of samples written | 178 | * @param out_len Size of the output buffer. Returns the number of samples written |
176 | */ | 179 | */ |
177 | void speex_resampler_process_int(SpeexResamplerState *st, | 180 | int speex_resampler_process_int(SpeexResamplerState *st, |
178 | int channel_index, | 181 | spx_uint32_t channel_index, |
179 | const spx_int16_t *in, | 182 | const spx_int16_t *in, |
180 | int *in_len, | 183 | spx_uint32_t *in_len, |
181 | spx_int16_t *out, | 184 | spx_int16_t *out, |
182 | int *out_len); | 185 | spx_uint32_t *out_len); |
183 | 186 | ||
184 | /** Resample an interleaved float array. The input and output buffers must *not* overlap. | 187 | /** Resample an interleaved float array. The input and output buffers must *not* overlap. |
185 | * @param st Resampler state | 188 | * @param st Resampler state |
@@ -190,11 +193,11 @@ void speex_resampler_process_int(SpeexResamplerState *st, | |||
190 | * @param out_len Size of the output buffer. Returns the number of samples written. | 193 | * @param out_len Size of the output buffer. Returns the number of samples written. |
191 | * This is all per-channel. | 194 | * This is all per-channel. |
192 | */ | 195 | */ |
193 | void speex_resampler_process_interleaved_float(SpeexResamplerState *st, | 196 | int speex_resampler_process_interleaved_float(SpeexResamplerState *st, |
194 | const float *in, | 197 | const float *in, |
195 | int *in_len, | 198 | spx_uint32_t *in_len, |
196 | float *out, | 199 | float *out, |
197 | int *out_len); | 200 | spx_uint32_t *out_len); |
198 | 201 | ||
199 | /** Resample an interleaved int array. The input and output buffers must *not* overlap. | 202 | /** Resample an interleaved int array. The input and output buffers must *not* overlap. |
200 | * @param st Resampler state | 203 | * @param st Resampler state |
@@ -205,20 +208,20 @@ void speex_resampler_process_interleaved_float(SpeexResamplerState *st, | |||
205 | * @param out_len Size of the output buffer. Returns the number of samples written. | 208 | * @param out_len Size of the output buffer. Returns the number of samples written. |
206 | * This is all per-channel. | 209 | * This is all per-channel. |
207 | */ | 210 | */ |
208 | void speex_resampler_process_interleaved_int(SpeexResamplerState *st, | 211 | int speex_resampler_process_interleaved_int(SpeexResamplerState *st, |
209 | const spx_int16_t *in, | 212 | const spx_int16_t *in, |
210 | int *in_len, | 213 | spx_uint32_t *in_len, |
211 | spx_int16_t *out, | 214 | spx_int16_t *out, |
212 | int *out_len); | 215 | spx_uint32_t *out_len); |
213 | 216 | ||
214 | /** Set (change) the input/output sampling rates (integer value). | 217 | /** Set (change) the input/output sampling rates (integer value). |
215 | * @param st Resampler state | 218 | * @param st Resampler state |
216 | * @param in_rate Input sampling rate (integer number of Hz). | 219 | * @param in_rate Input sampling rate (integer number of Hz). |
217 | * @param out_rate Output sampling rate (integer number of Hz). | 220 | * @param out_rate Output sampling rate (integer number of Hz). |
218 | */ | 221 | */ |
219 | void speex_resampler_set_rate(SpeexResamplerState *st, | 222 | int speex_resampler_set_rate(SpeexResamplerState *st, |
220 | int in_rate, | 223 | spx_uint32_t in_rate, |
221 | int out_rate); | 224 | spx_uint32_t out_rate); |
222 | 225 | ||
223 | /** Get the current input/output sampling rates (integer value). | 226 | /** Get the current input/output sampling rates (integer value). |
224 | * @param st Resampler state | 227 | * @param st Resampler state |
@@ -226,8 +229,8 @@ void speex_resampler_set_rate(SpeexResamplerState *st, | |||
226 | * @param out_rate Output sampling rate (integer number of Hz) copied. | 229 | * @param out_rate Output sampling rate (integer number of Hz) copied. |
227 | */ | 230 | */ |
228 | void speex_resampler_get_rate(SpeexResamplerState *st, | 231 | void speex_resampler_get_rate(SpeexResamplerState *st, |
229 | int *in_rate, | 232 | spx_uint32_t *in_rate, |
230 | int *out_rate); | 233 | spx_uint32_t *out_rate); |
231 | 234 | ||
232 | /** Set (change) the input/output sampling rates and resampling ratio | 235 | /** Set (change) the input/output sampling rates and resampling ratio |
233 | * (fractional values in Hz supported). | 236 | * (fractional values in Hz supported). |
@@ -237,11 +240,11 @@ void speex_resampler_get_rate(SpeexResamplerState *st, | |||
237 | * @param in_rate Input sampling rate rounded to the nearest integer (in Hz). | 240 | * @param in_rate Input sampling rate rounded to the nearest integer (in Hz). |
238 | * @param out_rate Output sampling rate rounded to the nearest integer (in Hz). | 241 | * @param out_rate Output sampling rate rounded to the nearest integer (in Hz). |
239 | */ | 242 | */ |
240 | void speex_resampler_set_rate_frac(SpeexResamplerState *st, | 243 | int speex_resampler_set_rate_frac(SpeexResamplerState *st, |
241 | int ratio_num, | 244 | spx_uint32_t ratio_num, |
242 | int ratio_den, | 245 | spx_uint32_t ratio_den, |
243 | int in_rate, | 246 | spx_uint32_t in_rate, |
244 | int out_rate); | 247 | spx_uint32_t out_rate); |
245 | 248 | ||
246 | /** Get the current resampling ratio. This will be reduced to the least | 249 | /** Get the current resampling ratio. This will be reduced to the least |
247 | * common denominator. | 250 | * common denominator. |
@@ -250,15 +253,15 @@ void speex_resampler_set_rate_frac(SpeexResamplerState *st, | |||
250 | * @param ratio_den Denominator of the sampling rate ratio copied | 253 | * @param ratio_den Denominator of the sampling rate ratio copied |
251 | */ | 254 | */ |
252 | void speex_resampler_get_ratio(SpeexResamplerState *st, | 255 | void speex_resampler_get_ratio(SpeexResamplerState *st, |
253 | int *ratio_num, | 256 | spx_uint32_t *ratio_num, |
254 | int *ratio_den); | 257 | spx_uint32_t *ratio_den); |
255 | 258 | ||
256 | /** Set (change) the conversion quality. | 259 | /** Set (change) the conversion quality. |
257 | * @param st Resampler state | 260 | * @param st Resampler state |
258 | * @param quality Resampling quality between 0 and 10, where 0 has poor | 261 | * @param quality Resampling quality between 0 and 10, where 0 has poor |
259 | * quality and 10 has very high quality. | 262 | * quality and 10 has very high quality. |
260 | */ | 263 | */ |
261 | void speex_resampler_set_quality(SpeexResamplerState *st, | 264 | int speex_resampler_set_quality(SpeexResamplerState *st, |
262 | int quality); | 265 | int quality); |
263 | 266 | ||
264 | /** Get the conversion quality. | 267 | /** Get the conversion quality. |
@@ -274,28 +277,28 @@ void speex_resampler_get_quality(SpeexResamplerState *st, | |||
274 | * @param stride Input stride | 277 | * @param stride Input stride |
275 | */ | 278 | */ |
276 | void speex_resampler_set_input_stride(SpeexResamplerState *st, | 279 | void speex_resampler_set_input_stride(SpeexResamplerState *st, |
277 | int stride); | 280 | spx_uint32_t stride); |
278 | 281 | ||
279 | /** Get the input stride. | 282 | /** Get the input stride. |
280 | * @param st Resampler state | 283 | * @param st Resampler state |
281 | * @param stride Input stride copied | 284 | * @param stride Input stride copied |
282 | */ | 285 | */ |
283 | void speex_resampler_get_input_stride(SpeexResamplerState *st, | 286 | void speex_resampler_get_input_stride(SpeexResamplerState *st, |
284 | int *stride); | 287 | spx_uint32_t *stride); |
285 | 288 | ||
286 | /** Set (change) the output stride. | 289 | /** Set (change) the output stride. |
287 | * @param st Resampler state | 290 | * @param st Resampler state |
288 | * @param stride Output stride | 291 | * @param stride Output stride |
289 | */ | 292 | */ |
290 | void speex_resample_set_output_stride(SpeexResamplerState *st, | 293 | void speex_resampler_set_output_stride(SpeexResamplerState *st, |
291 | int stride); | 294 | spx_uint32_t stride); |
292 | 295 | ||
293 | /** Get the output stride. | 296 | /** Get the output stride. |
294 | * @param st Resampler state copied | 297 | * @param st Resampler state copied |
295 | * @param stride Output stride | 298 | * @param stride Output stride |
296 | */ | 299 | */ |
297 | void speex_resample_get_output_stride(SpeexResamplerState *st, | 300 | void speex_resampler_get_output_stride(SpeexResamplerState *st, |
298 | int *stride); | 301 | spx_uint32_t *stride); |
299 | 302 | ||
300 | /** Make sure that the first samples to go out of the resamplers don't have | 303 | /** Make sure that the first samples to go out of the resamplers don't have |
301 | * leading zeros. This is only useful before starting to use a newly created | 304 | * leading zeros. This is only useful before starting to use a newly created |
@@ -305,12 +308,18 @@ void speex_resample_get_output_stride(SpeexResamplerState *st, | |||
305 | * is the same for the first frame). | 308 | * is the same for the first frame). |
306 | * @param st Resampler state | 309 | * @param st Resampler state |
307 | */ | 310 | */ |
308 | void speex_resampler_skip_zeros(SpeexResamplerState *st); | 311 | int speex_resampler_skip_zeros(SpeexResamplerState *st); |
309 | 312 | ||
310 | /** Reset a resampler so a new (unrelated) stream can be processed. | 313 | /** Reset a resampler so a new (unrelated) stream can be processed. |
311 | * @param st Resampler state | 314 | * @param st Resampler state |
312 | */ | 315 | */ |
313 | void speex_resampler_reset_mem(SpeexResamplerState *st); | 316 | int speex_resampler_reset_mem(SpeexResamplerState *st); |
317 | |||
318 | /** Returns the English meaning for an error code | ||
319 | * @param err Error code | ||
320 | * @return English string | ||
321 | */ | ||
322 | const char *speex_resampler_strerror(int err); | ||
314 | 323 | ||
315 | #ifdef __cplusplus | 324 | #ifdef __cplusplus |
316 | } | 325 | } |