Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <zephyr/toolchain.h>
#include "sbc_encoder.h"
#include "oi_codec_sbc.h"
#include "oi_status.h"
Expand Down
9 changes: 2 additions & 7 deletions modules/libsbc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
if(CONFIG_LIBSBC_ENCODER OR CONFIG_LIBSBC_DECODER)
if(CONFIG_LIBSBC)

zephyr_library_named(libsbc)
zephyr_library_compile_options(-O3 -std=c11 -ffast-math -Wno-array-bounds)
zephyr_library_compile_options(-O3 -std=c11 -ffast-math -Wno-stringop-overflow)

zephyr_compile_definitions(SBC_FOR_EMBEDDED_LINUX)
zephyr_compile_definitions(SBC_NO_PCM_CPY_OPTION)
zephyr_library_sources(sbc.c)

zephyr_include_directories(
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/include
Expand All @@ -16,7 +15,6 @@ zephyr_include_directories(
${ZEPHYR_LIBSBC_MODULE_DIR}/decoder/srce
)

if(CONFIG_LIBSBC_ENCODER)
zephyr_library_sources(
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/srce/sbc_analysis.c
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/srce/sbc_dct.c
Expand All @@ -27,9 +25,7 @@ zephyr_library_sources(
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/srce/sbc_encoder.c
${ZEPHYR_LIBSBC_MODULE_DIR}/encoder/srce/sbc_packing.c
)
endif()

if(CONFIG_LIBSBC_DECODER)
zephyr_library_sources(
${ZEPHYR_LIBSBC_MODULE_DIR}/decoder/srce/alloc.c
${ZEPHYR_LIBSBC_MODULE_DIR}/decoder/srce/bitalloc.c
Expand All @@ -48,4 +44,3 @@ zephyr_library_sources(
${ZEPHYR_LIBSBC_MODULE_DIR}/decoder/srce/synthesis-sbc.c
)
endif()
endif()
11 changes: 3 additions & 8 deletions modules/libsbc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
config ZEPHYR_LIBSBC_MODULE
bool

config LIBSBC_ENCODER
bool "libsbc encoder Support"
config LIBSBC
bool "libsbc Support"
help
This option enables the Android SBC encoder library for Bluetooth A2DP

config LIBSBC_DECODER
bool "libsbc decoder Support"
help
This option enables the Android SBC decoder library for Bluetooth A2DP
This option enables low Complexity Subband Coding (SBC)
1 change: 1 addition & 0 deletions subsys/bluetooth/host/classic/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ config BT_AVDTP
config BT_A2DP
bool "Bluetooth A2DP Profile [EXPERIMENTAL]"
select BT_AVDTP
imply LIBSBC
select EXPERIMENTAL
help
This option enables the A2DP profile
Expand Down
1 change: 1 addition & 0 deletions subsys/bluetooth/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_sources_ifdef(CONFIG_BT_EAD ead.c)
zephyr_sources_ifdef(CONFIG_LIBSBC sbc.c)
6 changes: 2 additions & 4 deletions modules/libsbc/sbc.c → subsys/bluetooth/lib/sbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/

#include <errno.h>
#include <zephyr/libsbc/sbc.h>
#include <zephyr/bluetooth/sbc.h>

#if defined(CONFIG_LIBSBC_ENCODER)
#if defined(CONFIG_LIBSBC)

int sbc_setup_encoder(struct sbc_encoder *encoder, struct sbc_encoder_init_param *param)
{
Expand Down Expand Up @@ -136,9 +136,7 @@ int sbc_frame_encoded_bytes(struct sbc_encoder *encoder)

return size;
}
#endif

#if defined(CONFIG_LIBSBC_DECODER)
/**
* Setup decoder
*/
Expand Down