00001
00002
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef CELT_H
00038 #define CELT_H
00039
00040 #include "celt_types.h"
00041
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045
00046 #if defined(__GNUC__) && defined(CELT_BUILD)
00047 #define EXPORT __attribute__ ((visibility ("default")))
00048 #elif defined(WIN32)
00049 #define EXPORT __declspec(dllexport)
00050 #else
00051 #define EXPORT
00052 #endif
00053
00054 #define _celt_check_int(x) (((void)((x) == (int)0)), (int)(x))
00055
00056
00058 #define CELT_OK 0
00059
00060 #define CELT_BAD_ARG -1
00061
00062 #define CELT_INVALID_MODE -2
00063
00064 #define CELT_INTERNAL_ERROR -3
00065
00066 #define CELT_CORRUPTED_DATA -4
00067
00068 #define CELT_UNIMPLEMENTED -5
00069
00070
00071 #define CELT_SET_COMPLEXITY_REQUEST 2
00072
00073 #define CELT_SET_COMPLEXITY(x) CELT_SET_COMPLEXITY_REQUEST, _celt_check_int(x)
00074 #define CELT_SET_LTP_REQUEST 3
00075
00076 #define CELT_SET_LTP(x) CELT_SET_LTP_REQUEST, _celt_check_int(x)
00077
00079 #define CELT_GET_FRAME_SIZE 1000
00080
00081 #define CELT_GET_LOOKAHEAD 1001
00082
00083 #define CELT_GET_NB_CHANNELS 1002
00084
00086 #define CELT_GET_BITSTREAM_VERSION 2000
00087
00088
00094 typedef struct CELTEncoder CELTEncoder;
00095
00099 typedef struct CELTDecoder CELTDecoder;
00100
00104 typedef struct CELTMode CELTMode;
00105
00106
00108
00109
00110
00111
00122 EXPORT CELTMode *celt_mode_create(celt_int32_t Fs, int channels, int frame_size, int *error);
00123
00128 EXPORT void celt_mode_destroy(CELTMode *mode);
00129
00131 EXPORT int celt_mode_info(const CELTMode *mode, int request, celt_int32_t *value);
00132
00133
00134
00135
00142 EXPORT CELTEncoder *celt_encoder_create(const CELTMode *mode);
00143
00147 EXPORT void celt_encoder_destroy(CELTEncoder *st);
00148
00165 EXPORT int celt_encode_float(CELTEncoder *st, const float *pcm, float *optional_synthesis, unsigned char *compressed, int nbCompressedBytes);
00182 EXPORT int celt_encode(CELTEncoder *st, const celt_int16_t *pcm, celt_int16_t *optional_synthesis, unsigned char *compressed, int nbCompressedBytes);
00183
00190 EXPORT int celt_encoder_ctl(CELTEncoder * st, int request, ...);
00191
00192
00193
00194
00201 EXPORT CELTDecoder *celt_decoder_create(const CELTMode *mode);
00202
00206 EXPORT void celt_decoder_destroy(CELTDecoder *st);
00207
00217 EXPORT int celt_decode_float(CELTDecoder *st, unsigned char *data, int len, float *pcm);
00227 EXPORT int celt_decode(CELTDecoder *st, unsigned char *data, int len, celt_int16_t *pcm);
00228
00229
00230
00231
00232 #ifdef __cplusplus
00233 }
00234 #endif
00235
00236 #endif