3
* Bluetooth low-complexity, subband codec (SBC) library
5
* Copyright (C) 2004-2008 Marcel Holtmann <marcel@holtmann.org>
6
* Copyright (C) 2004-2005 Henryk Ploetz <henryk@ploetzli.ch>
7
* Copyright (C) 2005-2006 Brad Midgley <bmidgley@xmission.com>
10
* This library is free software; you can redistribute it and/or
11
* modify it under the terms of the GNU Lesser General Public
12
* License as published by the Free Software Foundation; either
13
* version 2.1 of the License, or (at your option) any later version.
15
* This library is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
* Lesser General Public License for more details.
20
* You should have received a copy of the GNU Lesser General Public
21
* License along with this library; if not, write to the Free Software
22
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
35
/* sampling frequency */
36
#define SBC_FREQ_16000 0x00
37
#define SBC_FREQ_32000 0x01
38
#define SBC_FREQ_44100 0x02
39
#define SBC_FREQ_48000 0x03
42
#define SBC_BLK_4 0x00
43
#define SBC_BLK_8 0x01
44
#define SBC_BLK_12 0x02
45
#define SBC_BLK_16 0x03
48
#define SBC_MODE_MONO 0x00
49
#define SBC_MODE_DUAL_CHANNEL 0x01
50
#define SBC_MODE_STEREO 0x02
51
#define SBC_MODE_JOINT_STEREO 0x03
53
/* allocation method */
54
#define SBC_AM_LOUDNESS 0x00
55
#define SBC_AM_SNR 0x01
79
typedef struct sbc_struct sbc_t;
81
int sbc_init(sbc_t *sbc, unsigned long flags);
82
int sbc_reinit(sbc_t *sbc, unsigned long flags);
83
int sbc_parse(sbc_t *sbc, void *input, int input_len);
84
int sbc_decode(sbc_t *sbc, void *input, int input_len, void *output,
85
int output_len, int *len);
86
int sbc_encode(sbc_t *sbc, void *input, int input_len, void *output,
87
int output_len, int *written);
88
int sbc_get_frame_length(sbc_t *sbc);
89
int sbc_get_frame_duration(sbc_t *sbc);
90
int sbc_get_codesize(sbc_t *sbc);
91
void sbc_finish(sbc_t *sbc);