~ubuntu-branches/ubuntu/dapper/speex/dapper-security

« back to all changes in this revision

Viewing changes to include/speex/speex.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2005-12-07 23:22:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051207232221-nme7vf9m182p7dpe
Tags: 1.1.11.1-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#ifndef SPEEX_H
37
37
#define SPEEX_H
38
38
 
39
 
#include "speex_bits.h"
 
39
#include "speex/speex_bits.h"
 
40
#include "speex/speex_types.h"
40
41
 
41
42
#ifdef __cplusplus
42
43
extern "C" {
56
57
/** Set quality value */
57
58
#define SPEEX_SET_QUALITY 4
58
59
/** Get current quality setting */
59
 
#define SPEEX_GET_QUALITY 5
 
60
/* #define SPEEX_GET_QUALITY 5 -- Doesn't make much sense, does it? */
60
61
 
61
62
/** Set sub-mode to use */
62
63
#define SPEEX_SET_MODE 6
93
94
/** Get current bit-rate used by the encoder or decoder */
94
95
#define SPEEX_GET_BITRATE 19
95
96
 
96
 
/**Define a handler function for in-band Speex request*/
 
97
/** Define a handler function for in-band Speex request*/
97
98
#define SPEEX_SET_HANDLER 20
98
99
 
99
 
/**Define a handler function for in-band user-defined request*/
 
100
/** Define a handler function for in-band user-defined request*/
100
101
#define SPEEX_SET_USER_HANDLER 22
101
102
 
102
103
/** Set sampling rate used in bit-rate computation */
128
129
 
129
130
/** Set submode encoding in each frame (1 for yes, 0 for no, setting to no breaks the standard) */
130
131
#define SPEEX_SET_SUBMODE_ENCODING 36
131
 
/** */
 
132
/** Get submode encoding in each frame */
132
133
#define SPEEX_GET_SUBMODE_ENCODING 37
133
134
 
134
 
/*#define SPEEX_SET_SUBMODE_ENCODING 38*/
135
 
/** */
 
135
/*#define SPEEX_SET_LOOKAHEAD 38*/
 
136
/** Returns the lookahead used by Speex */
136
137
#define SPEEX_GET_LOOKAHEAD 39
137
138
 
 
139
/** Sets tuning for packet-loss concealment (expected loss rate) */
 
140
#define SPEEX_SET_PLC_TUNING 40
 
141
/** Gets tuning for PLC */
 
142
#define SPEEX_GET_PLC_TUNING 41
138
143
 
139
144
/* Used internally, not to be used in applications */
140
145
/** Used internally*/
165
170
 
166
171
 
167
172
 
 
173
/** Get major Speex version */
168
174
#define SPEEX_LIB_GET_MAJOR_VERSION 1
 
175
/** Get minor Speex version */
169
176
#define SPEEX_LIB_GET_MINOR_VERSION 3
 
177
/** Get micro Speex version */
170
178
#define SPEEX_LIB_GET_MICRO_VERSION 5
 
179
/** Get extra Speex version */
171
180
#define SPEEX_LIB_GET_EXTRA_VERSION 7
 
181
/** Get Speex version string */
172
182
#define SPEEX_LIB_GET_VERSION_STRING 9
173
183
 
174
184
/*#define SPEEX_LIB_SET_ALLOC_FUNC 10
194
204
/** modeID for the defined ultra-wideband mode */
195
205
#define SPEEX_MODEID_UWB 2
196
206
 
 
207
#ifdef EPIC_48K
 
208
/** modeID for the Epic 48K mode */
 
209
#define SPEEX_MODEID_NB_48K 1000
 
210
#endif
 
211
 
197
212
struct SpeexMode;
198
213
 
199
214
 
236
251
   mode_query_func query;
237
252
   
238
253
   /** The name of the mode (you should not rely on this to identify the mode)*/
239
 
   char *modeName;
 
254
   const char *modeName;
240
255
 
241
256
   /**ID of the mode*/
242
257
   int modeID;
289
304
/** Uses an existing encoder state to encode one frame of speech pointed to by
290
305
    "in". The encoded bit-stream is saved in "bits".
291
306
 @param state Encoder state
292
 
 @param in Frame that will be encoded with a +-2^16 range
 
307
 @param in Frame that will be encoded with a +-2^15 range
293
308
 @param bits Bit-stream where the data will be written
 
309
 @return 0 if frame needs not be transmitted (DTX only), 1 otherwise
294
310
 */
295
311
int speex_encode(void *state, float *in, SpeexBits *bits);
296
312
 
297
313
/** Uses an existing encoder state to encode one frame of speech pointed to by
298
314
    "in". The encoded bit-stream is saved in "bits".
299
315
 @param state Encoder state
300
 
 @param in Frame that will be encoded with a +-2^16 range
 
316
 @param in Frame that will be encoded with a +-2^15 range
301
317
 @param bits Bit-stream where the data will be written
 
318
 @return 0 if frame needs not be transmitted (DTX only), 1 otherwise
302
319
 */
303
 
int speex_encode_int(void *state, short *in, SpeexBits *bits);
 
320
int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits);
304
321
 
305
322
/** Used like the ioctl function to control the encoder parameters
306
323
 *
307
324
 * @param state Encoder state
308
325
 * @param request ioctl-type request (one of the SPEEX_* macros)
309
326
 * @param ptr Data exchanged to-from function
310
 
 * @return 0 if frame needs not be transmitted (DTX only), 1 otherwise
 
327
 * @return 0 if no error, -1 if request in unknown
311
328
 */
312
329
int speex_encoder_ctl(void *state, int request, void *ptr);
313
330
 
334
351
 * @param state Decoder state
335
352
 * @param bits Bit-stream from which to decode the frame (NULL if the packet was lost)
336
353
 * @param out Where to write the decoded frame
337
 
 * @return return status (0 for no error, -1 for end of stream, -2 other)
 
354
 * @return return status (0 for no error, -1 for end of stream, -2 corrupt stream)
338
355
 */
339
356
int speex_decode(void *state, SpeexBits *bits, float *out);
340
357
 
344
361
 * @param state Decoder state
345
362
 * @param bits Bit-stream from which to decode the frame (NULL if the packet was lost)
346
363
 * @param out Where to write the decoded frame
347
 
 * @return return status (0 for no error, -1 for end of stream, -2 other)
 
364
 * @return return status (0 for no error, -1 for end of stream, -2 corrupt stream)
348
365
 */
349
 
int speex_decode_int(void *state, SpeexBits *bits, short *out);
 
366
int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out);
350
367
 
351
368
/** Used like the ioctl function to control the encoder parameters
352
369
 *
353
370
 * @param state Decoder state
354
371
 * @param request ioctl-type request (one of the SPEEX_* macros)
355
372
 * @param ptr Data exchanged to-from function
356
 
 * @return 0 for no error, 1 if a terminator is reached, 2 for another error
 
373
 * @return 0 if no error, -1 if request in unknown
357
374
 */
358
375
int speex_decoder_ctl(void *state, int request, void *ptr);
359
376
 
387
404
#endif
388
405
 
389
406
/** List of all modes available */
390
 
extern const SpeexMode *speex_mode_list[SPEEX_NB_MODES];
 
407
extern const SpeexMode * const speex_mode_list[SPEEX_NB_MODES];
 
408
 
 
409
/** Obtain one of the modes available */
 
410
const SpeexMode * speex_lib_get_mode (int mode);
391
411
 
392
412
#ifdef __cplusplus
393
413
}