1 /* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
2  * Use of this source code is governed by a BSD-style license that can be
3  * found in the LICENSE file.
4  */
5 
6 #ifndef COMMON_CRAS_SBC_CODEC_H_
7 #define COMMON_CRAS_SBC_CODEC_H_
8 
9 #include <sbc/sbc.h>
10 
11 #include "cras_audio_codec.h"
12 
13 /* Creates an sbc codec.
14  * Args:
15  *    freq: frequency for sbc encoder settings.
16  *    mode: mode for sbc encoder settings.
17  *    subbands: subbands for sbc encoder settings.
18  *    alloc: allocation method for sbc encoder settings.
19  *    blocks: blocks for sbc encoder settings.
20  *    bitpool: bitpool for sbc encoder settings.
21  */
22 struct cras_audio_codec *cras_sbc_codec_create(uint8_t freq,
23 		   uint8_t mode, uint8_t subbands, uint8_t alloc,
24 		   uint8_t blocks, uint8_t bitpool);
25 
26 /* Destroys an sbc codec.
27  * Args:
28  *    codec: the codec to destroy.
29  */
30 void cras_sbc_codec_destroy(struct cras_audio_codec *codec);
31 
32 /* Gets codesize, the input block size of sbc codec in bytes.
33  */
34 int cras_sbc_get_codesize(struct cras_audio_codec *codec);
35 
36 /* Gets frame_length, the output block size of sbc codec in bytes.
37  */
38 int cras_sbc_get_frame_length(struct cras_audio_codec *codec);
39 
40 #endif /* COMMON_CRAS_SBC_CODEC_H_ */
41