1 // Copyright (C) 2012 The SBCELT Developers. All rights reserved.
2 // Use of this source code is governed by a BSD-style license
3 // that can be found in the LICENSE-file.
4 
5 #ifndef __SBCELT_H__
6 #define __SBCELT_H__
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 // Define SBCELT_PREFIX_API to prefix all exported
13 // symbols with 'sb'.
14 #ifdef SBCELT_PREFIX_API
15 # define SBCELT_FUNC(x) sb ## x
16   // Define SBCELT_COMPAT_API to have the preprocessor
17   // replace all occurrences of calls to vanilla CELT
18   // functions with calls to their SBCELT 'sb'-prefixed
19   // counter-parts.
20 # ifdef SBCELT_COMPAT_API
21 #  define  celt_mode_create      sbcelt_mode_create
22 #  define  celt_mode_destroy     sbcelt_mode_destroy
23 #  define  celt_mode_info        sbcelt_mode_info
24 #  define  celt_encoder_create   sbcelt_encoder_create
25 #  define  celt_encoder_destroy  sbcelt_encoder_destroy
26 #  define  celt_encode_float     sbcelt_encode_float
27 #  define  celt_encode           sbcelt_encode
28 #  define  celt_encoder_ctl      sbcelt_encoder_ctl
29 #  define  celt_decoder_create   sbcelt_decoder_create
30 #  define  celt_decoder_destroy  sbcelt_decoder_destroy
31 #  define  celt_decode_float     sbcelt_decode_float
32 #  define  celt_decode           sbcelt_decode
33 #  define  celt_decoder_ctl      sbcelt_decoder_ctl
34 #  define  celt_strerror         sbcelt_strerror
35 # endif
36 #else
37 # define SBCELT_FUNC(x) x
38 #endif
39 
40 CELTMode *SBCELT_FUNC(celt_mode_create)(celt_int32 Fs, int frame_size, int *error);
41 void SBCELT_FUNC(celt_mode_destroy)(CELTMode *mode);
42 int SBCELT_FUNC(celt_mode_info)(const CELTMode *mode, int request, celt_int32 *value);
43 CELTEncoder *SBCELT_FUNC(celt_encoder_create)(const CELTMode *mode, int channels, int *error);
44 void SBCELT_FUNC(celt_encoder_destroy)(CELTEncoder *st);
45 int SBCELT_FUNC(celt_encode_float)(CELTEncoder *st, const float *pcm, float *optional_synthesis,
46                         unsigned char *compressed, int nbCompressedBytes);
47 int SBCELT_FUNC(celt_encode)(CELTEncoder *st, const celt_int16 *pcm, celt_int16 *optional_synthesis,
48                   unsigned char *compressed, int nbCompressedBytes);
49 int SBCELT_FUNC(celt_encoder_ctl)(CELTEncoder * st, int request, ...);
50 CELTDecoder *SBCELT_FUNC(celt_decoder_create)(const CELTMode *mode, int channels, int *error);
51 void SBCELT_FUNC(celt_decoder_destroy)(CELTDecoder *st);
52 extern int (*SBCELT_FUNC(celt_decode_float))(CELTDecoder *st, const unsigned char *data, int len, float *pcm);
53 int SBCELT_FUNC(celt_decode)(CELTDecoder *st, const unsigned char *data, int len, celt_int16 *pcm);
54 int SBCELT_FUNC(celt_decoder_ctl)(CELTDecoder * st, int request, ...);
55 const char *SBCELT_FUNC(celt_strerror)(int error);
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif
62