| celt.h | | celt.h | |
| | | | |
| skipping to change at line 81 | | skipping to change at line 81 | |
| #define CELT_UNIMPLEMENTED -5 | | #define CELT_UNIMPLEMENTED -5 | |
| /** An encoder or decoder structure is invalid or already freed */ | | /** An encoder or decoder structure is invalid or already freed */ | |
| #define CELT_INVALID_STATE -6 | | #define CELT_INVALID_STATE -6 | |
| /** Memory allocation has failed */ | | /** Memory allocation has failed */ | |
| #define CELT_ALLOC_FAIL -7 | | #define CELT_ALLOC_FAIL -7 | |
| | | | |
| /* Requests */ | | /* Requests */ | |
| #define CELT_GET_MODE_REQUEST 1 | | #define CELT_GET_MODE_REQUEST 1 | |
| /** Get the CELTMode used by an encoder or decoder */ | | /** Get the CELTMode used by an encoder or decoder */ | |
| #define CELT_GET_MODE(x) CELT_GET_MODE_REQUEST, _celt_check_mode_ptr_ptr(x) | | #define CELT_GET_MODE(x) CELT_GET_MODE_REQUEST, _celt_check_mode_ptr_ptr(x) | |
|
| | | | |
| #define CELT_SET_COMPLEXITY_REQUEST 2 | | #define CELT_SET_COMPLEXITY_REQUEST 2 | |
| /** Controls the complexity from 0-10 (int) */ | | /** Controls the complexity from 0-10 (int) */ | |
| #define CELT_SET_COMPLEXITY(x) CELT_SET_COMPLEXITY_REQUEST, _celt_check_int
(x) | | #define CELT_SET_COMPLEXITY(x) CELT_SET_COMPLEXITY_REQUEST, _celt_check_int
(x) | |
|
| | | | |
| #define CELT_SET_PREDICTION_REQUEST 4 | | #define CELT_SET_PREDICTION_REQUEST 4 | |
| /** Controls the use of interframe prediction. | | /** Controls the use of interframe prediction. | |
| 0=Independent frames | | 0=Independent frames | |
| 1=Short term interframe prediction allowed | | 1=Short term interframe prediction allowed | |
| 2=Long term prediction allowed | | 2=Long term prediction allowed | |
| */ | | */ | |
| #define CELT_SET_PREDICTION(x) CELT_SET_PREDICTION_REQUEST, _celt_check_int
(x) | | #define CELT_SET_PREDICTION(x) CELT_SET_PREDICTION_REQUEST, _celt_check_int
(x) | |
|
| #define CELT_SET_VBR_RATE_REQUEST 6 | | | |
| | | #define CELT_SET_BITRATE_REQUEST 6 | |
| /** Set the target VBR rate in bits per second(int); 0=CBR (default) */ | | /** Set the target VBR rate in bits per second(int); 0=CBR (default) */ | |
|
| #define CELT_SET_VBR_RATE(x) CELT_SET_VBR_RATE_REQUEST, _celt_check_int(x) | | #define CELT_SET_BITRATE(x) CELT_SET_BITRATE_REQUEST, _celt_check_int(x) | |
| | | | |
| /** Reset the encoder/decoder memories to zero*/ | | /** Reset the encoder/decoder memories to zero*/ | |
| #define CELT_RESET_STATE_REQUEST 8 | | #define CELT_RESET_STATE_REQUEST 8 | |
| #define CELT_RESET_STATE CELT_RESET_STATE_REQUEST | | #define CELT_RESET_STATE CELT_RESET_STATE_REQUEST | |
| | | | |
| #define CELT_SET_VBR_CONSTRAINT_REQUEST 10 | | #define CELT_SET_VBR_CONSTRAINT_REQUEST 10 | |
| #define CELT_SET_VBR_CONSTRAINT(x) CELT_SET_VBR_CONSTRAINT_REQUEST, _
celt_check_int(x) | | #define CELT_SET_VBR_CONSTRAINT(x) CELT_SET_VBR_CONSTRAINT_REQUEST, _
celt_check_int(x) | |
| | | | |
|
| | | #define CELT_SET_VBR_REQUEST 12 | |
| | | #define CELT_SET_VBR(x) CELT_SET_VBR_REQUEST, _celt_check_int(x) | |
| | | | |
| | | #define CELT_SET_INPUT_CLIPPING_REQUEST 14 | |
| | | #define CELT_SET_INPUT_CLIPPING(x) CELT_SET_INPUT_CLIPPING_REQUEST, _celt_c | |
| | | heck_int(x) | |
| | | | |
| #define CELT_SET_START_BAND_REQUEST 10000 | | #define CELT_SET_START_BAND_REQUEST 10000 | |
| #define CELT_SET_START_BAND(x) CELT_SET_START_BAND_REQUEST, _celt_check_int
(x) | | #define CELT_SET_START_BAND(x) CELT_SET_START_BAND_REQUEST, _celt_check_int
(x) | |
| | | | |
| #define CELT_SET_END_BAND_REQUEST 10001 | | #define CELT_SET_END_BAND_REQUEST 10001 | |
| #define CELT_SET_END_BAND(x) CELT_SET_END_BAND_REQUEST, _celt_check_int(x) | | #define CELT_SET_END_BAND(x) CELT_SET_END_BAND_REQUEST, _celt_check_int(x) | |
| | | | |
|
| | | #define CELT_SET_CHANNELS_REQUEST 10002 | |
| | | #define CELT_SET_CHANNELS(x) CELT_SET_CHANNELS_REQUEST, _celt_check_int(x) | |
| | | | |
| /** GET the lookahead used in the current mode */ | | /** GET the lookahead used in the current mode */ | |
| #define CELT_GET_LOOKAHEAD 1001 | | #define CELT_GET_LOOKAHEAD 1001 | |
| /** GET the sample rate used in the current mode */ | | /** GET the sample rate used in the current mode */ | |
| #define CELT_GET_SAMPLE_RATE 1003 | | #define CELT_GET_SAMPLE_RATE 1003 | |
| | | | |
| /** GET the bit-stream version for compatibility check */ | | /** GET the bit-stream version for compatibility check */ | |
| #define CELT_GET_BITSTREAM_VERSION 2000 | | #define CELT_GET_BITSTREAM_VERSION 2000 | |
| | | | |
| /** Contains the state of an encoder. One encoder state is needed | | /** Contains the state of an encoder. One encoder state is needed | |
| for each stream. It is initialised once at the beginning of the | | for each stream. It is initialised once at the beginning of the | |
| | | | |
| skipping to change at line 160 | | skipping to change at line 173 | |
| decoders using this mode are destroyed as well. | | decoders using this mode are destroyed as well. | |
| @param mode Mode to be destroyed | | @param mode Mode to be destroyed | |
| */ | | */ | |
| EXPORT void celt_mode_destroy(CELTMode *mode); | | EXPORT void celt_mode_destroy(CELTMode *mode); | |
| | | | |
| /** Query information from a mode */ | | /** Query information from a mode */ | |
| EXPORT int celt_mode_info(const CELTMode *mode, int request, celt_int32 *va
lue); | | EXPORT int celt_mode_info(const CELTMode *mode, int request, celt_int32 *va
lue); | |
| | | | |
| /* Encoder stuff */ | | /* Encoder stuff */ | |
| | | | |
|
| EXPORT int celt_encoder_get_size(const CELTMode *mode, int channels); | | EXPORT int celt_encoder_get_size(int channels); | |
| | | | |
| | | EXPORT int celt_encoder_get_size_custom(const CELTMode *mode, int channels) | |
| | | ; | |
| | | | |
| | | /** Creates a new encoder state. Each stream needs its own encoder | |
| | | state (can't be shared across simultaneous streams). | |
| | | @param channels Number of channels | |
| | | @param error Returns an error code | |
| | | @return Newly created encoder state. | |
| | | */ | |
| | | EXPORT CELTEncoder *celt_encoder_create(int sampling_rate, int channels, in | |
| | | t *error); | |
| | | | |
| /** Creates a new encoder state. Each stream needs its own encoder | | /** Creates a new encoder state. Each stream needs its own encoder | |
| state (can't be shared across simultaneous streams). | | state (can't be shared across simultaneous streams). | |
| @param mode Contains all the information about the characteristics of | | @param mode Contains all the information about the characteristics of | |
| * the stream (must be the same characteristics as used for the | | * the stream (must be the same characteristics as used for the | |
| * decoder) | | * decoder) | |
| @param channels Number of channels | | @param channels Number of channels | |
| @param error Returns an error code | | @param error Returns an error code | |
| @return Newly created encoder state. | | @return Newly created encoder state. | |
| */ | | */ | |
|
| EXPORT CELTEncoder *celt_encoder_create(const CELTMode *mode, int channels,
int *error); | | EXPORT CELTEncoder *celt_encoder_create_custom(const CELTMode *mode, int ch
annels, int *error); | |
| | | | |
|
| EXPORT CELTEncoder *celt_encoder_init(CELTEncoder *st, const CELTMode *mode | | EXPORT CELTEncoder *celt_encoder_init(CELTEncoder *st, int sampling_rate, i | |
| , int channels, int *error); | | nt channels, int *error); | |
| | | | |
| | | EXPORT CELTEncoder *celt_encoder_init_custom(CELTEncoder *st, const CELTMod | |
| | | e *mode, int channels, int *error); | |
| | | | |
| /** Destroys a an encoder state. | | /** Destroys a an encoder state. | |
| @param st Encoder state to be destroyed | | @param st Encoder state to be destroyed | |
| */ | | */ | |
| EXPORT void celt_encoder_destroy(CELTEncoder *st); | | EXPORT void celt_encoder_destroy(CELTEncoder *st); | |
| | | | |
| /** Encodes a frame of audio. | | /** Encodes a frame of audio. | |
| @param st Encoder state | | @param st Encoder state | |
| @param pcm PCM audio in float format, with a normal range of ±1.0. | | @param pcm PCM audio in float format, with a normal range of ±1.0. | |
| * Samples with a range beyond ±1.0 are supported but will | | * Samples with a range beyond ±1.0 are supported but will | |
| | | | |
| skipping to change at line 226 | | skipping to change at line 251 | |
| /** Query and set encoder parameters | | /** Query and set encoder parameters | |
| @param st Encoder state | | @param st Encoder state | |
| @param request Parameter to change or query | | @param request Parameter to change or query | |
| @param value Pointer to a 32-bit int value | | @param value Pointer to a 32-bit int value | |
| @return Error code | | @return Error code | |
| */ | | */ | |
| EXPORT int celt_encoder_ctl(CELTEncoder * st, int request, ...); | | EXPORT int celt_encoder_ctl(CELTEncoder * st, int request, ...); | |
| | | | |
| /* Decoder stuff */ | | /* Decoder stuff */ | |
| | | | |
|
| EXPORT int celt_decoder_get_size(const CELTMode *mode, int channels); | | EXPORT int celt_decoder_get_size(int channels); | |
| | | | |
| | | EXPORT int celt_decoder_get_size_custom(const CELTMode *mode, int channels) | |
| | | ; | |
| | | | |
| /** Creates a new decoder state. Each stream needs its own decoder state (c
an't | | /** Creates a new decoder state. Each stream needs its own decoder state (c
an't | |
| be shared across simultaneous streams). | | be shared across simultaneous streams). | |
| @param mode Contains all the information about the characteristics of the | | @param mode Contains all the information about the characteristics of the | |
| stream (must be the same characteristics as used for the encod
er) | | stream (must be the same characteristics as used for the encod
er) | |
| @param channels Number of channels | | @param channels Number of channels | |
| @param error Returns an error code | | @param error Returns an error code | |
| @return Newly created decoder state. | | @return Newly created decoder state. | |
| */ | | */ | |
|
| EXPORT CELTDecoder *celt_decoder_create(const CELTMode *mode, int channels,
int *error); | | EXPORT CELTDecoder *celt_decoder_create(int sampling_rate, int channels, in
t *error); | |
| | | | |
|
| EXPORT CELTDecoder *celt_decoder_init(CELTDecoder *st, const CELTMode *mode | | /** Creates a new decoder state. Each stream needs its own decoder state (c | |
| , int channels, int *error); | | an't | |
| | | be shared across simultaneous streams). | |
| | | @param mode Contains all the information about the characteristics of the | |
| | | stream (must be the same characteristics as used for the encod | |
| | | er) | |
| | | @param channels Number of channels | |
| | | @param error Returns an error code | |
| | | @return Newly created decoder state. | |
| | | */ | |
| | | EXPORT CELTDecoder *celt_decoder_create_custom(const CELTMode *mode, int ch | |
| | | annels, int *error); | |
| | | | |
| | | EXPORT CELTDecoder *celt_decoder_init(CELTDecoder *st, int sampling_rate, i | |
| | | nt channels, int *error); | |
| | | | |
| | | EXPORT CELTDecoder *celt_decoder_init_custom(CELTDecoder *st, const CELTMod | |
| | | e *mode, int channels, int *error); | |
| | | | |
| /** Destroys a a decoder state. | | /** Destroys a a decoder state. | |
| @param st Decoder state to be destroyed | | @param st Decoder state to be destroyed | |
| */ | | */ | |
| EXPORT void celt_decoder_destroy(CELTDecoder *st); | | EXPORT void celt_decoder_destroy(CELTDecoder *st); | |
| | | | |
| /** Decodes a frame of audio. | | /** Decodes a frame of audio. | |
| @param st Decoder state | | @param st Decoder state | |
| @param data Compressed data produced by an encoder | | @param data Compressed data produced by an encoder | |
| @param len Number of bytes to read from "data". This MUST be exactly the n
umber | | @param len Number of bytes to read from "data". This MUST be exactly the n
umber | |
| | | | |
End of changes. 12 change blocks. |
| 10 lines changed or deleted | | 58 lines changed or added | |
|