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
00056 #define CELT_OK 0
00057
00058 #define CELT_BAD_ARG -1
00059
00060 #define CELT_INVALID_MODE -2
00061
00062 #define CELT_INTERNAL_ERROR -3
00063
00064 #define CELT_CORRUPTED_DATA -4
00065
00066
00068 #define CELT_GET_FRAME_SIZE 1000
00069
00070 #define CELT_GET_LOOKAHEAD 1001
00071
00072 #define CELT_GET_NB_CHANNELS 1002
00073
00075 #define CELT_GET_BITSTREAM_VERSION 2000
00076
00077
00083 typedef struct CELTEncoder CELTEncoder;
00084
00088 typedef struct CELTDecoder CELTDecoder;
00089
00093 typedef struct CELTMode CELTMode;
00094
00095
00097
00098
00099
00100
00111 EXPORT CELTMode *celt_mode_create(celt_int32_t Fs, int channels, int frame_size, int *error);
00112
00117 EXPORT void celt_mode_destroy(CELTMode *mode);
00118
00120 EXPORT int celt_mode_info(const CELTMode *mode, int request, celt_int32_t *value);
00121
00122
00123
00124
00125
00132 EXPORT CELTEncoder *celt_encoder_create(const CELTMode *mode);
00133
00137 EXPORT void celt_encoder_destroy(CELTEncoder *st);
00138
00152 EXPORT int celt_encode(CELTEncoder *st, celt_int16_t *pcm, unsigned char *compressed, int nbCompressedBytes);
00153
00154
00155
00156
00163 EXPORT CELTDecoder *celt_decoder_create(const CELTMode *mode);
00164
00168 EXPORT void celt_decoder_destroy(CELTDecoder *st);
00169
00179 EXPORT int celt_decode(CELTDecoder *st, unsigned char *data, int len, celt_int16_t *pcm);
00180
00181
00182
00183
00184 #ifdef __cplusplus
00185 }
00186 #endif
00187
00188 #endif