celt.h | celt.h | |||
---|---|---|---|---|
skipping to change at line 98 | skipping to change at line 98 | |||
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_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 | |||
/** GET the frame size used in the current mode */ | #define CELT_SET_START_BAND_REQUEST 10000 | |||
#define CELT_GET_FRAME_SIZE 1000 | /** Controls the complexity from 0-10 (int) */ | |||
#define CELT_SET_START_BAND(x) CELT_SET_START_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 177 | skipping to change at line 179 | |||
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_synthesis If not NULL, the encoder copies the audio signal that | @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 | * the decoder would decode. It is the same as calling the | |||
* decoder on the compressed data, just faster. | * decoder on the compressed data, just faster. | |||
* This may alias pcm. | * This may alias pcm. | |||
@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, float *opti | EXPORT int celt_encode_resynthesis_float(CELTEncoder *st, const float *pcm, | |||
onal_synthesis, unsigned char *compressed, int nbCompressedBytes); | 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 | ||||
* 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_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_synthesis If not NULL, the encoder copies the audio signal that | @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 | * the decoder would decode. It is the same as call ing the | |||
* decoder on the compressed data, just faster. | * decoder on the compressed data, just faster. | |||
* This may alias pcm. | * This may alias pcm. | |||
@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(CELTEncoder *st, const celt_int16 *pcm, celt_int16 * | EXPORT int celt_encode_resynthesis(CELTEncoder *st, const celt_int16 *pcm, | |||
optional_synthesis, unsigned char *compressed, int nbCompressedBytes); | 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 | ||||
* 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(CELTEncoder *st, const celt_int16 *pcm, int frame_si | ||||
ze, unsigned char *compressed, int nbCompressedBytes); | ||||
/** 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 */ | |||
skipping to change at line 247 | skipping to change at line 285 | |||
/** 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. | |||
@param pcm One frame (frame_size samples per channel) of decoded PCM will be | @param pcm One frame (frame_size samples per channel) of decoded PCM will be | |||
returned here in float format. | returned here in float format. | |||
@return Error code. | @return Error code. | |||
*/ | */ | |||
EXPORT int celt_decode_float(CELTDecoder *st, const unsigned char *data, in t len, float *pcm); | EXPORT int celt_decode_float(CELTDecoder *st, const unsigned char *data, in t len, float *pcm, int frame_size); | |||
/** 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. | |||
@param pcm One frame (frame_size samples per channel) of decoded PCM will be | @param pcm One frame (frame_size samples per channel) of decoded PCM will be | |||
returned here in 16-bit PCM format (native endian). | returned here in 16-bit PCM format (native endian). | |||
@return Error code. | @return Error code. | |||
*/ | */ | |||
EXPORT int celt_decode(CELTDecoder *st, const unsigned char *data, int len, celt_int16 *pcm); | EXPORT int celt_decode(CELTDecoder *st, const unsigned char *data, int len, celt_int16 *pcm, int frame_size); | |||
/** Query and set decoder parameters | /** Query and set decoder parameters | |||
@param st Decoder state | @param st Decoder 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_decoder_ctl(CELTDecoder * st, int request, ...); | EXPORT int celt_decoder_ctl(CELTDecoder * st, int request, ...); | |||
/** Returns the English string that corresponds to an error code | /** Returns the English string that corresponds to an error code | |||
End of changes. 7 change blocks. | ||||
10 lines changed or deleted | 64 lines changed or added | |||