Zephyr Project API 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
sbc.h
Go to the documentation of this file.
1/*
2 * Copyright 2024 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include <stdint.h>
8#include <stdbool.h>
9#include <string.h>
10#if defined(CONFIG_LIBSBC_ENCODER)
11#include "sbc_encoder.h"
12#endif
13#if defined(CONFIG_LIBSBC_DECODER)
14#include "oi_codec_sbc.h"
15#include "oi_status.h"
16#endif
17
24
29
30#if defined(CONFIG_LIBSBC_ENCODER)
31
32struct sbc_encoder {
33 SBC_ENC_PARAMS sbc_encoder_params;
34};
35
36struct sbc_encoder_init_param {
37 uint32_t bit_rate;
38 uint32_t samp_freq;
39 uint8_t blk_len;
40 uint8_t subband;
41 enum sbc_alloc_mthd alloc_mthd;
42 enum sbc_ch_mode ch_mode;
43 uint8_t ch_num;
44 uint8_t min_bitpool;
45 uint8_t max_bitpool;
46};
47
53int sbc_setup_encoder(struct sbc_encoder *encoder, struct sbc_encoder_init_param *param);
54
63uint32_t sbc_encode(struct sbc_encoder *encoder, const void *in_data, void *out_data);
64
70int sbc_frame_samples(struct sbc_encoder *encoder);
71
77int sbc_frame_bytes(struct sbc_encoder *encoder);
78
84int sbc_frame_encoded_bytes(struct sbc_encoder *encoder);
85#endif
86
87#if defined(CONFIG_LIBSBC_DECODER)
88
89struct sbc_decoder {
90 OI_CODEC_SBC_DECODER_CONTEXT context;
91 uint32_t context_data[CODEC_DATA_WORDS(2, SBC_CODEC_FAST_FILTER_BUFFERS)];
92};
93
100int sbc_setup_decoder(struct sbc_decoder *decoder);
101
111int sbc_decode(struct sbc_decoder *decoder, const void **in_data, uint32_t *in_size,
112 void *out_data, uint32_t *out_size);
113#endif
sbc_ch_mode
Definition sbc.h:18
@ SBC_CH_MODE_MONO
Definition sbc.h:19
@ SBC_CH_MODE_JOINT_STEREO
Definition sbc.h:22
@ SBC_CH_MODE_STEREO
Definition sbc.h:21
@ SBC_CH_MODE_DUAL_CHANNEL
Definition sbc.h:20
sbc_alloc_mthd
Definition sbc.h:25
@ SBC_ALLOC_MTHD_LOUDNESS
Definition sbc.h:26
@ SBC_ALLOC_MTHD_SNR
Definition sbc.h:27
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88