speex.h | speex.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
#ifndef SPEEX_MODES_H | #ifndef SPEEX_MODES_H | |||
#define SPEEX_MODES_H | #define SPEEX_MODES_H | |||
#include "speex_bits.h" | #include "speex_bits.h" | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
#define SPEEX_SET_PF 0 | ||||
#define SPEEX_GET_PF 1 | ||||
#define SPEEX_GET_FRAME_SIZE 3 | ||||
struct SpeexMode; | struct SpeexMode; | |||
typedef void *(*encoder_init_func)(struct SpeexMode *mode); | typedef void *(*encoder_init_func)(struct SpeexMode *mode); | |||
typedef void (*encoder_destroy_func)(void *st); | typedef void (*encoder_destroy_func)(void *st); | |||
typedef void (*encode_func)(void *state, float *in, SpeexBits *bits); | typedef void (*encode_func)(void *state, float *in, SpeexBits *bits); | |||
typedef void *(*decoder_init_func)(struct SpeexMode *mode); | typedef void *(*decoder_init_func)(struct SpeexMode *mode); | |||
typedef void (*decoder_destroy_func)(void *st); | typedef void (*decoder_destroy_func)(void *st); | |||
typedef void (*decode_func)(void *state, SpeexBits *bits, float *out, int l ost); | typedef void (*decode_func)(void *state, SpeexBits *bits, float *out, int l ost); | |||
typedef void (*encoder_ctl_func)(void *state, int request, void *ptr); | ||||
typedef void (*decoder_ctl_func)(void *state, int request, void *ptr); | ||||
/** Struct defining a Speex mode */ | /** Struct defining a Speex mode */ | |||
typedef struct SpeexMode { | typedef struct SpeexMode { | |||
/** Pointer to the low-level mode data */ | /** Pointer to the low-level mode data */ | |||
void *mode; | void *mode; | |||
/** Pointer to encoder initialization function */ | /** Pointer to encoder initialization function */ | |||
encoder_init_func enc_init; | encoder_init_func enc_init; | |||
/** Pointer to encoder destruction function */ | /** Pointer to encoder destruction function */ | |||
skipping to change at line 63 | skipping to change at line 69 | |||
/** Pointer to decoder initialization function */ | /** Pointer to decoder initialization function */ | |||
decoder_init_func dec_init; | decoder_init_func dec_init; | |||
/** Pointer to decoder destruction function */ | /** Pointer to decoder destruction function */ | |||
decoder_destroy_func dec_destroy; | decoder_destroy_func dec_destroy; | |||
/** Pointer to frame decoding function */ | /** Pointer to frame decoding function */ | |||
decode_func dec; | decode_func dec; | |||
/** Frame size used for the current mode */ | /** ioctl-like requests for encoder */ | |||
int frameSize; | encoder_ctl_func enc_ctl; | |||
/** ioctl-like requests for decoder */ | ||||
decoder_ctl_func dec_ctl; | ||||
} SpeexMode; | } SpeexMode; | |||
/**Returns a handle to a newly created Speex encoder state structure. For n ow, the | /**Returns a handle to a newly created Speex encoder state structure. For n ow, the | |||
"mode" arguent can be &nb_mode or &wb_mode . In the future, more modes m ay be | "mode" arguent can be &nb_mode or &wb_mode . In the future, more modes m ay be | |||
added. Note that for now if you have more than one channels to encode, y ou need | added. Note that for now if you have more than one channels to encode, y ou need | |||
one state per channel.*/ | one state per channel.*/ | |||
void *speex_encoder_init(SpeexMode *mode); | void *speex_encoder_init(SpeexMode *mode); | |||
/** Frees all resources associated to an existing Speex encoder state. */ | /** Frees all resources associated to an existing Speex encoder state. */ | |||
void speex_encoder_destroy(void *state); | void speex_encoder_destroy(void *state); | |||
/** Uses an existing encoder state to encode one frame of speech pointed to by | /** Uses an existing encoder state to encode one frame of speech pointed to by | |||
"in". The encoded bit-stream is saved in "bits".*/ | "in". The encoded bit-stream is saved in "bits".*/ | |||
void speex_encode(void *state, float *in, SpeexBits *bits); | void speex_encode(void *state, float *in, SpeexBits *bits); | |||
void speex_encoder_ctl(void *state, int request, void *ptr); | ||||
/** Returns a handle to a newly created decoder state structure. For now, t he mode | /** Returns a handle to a newly created decoder state structure. For now, t he mode | |||
arguent can be &nb_mode or &wb_mode . In the future, more modes may be added. | arguent can be &nb_mode or &wb_mode . In the future, more modes may be added. | |||
Note that for now if you have more than one channels to decode, you nee d one | Note that for now if you have more than one channels to decode, you nee d one | |||
state per channel. */ | state per channel. */ | |||
void *speex_decoder_init(SpeexMode *mode); | void *speex_decoder_init(SpeexMode *mode); | |||
/** Frees all resources associated to an existing decoder state. */ | /** Frees all resources associated to an existing decoder state. */ | |||
void speex_decoder_destroy(void *state); | void speex_decoder_destroy(void *state); | |||
/** Uses an existing decoder state to decode one frame of speech from bit-s tream | /** Uses an existing decoder state to decode one frame of speech from bit-s tream | |||
bits. The output speech is saved written to out. */ | bits. The output speech is saved written to out. */ | |||
void speex_decode(void *state, SpeexBits *bits, float *out, int lost); | void speex_decode(void *state, SpeexBits *bits, float *out, int lost); | |||
void speex_decoder_ctl(void *state, int request, void *ptr); | ||||
/** Default narrowband mode */ | /** Default narrowband mode */ | |||
extern SpeexMode speex_nb_mode; | extern SpeexMode speex_nb_mode; | |||
/** Default wideband mode */ | /** Default wideband mode */ | |||
extern SpeexMode speex_wb_mode; | extern SpeexMode speex_wb_mode; | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
End of changes. 5 change blocks. | ||||
2 lines changed or deleted | 15 lines changed or added | |||