| celt.h | | celt.h | |
| | | | |
| skipping to change at line 99 | | skipping to change at line 99 | |
| */ | | */ | |
| #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_VBR_RATE_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_VBR_RATE(x) CELT_SET_VBR_RATE_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_START_BAND_REQUEST 10000 | | #define CELT_SET_START_BAND_REQUEST 10000 | |
|
| /** Controls the complexity from 0-10 (int) */ | | | |
| #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(x) CELT_SET_END_BAND_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 155 | | skipping to change at line 157 | |
| 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); | |
| | | | |
| /** 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(const CELTMode *mode, int channels,
int *error); | |
| | | | |
|
| | | EXPORT CELTEncoder *celt_encoder_init(CELTEncoder *st, const CELTMode *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 | |
| * be clipped by decoders using the integer API and should | | * be clipped by decoders using the integer API and should | |
| * only be used if it is known that the far end supports | | * only be used if it is known that the far end supports | |
| * extended dynmaic range. There must be exactly | | * extended dynmaic range. There must be exactly | |
| * frame_size samples per channel. | | * frame_size samples per channel. | |
|
| @param optional_resynthesis If not NULL, the encoder copies the audio sign | | | |
| al that | | | |
| * the decoder would decode. It is the same as calling the | | | |
| * decoder on the compressed data, just faster. | | | |
| * This may alias pcm. | | | |
| @param compressed The compressed data is written here. This may not alias | | | |
| pcm or | | | |
| * optional_synthesis. | | | |
| @param nbCompressedBytes Maximum number of bytes to use for compressing th | | | |
| e frame | | | |
| * (can change from one frame to another) | | | |
| @return Number of bytes written to "compressed". Will be the same as | | | |
| * "nbCompressedBytes" unless the stream is VBR and will never be lar | | | |
| ger. | | | |
| * If negative, an error has occurred (see error codes). It is IMPORT | | | |
| ANT that | | | |
| * the length returned be somehow transmitted to the decoder. Otherwi | | | |
| se, no | | | |
| * decoding is possible. | | | |
| */ | | | |
| EXPORT int celt_encode_resynthesis_float(CELTEncoder *st, const float *pcm, | | | |
| float *optional_resynthesis, int frame_size, unsigned char *compressed, in | | | |
| t nbCompressedBytes); | | | |
| | | | |
| /** Encodes a frame of audio. | | | |
| @param st Encoder state | | | |
| @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 | | | |
| * be clipped by decoders using the integer API and should | | | |
| * only be used if it is known that the far end supports | | | |
| * extended dynmaic range. There must be exactly | | | |
| * frame_size samples per channel. | | | |
| @param compressed The compressed data is written here. This may not alias
pcm or | | @param compressed The compressed data is written here. This may not alias
pcm or | |
| * optional_synthesis. | | * optional_synthesis. | |
| @param nbCompressedBytes Maximum number of bytes to use for compressing th
e frame | | @param nbCompressedBytes Maximum number of bytes to use for compressing th
e frame | |
| * (can change from one frame to another) | | * (can change from one frame to another) | |
| @return Number of bytes written to "compressed". Will be the same as | | @return Number of bytes written to "compressed". Will be the same as | |
| * "nbCompressedBytes" unless the stream is VBR and will never be lar
ger. | | * "nbCompressedBytes" unless the stream is VBR and will never be lar
ger. | |
| * If negative, an error has occurred (see error codes). It is IMPORT
ANT that | | * If negative, an error has occurred (see error codes). It is IMPORT
ANT that | |
| * the length returned be somehow transmitted to the decoder. Otherwi
se, no | | * the length returned be somehow transmitted to the decoder. Otherwi
se, no | |
| * decoding is possible. | | * decoding is possible. | |
| */ | | */ | |
| EXPORT int celt_encode_float(CELTEncoder *st, const float *pcm, int frame_s
ize, unsigned char *compressed, int nbCompressedBytes); | | EXPORT int celt_encode_float(CELTEncoder *st, const float *pcm, int frame_s
ize, unsigned char *compressed, int nbCompressedBytes); | |
| | | | |
| /** Encodes a frame of audio. | | /** Encodes a frame of audio. | |
| @param st Encoder state | | @param st Encoder state | |
| @param pcm PCM audio in signed 16-bit format (native endian). There must b
e | | @param pcm PCM audio in signed 16-bit format (native endian). There must b
e | |
| * exactly frame_size samples per channel. | | * exactly frame_size samples per channel. | |
|
| @param optional_resynthesis If not NULL, the encoder copies the audio sign | | | |
| al that | | | |
| * the decoder would decode. It is the same as call | | | |
| ing the | | | |
| * decoder on the compressed data, just faster. | | | |
| * This may alias pcm. | | | |
| @param compressed The compressed data is written here. This may not alias | | | |
| pcm or | | | |
| * optional_synthesis. | | | |
| @param nbCompressedBytes Maximum number of bytes to use for compressing th | | | |
| e frame | | | |
| * (can change from one frame to another) | | | |
| @return Number of bytes written to "compressed". Will be the same as | | | |
| * "nbCompressedBytes" unless the stream is VBR and will never be lar | | | |
| ger. | | | |
| * If negative, an error has occurred (see error codes). It is IMPORT | | | |
| ANT that | | | |
| * the length returned be somehow transmitted to the decoder. Otherwi | | | |
| se, no | | | |
| * decoding is possible. | | | |
| */ | | | |
| EXPORT int celt_encode_resynthesis(CELTEncoder *st, const celt_int16 *pcm, | | | |
| celt_int16 *optional_resynthesis, int frame_size, unsigned char *compressed | | | |
| , int nbCompressedBytes); | | | |
| | | | |
| /** Encodes a frame of audio. | | | |
| @param st Encoder state | | | |
| @param pcm PCM audio in signed 16-bit format (native endian). There must b | | | |
| e | | | |
| * exactly frame_size samples per channel. | | | |
| @param compressed The compressed data is written here. This may not alias
pcm or | | @param compressed The compressed data is written here. This may not alias
pcm or | |
| * optional_synthesis. | | * optional_synthesis. | |
| @param nbCompressedBytes Maximum number of bytes to use for compressing th
e frame | | @param nbCompressedBytes Maximum number of bytes to use for compressing th
e frame | |
| * (can change from one frame to another) | | * (can change from one frame to another) | |
| @return Number of bytes written to "compressed". Will be the same as | | @return Number of bytes written to "compressed". Will be the same as | |
| * "nbCompressedBytes" unless the stream is VBR and will never be lar
ger. | | * "nbCompressedBytes" unless the stream is VBR and will never be lar
ger. | |
| * If negative, an error has occurred (see error codes). It is IMPORT
ANT that | | * If negative, an error has occurred (see error codes). It is IMPORT
ANT that | |
| * the length returned be somehow transmitted to the decoder. Otherwi
se, no | | * the length returned be somehow transmitted to the decoder. Otherwi
se, no | |
| * decoding is possible. | | * decoding is possible. | |
| */ | | */ | |
| | | | |
| skipping to change at line 261 | | skipping to change at line 223 | |
| /** 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); | |
| | | | |
| /** 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(const CELTMode *mode, int channels,
int *error); | |
| | | | |
|
| | | EXPORT CELTDecoder *celt_decoder_init(CELTDecoder *st, const CELTMode *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 | |
| of bytes returned by the encoder. Using a larger value WILL NOT
WORK. | | of bytes returned by the encoder. Using a larger value WILL NOT
WORK. | |
| | | | |
End of changes. 8 change blocks. |
| 63 lines changed or deleted | | 13 lines changed or added | |
|