speex.h | speex.h | |||
---|---|---|---|---|
skipping to change at line 165 | skipping to change at line 165 | |||
#define SPEEX_SUBMODE_BITS_PER_FRAME 1 | #define SPEEX_SUBMODE_BITS_PER_FRAME 1 | |||
/** Number of defined modes in Speex */ | /** Number of defined modes in Speex */ | |||
#define SPEEX_NB_MODES 3 | #define SPEEX_NB_MODES 3 | |||
struct SpeexMode; | struct SpeexMode; | |||
/* Prototypes for mode function pointers */ | /* Prototypes for mode function pointers */ | |||
/** Encoder state initialization function */ | /** Encoder state initialization function */ | |||
typedef void *(*encoder_init_func)(struct SpeexMode *mode); | typedef void *(*encoder_init_func)(const struct SpeexMode *mode); | |||
/** Encoder state destruction function */ | /** Encoder state destruction function */ | |||
typedef void (*encoder_destroy_func)(void *st); | typedef void (*encoder_destroy_func)(void *st); | |||
/** Main encoding function */ | /** Main encoding function */ | |||
typedef int (*encode_func)(void *state, short *in, SpeexBits *bits); | typedef int (*encode_func)(void *state, short *in, SpeexBits *bits); | |||
/** Function for controlling the encoder options */ | /** Function for controlling the encoder options */ | |||
typedef int (*encoder_ctl_func)(void *state, int request, void *ptr); | typedef int (*encoder_ctl_func)(void *state, int request, void *ptr); | |||
/** Decoder state initialization function */ | /** Decoder state initialization function */ | |||
typedef void *(*decoder_init_func)(struct SpeexMode *mode); | typedef void *(*decoder_init_func)(const struct SpeexMode *mode); | |||
/** Decoder state destruction function */ | /** Decoder state destruction function */ | |||
typedef void (*decoder_destroy_func)(void *st); | typedef void (*decoder_destroy_func)(void *st); | |||
/** Main decoding function */ | /** Main decoding function */ | |||
typedef int (*decode_func)(void *state, SpeexBits *bits, short *out); | typedef int (*decode_func)(void *state, SpeexBits *bits, short *out); | |||
/** Function for controlling the decoder options */ | /** Function for controlling the decoder options */ | |||
typedef int (*decoder_ctl_func)(void *state, int request, void *ptr); | typedef int (*decoder_ctl_func)(void *state, int request, void *ptr); | |||
/** Query function for a mode */ | /** Query function for a mode */ | |||
typedef int (*mode_query_func)(void *mode, int request, void *ptr); | typedef int (*mode_query_func)(const void *mode, 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; | const void *mode; | |||
/** Pointer to the mode query function */ | /** Pointer to the mode query function */ | |||
mode_query_func query; | mode_query_func query; | |||
/** The name of the mode (you should not rely on this to identify the mo de)*/ | /** The name of the mode (you should not rely on this to identify the mo de)*/ | |||
char *modeName; | char *modeName; | |||
/**ID of the mode*/ | /**ID of the mode*/ | |||
int modeID; | int modeID; | |||
skipping to change at line 244 | skipping to change at line 244 | |||
/** | /** | |||
* Returns a handle to a newly created Speex encoder state structure. For n ow, | * Returns a handle to a newly created Speex encoder state structure. For n ow, | |||
* the "mode" argument can be &nb_mode or &wb_mode . In the future, more mo des | * the "mode" argument can be &nb_mode or &wb_mode . In the future, more mo des | |||
* may be added. Note that for now if you have more than one channels to | * may be added. Note that for now if you have more than one channels to | |||
* encode, you need one state per channel. | * encode, you need one state per channel. | |||
* | * | |||
* @param mode The mode to use (either speex_nb_mode or speex_wb.mode) | * @param mode The mode to use (either speex_nb_mode or speex_wb.mode) | |||
* @return A newly created encoder | * @return A newly created encoder | |||
*/ | */ | |||
void *speex_encoder_init(SpeexMode *mode); | void *speex_encoder_init(const SpeexMode *mode); | |||
/** Frees all resources associated to an existing Speex encoder state. | /** Frees all resources associated to an existing Speex encoder state. | |||
* @param state Encoder state to be destroyed */ | * @param state Encoder state to be destroyed */ | |||
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". | |||
@param state Encoder state | @param state Encoder state | |||
@param in Frame that will be encoded with a +-2^16 range | @param in Frame that will be encoded with a +-2^16 range | |||
@param bits Bit-stream where the data will be written | @param bits Bit-stream where the data will be written | |||
skipping to change at line 275 | skipping to change at line 275 | |||
int speex_encoder_ctl(void *state, int request, void *ptr); | int speex_encoder_ctl(void *state, int request, void *ptr); | |||
/** Returns a handle to a newly created decoder state structure. For now, | /** Returns a handle to a newly created decoder state structure. For now, | |||
* the mode argument can be &nb_mode or &wb_mode . In the future, more mode s | * the mode argument can be &nb_mode or &wb_mode . In the future, more mode s | |||
* may be added. Note that for now if you have more than one channels to | * may be added. Note that for now if you have more than one channels to | |||
* decode, you need one state per channel. | * decode, you need one state per channel. | |||
* | * | |||
* @param mode Speex mode (one of speex_nb_mode or speex_wb_mode) | * @param mode Speex mode (one of speex_nb_mode or speex_wb_mode) | |||
* @return A newly created decoder state | * @return A newly created decoder state | |||
*/ | */ | |||
void *speex_decoder_init(SpeexMode *mode); | void *speex_decoder_init(const SpeexMode *mode); | |||
/** Frees all resources associated to an existing decoder state. | /** Frees all resources associated to an existing decoder state. | |||
* | * | |||
* @param state State to be destroyed | * @param state State to be destroyed | |||
*/ | */ | |||
void speex_decoder_destroy(void *state); | void speex_decoder_destroy(void *state); | |||
/** Uses an existing decoder state to decode one frame of speech from | /** Uses an existing decoder state to decode one frame of speech from | |||
* bit-stream bits. The output speech is saved written to out. | * bit-stream bits. The output speech is saved written to out. | |||
* | * | |||
skipping to change at line 308 | skipping to change at line 308 | |||
* @return 0 for no error, 1 if a terminator is reached, 2 for another erro r | * @return 0 for no error, 1 if a terminator is reached, 2 for another erro r | |||
*/ | */ | |||
int speex_decoder_ctl(void *state, int request, void *ptr); | int speex_decoder_ctl(void *state, int request, void *ptr); | |||
/** Query function for mode information | /** Query function for mode information | |||
* | * | |||
* @param mode Speex mode | * @param mode Speex mode | |||
* @param request ioctl-type request (one of the SPEEX_* macros) | * @param request ioctl-type request (one of the SPEEX_* macros) | |||
* @param ptr Data exchanged to-from function | * @param ptr Data exchanged to-from function | |||
*/ | */ | |||
int speex_mode_query(SpeexMode *mode, int request, void *ptr); | int speex_mode_query(const SpeexMode *mode, int request, void *ptr); | |||
/** Default narrowband mode */ | /** Default narrowband mode */ | |||
extern SpeexMode speex_nb_mode; | extern const SpeexMode speex_nb_mode; | |||
/** Default wideband mode */ | /** Default wideband mode */ | |||
extern SpeexMode speex_wb_mode; | extern const SpeexMode speex_wb_mode; | |||
/** Default "ultra-wideband" mode */ | /** Default "ultra-wideband" mode */ | |||
extern SpeexMode speex_uwb_mode; | extern const SpeexMode speex_uwb_mode; | |||
#ifdef EPIC_48K | #ifdef EPIC_48K | |||
/** 4.8 kbps narrowband mode */ | /** 4.8 kbps narrowband mode */ | |||
extern SpeexMode speex_nb_48k_mode; | extern const SpeexMode speex_nb_48k_mode; | |||
#endif | #endif | |||
/** List of all modes available */ | /** List of all modes available */ | |||
extern SpeexMode *speex_mode_list[SPEEX_NB_MODES]; | extern const SpeexMode *speex_mode_list[SPEEX_NB_MODES]; | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
#endif | #endif | |||
End of changes. 12 change blocks. | ||||
12 lines changed or deleted | 12 lines changed or added | |||
speex_header.h | speex_header.h | |||
---|---|---|---|---|
skipping to change at line 68 | skipping to change at line 68 | |||
int bitrate; /**< Bit-rate used */ | int bitrate; /**< Bit-rate used */ | |||
int frame_size; /**< Size of frames */ | int frame_size; /**< Size of frames */ | |||
int vbr; /**< 1 for a VBR encoding, 0 otherwise */ | int vbr; /**< 1 for a VBR encoding, 0 otherwise */ | |||
int frames_per_packet; /**< Number of frames stored per Ogg packet */ | int frames_per_packet; /**< Number of frames stored per Ogg packet */ | |||
int extra_headers; /**< Number of additional headers after the comments */ | int extra_headers; /**< Number of additional headers after the comments */ | |||
int reserved1; /**< Reserved for future use, must be zero * / | int reserved1; /**< Reserved for future use, must be zero * / | |||
int reserved2; /**< Reserved for future use, must be zero * / | int reserved2; /**< Reserved for future use, must be zero * / | |||
} SpeexHeader; | } SpeexHeader; | |||
/** Initializes a SpeexHeader using basic information */ | /** Initializes a SpeexHeader using basic information */ | |||
void speex_init_header(SpeexHeader *header, int rate, int nb_channels, stru ct SpeexMode *m); | void speex_init_header(SpeexHeader *header, int rate, int nb_channels, cons t struct SpeexMode *m); | |||
/** Creates the header packet from the header itself (mostly involves endia nness conversion) */ | /** Creates the header packet from the header itself (mostly involves endia nness conversion) */ | |||
char *speex_header_to_packet(SpeexHeader *header, int *size); | char *speex_header_to_packet(SpeexHeader *header, int *size); | |||
/** Creates a SpeexHeader from a packet */ | /** Creates a SpeexHeader from a packet */ | |||
SpeexHeader *speex_packet_to_header(char *packet, int size); | SpeexHeader *speex_packet_to_header(char *packet, int size); | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||