diff --git a/test/lc3/CMakeLists.txt b/test/lc3/CMakeLists.txt index 707e00ee8..d7a03814e 100644 --- a/test/lc3/CMakeLists.txt +++ b/test/lc3/CMakeLists.txt @@ -17,26 +17,14 @@ endif() # local dir for btstack_config.h after build dir to avoid using .h from Makefile include_directories(.) -include_directories(../../3rd-party/kissfft) -include_directories(../../3rd-party/liblc3codec) +include_directories(../../3rd-party/lc3-google/include) include_directories(../../3rd-party/tinydir) -include_directories(../../src) include_directories(../../platform/posix) - -include_directories(../../3rd-party/liblc3codec/Api) -include_directories(../../3rd-party/liblc3codec/Common) -include_directories(../../3rd-party/liblc3codec/Common/KissFft) -include_directories(../../3rd-party/liblc3codec/Common/Tables) -include_directories(../../3rd-party/liblc3codec/TestSupport) +include_directories(../../src) file(GLOB SOURCES_POSIX "../../platform/posix/*.c") file(GLOB SOURCES_SRC "../../src/*.c" "../../src/*.cpp") -file(GLOB LC3_COMMON "../../3rd-party/liblc3codec/Common/*.cpp") -file(GLOB LC3_TABLES "../../3rd-party/liblc3codec/Common/Tables/*.cpp") -file(GLOB LC3_DECODER "../../3rd-party/liblc3codec/Decoder/*.cpp") -file(GLOB LC3_ENCODER "../../3rd-party/liblc3codec/Encoder/*.cpp") - -set (SOURCES_LC3 ${LC3_COMMON} ${LC3_TABLES} ${LC3_DECODER} ${LC3_ENCODER} ${LC3_TESTSUPPORT}) +file(GLOB SOURCES_LC3_GOOGLE "../../3rd-party/lc3-google/src/*.c") # Enable ASAN add_compile_options( -g -fsanitize=address) @@ -46,7 +34,7 @@ add_link_options( -fsanitize=address) file(GLOB EXAMPLES "lc3_*.c") foreach(EXAMPLE_FILE ${EXAMPLES}) get_filename_component(EXAMPLE ${EXAMPLE_FILE} NAME_WE) - set (SOURCE_FILES ${SOURCES_POSIX} ${SOURCES_SRC} ${SOURCES_LC3} ${EXAMPLE_FILE}) + set (SOURCE_FILES ${SOURCES_POSIX} ${SOURCES_SRC} ${SOURCES_LC3_GOOGLE} ${EXAMPLE_FILE}) message("Tool: ${EXAMPLE}") add_executable(${EXAMPLE} ${SOURCE_FILES} ) endforeach(EXAMPLE_FILE) diff --git a/test/lc3/btstack_config.h b/test/lc3/btstack_config.h index 91ab1653b..7b17d4581 100644 --- a/test/lc3/btstack_config.h +++ b/test/lc3/btstack_config.h @@ -10,7 +10,6 @@ #define HAVE_MALLOC #define HAVE_POSIX_FILE_IO #define HAVE_POSIX_TIME -#define HAVE_LC3_EHIMA // BTstack features that can be enabled #define ENABLE_BLE diff --git a/test/lc3/lc3_decoder_ehima.c b/test/lc3/lc3_decoder.c similarity index 96% rename from test/lc3/lc3_decoder_ehima.c rename to test/lc3/lc3_decoder.c index d74c44e7c..ea1531cfd 100644 --- a/test/lc3/lc3_decoder_ehima.c +++ b/test/lc3/lc3_decoder.c @@ -37,7 +37,7 @@ // ***************************************************************************** // -// LC3 decoder EHIMA +// LC3 decoder Google // // ***************************************************************************** @@ -53,7 +53,7 @@ #include "btstack_debug.h" #include "btstack_lc3.h" -#include "btstack_lc3_ehima.h" +#include "btstack_lc3_google.h" #define MAX_NUM_CHANNELS 2 #define MAX_SAMPLES_PER_FRAME 480 @@ -133,11 +133,11 @@ int main (int argc, const char * argv[]){ // init decoder uint8_t channel; - lc3_decoder_ehima_t decoder_contexts[MAX_NUM_CHANNELS]; + btstack_lc3_decoder_google_t decoder_contexts[MAX_NUM_CHANNELS]; const btstack_lc3_decoder_t * lc3_decoder; for (channel = 0 ; channel < num_channels ; channel++){ - lc3_decoder_ehima_t * decoder_context = &decoder_contexts[channel]; - lc3_decoder = lc3_decoder_ehima_init_instance(decoder_context); + btstack_lc3_decoder_google_t * decoder_context = &decoder_contexts[channel]; + lc3_decoder = btstack_lc3_decoder_google_init_instance(decoder_context); lc3_decoder->configure(decoder_context, sample_rate_hz, duration2); } diff --git a/test/lc3/lc3_encoder_ehima.c b/test/lc3/lc3_encoder.c similarity index 96% rename from test/lc3/lc3_encoder_ehima.c rename to test/lc3/lc3_encoder.c index 924faabbc..e15854bc0 100644 --- a/test/lc3/lc3_encoder_ehima.c +++ b/test/lc3/lc3_encoder.c @@ -53,7 +53,7 @@ #include "btstack_debug.h" #include "btstack_lc3.h" -#include "btstack_lc3_ehima.h" +#include "btstack_lc3_google.h" #define MAX_NUM_CHANNELS 2 #define MAX_SAMPLES_PER_FRAME 480 @@ -110,11 +110,11 @@ int main (int argc, const char * argv[]){ // init decoder uint8_t channel; - lc3_encoder_ehima_t encoder_contexts[MAX_NUM_CHANNELS]; + btstack_lc3_encoder_google_t encoder_contexts[MAX_NUM_CHANNELS]; const btstack_lc3_encoder_t * lc3_encoder; for (channel = 0 ; channel < num_channels ; channel++){ - lc3_encoder_ehima_t * encoder_context = &encoder_contexts[channel]; - lc3_encoder = lc3_encoder_ehima_init_instance(encoder_context); + btstack_lc3_encoder_google_t * encoder_context = &encoder_contexts[channel]; + lc3_encoder = btstack_lc3_encoder_google_init_instance(encoder_context); lc3_encoder->configure(encoder_context, sampling_frequency_hz, frame_duration); } uint32_t bitrate_per_channel = lc3_encoder->get_bitrate_for_number_of_octets(&encoder_contexts[0], bytes_per_frame); diff --git a/test/le_audio/CMakeLists.txt b/test/le_audio/CMakeLists.txt index 7ae02ce0c..709a77f3b 100644 --- a/test/le_audio/CMakeLists.txt +++ b/test/le_audio/CMakeLists.txt @@ -75,12 +75,7 @@ include_directories(../../3rd-party/bluedroid/encoder/include) include_directories(../../3rd-party/md5) include_directories(../../3rd-party/hxcmod-player) include_directories(../../3rd-party/hxcmod-player/mod) -include_directories(../../3rd-party/kissfft) -include_directories(../../3rd-party/liblc3codec/Api) -include_directories(../../3rd-party/liblc3codec/Common) -include_directories(../../3rd-party/liblc3codec/Common/KissFft) -include_directories(../../3rd-party/liblc3codec/Common/Tables) -include_directories(../../3rd-party/liblc3codec/TestSupport) +include_directories(../../3rd-party/lc3-google/include) include_directories(../../3rd-party/lwip/core/src/include) include_directories(../../3rd-party/lwip/dhcp-server) include_directories(../../3rd-party/rijndael) @@ -107,13 +102,7 @@ file(GLOB SOURCES_RIJNDAEL "../../3rd-party/rijndael/rijndael.c") file(GLOB SOURCES_POSIX "../../platform/posix/*.c") file(GLOB SOURCES_MAIN "main.c") file(GLOB SOURCES_ZEPHYR "../../chipset/zephyr/*.c") - -file(GLOB LC3_COMMON "../../3rd-party/liblc3codec/Common/*.cpp") -file(GLOB LC3_TABLES "../../3rd-party/liblc3codec/Common/Tables/*.cpp") -file(GLOB LC3_DECODER "../../3rd-party/liblc3codec/Decoder/*.cpp") -file(GLOB LC3_ENCODER "../../3rd-party/liblc3codec/Encoder/*.cpp") - -set (SOURCES_LC3 ${LC3_COMMON} ${LC3_TABLES} ${LC3_DECODER} ${LC3_ENCODER} ${LC3_TESTSUPPORT}) +file(GLOB SOURCES_LC3_GOOGLE "../../3rd-party/lc3-google/src/*.c") file(GLOB SOURCES_BLE_OFF "../../src/ble/le_device_db_memory.c") list(REMOVE_ITEM SOURCES_BLE ${SOURCES_BLE_OFF}) @@ -124,7 +113,7 @@ list(REMOVE_ITEM SOURCES_POSIX ${SOURCES_POSIX_OFF}) set(SOURCES ${SOURCES_MD5} ${SOURCES_YXML} - ${SOURCES_LC3} + ${SOURCES_LC3_GOOGLE} ${SOURCES_POSIX} ${SOURCES_MAIN} ${SOURCES_RIJNDAEL} diff --git a/test/le_audio/btstack_config.h b/test/le_audio/btstack_config.h index 3effa6f93..555dedae3 100644 --- a/test/le_audio/btstack_config.h +++ b/test/le_audio/btstack_config.h @@ -11,7 +11,6 @@ #define HAVE_MALLOC #define HAVE_POSIX_FILE_IO #define HAVE_POSIX_TIME -#define HAVE_LC3_EHIMA // BTstack features that can be enabled #define ENABLE_ATT_DELAYED_RESPONSE diff --git a/test/le_audio/le_audio_broadcast_sink.c b/test/le_audio/le_audio_broadcast_sink.c index 15c8f4621..660a2c1c8 100644 --- a/test/le_audio/le_audio_broadcast_sink.c +++ b/test/le_audio/le_audio_broadcast_sink.c @@ -67,7 +67,7 @@ #include "hci.h" #include "hci_cmd.h" #include "btstack_lc3.h" -#include "btstack_lc3_ehima.h" +#include "btstack_lc3_google.h" #include "wav_util.h" // max config @@ -152,7 +152,7 @@ static uint8_t num_bis; // lc3 decoder static const btstack_lc3_decoder_t * lc3_decoder; -static lc3_decoder_ehima_t decoder_contexts[MAX_NUM_BIS]; +static btstack_lc3_decoder_google_t decoder_contexts[MAX_NUM_BIS]; static int16_t pcm[MAX_NUM_BIS * MAX_SAMPLES_PER_FRAME]; // playback @@ -216,8 +216,8 @@ static void open_lc3_file(void) { static void setup_lc3_decoder(void){ uint8_t channel; for (channel = 0 ; channel < num_bis ; channel++){ - lc3_decoder_ehima_t * decoder_context = &decoder_contexts[channel]; - lc3_decoder = lc3_decoder_ehima_init_instance(decoder_context); + btstack_lc3_decoder_google_t * decoder_context = &decoder_contexts[channel]; + lc3_decoder = btstack_lc3_decoder_google_init_instance(decoder_context); lc3_decoder->configure(decoder_context, sampling_frequency_hz, frame_duration); } number_samples_per_frame = lc3_decoder->get_number_samples_per_frame(&decoder_contexts[0]); diff --git a/test/le_audio/le_audio_broadcast_source.c b/test/le_audio/le_audio_broadcast_source.c index 18f7e583b..bf8cacde7 100644 --- a/test/le_audio/le_audio_broadcast_source.c +++ b/test/le_audio/le_audio_broadcast_source.c @@ -55,7 +55,7 @@ #include "hci_cmd.h" #include "hci_dump.h" #include "btstack_lc3.h" -#include "btstack_lc3_ehima.h" +#include "btstack_lc3_google.h" #include "hxcmod.h" #include "mods/mod.h" @@ -241,7 +241,7 @@ static uint8_t num_bis = 1; // lc3 encoder static const btstack_lc3_encoder_t * lc3_encoder; -static lc3_encoder_ehima_t encoder_contexts[MAX_NUM_BIS]; +static btstack_lc3_encoder_google_t encoder_contexts[MAX_NUM_BIS]; static int16_t pcm[MAX_NUM_BIS * MAX_SAMPLES_PER_FRAME]; static uint32_t time_generation_ms; @@ -348,8 +348,8 @@ static void print_config(void) { static void setup_lc3_encoder(void){ uint8_t channel; for (channel = 0 ; channel < num_bis ; channel++){ - lc3_encoder_ehima_t * context = &encoder_contexts[channel]; - lc3_encoder = lc3_encoder_ehima_init_instance(context); + btstack_lc3_encoder_google_t * context = &encoder_contexts[channel]; + lc3_encoder = btstack_lc3_encoder_google_init_instance(context); lc3_encoder->configure(context, sampling_frequency_hz, frame_duration); } number_samples_per_frame = lc3_encoder->get_number_samples_per_frame(&encoder_contexts[0]); diff --git a/test/le_audio/le_audio_unicast_sink.c b/test/le_audio/le_audio_unicast_sink.c index 5c30f6007..a056e547b 100644 --- a/test/le_audio/le_audio_unicast_sink.c +++ b/test/le_audio/le_audio_unicast_sink.c @@ -69,7 +69,7 @@ #include "hci.h" #include "hci_cmd.h" #include "btstack_lc3.h" -#include "btstack_lc3_ehima.h" +#include "btstack_lc3_google.h" #include "wav_util.h" // max config @@ -155,7 +155,7 @@ static uint8_t num_channels; // lc3 decoder static const btstack_lc3_decoder_t * lc3_decoder; -static lc3_decoder_ehima_t decoder_contexts[MAX_CHANNELS]; +static btstack_lc3_decoder_google_t decoder_contexts[MAX_CHANNELS]; static int16_t pcm[MAX_CHANNELS * MAX_SAMPLES_PER_FRAME]; // playback @@ -219,8 +219,8 @@ static void open_lc3_file(void) { static void setup_lc3_decoder(void){ uint8_t channel; for (channel = 0 ; channel < num_channels ; channel++){ - lc3_decoder_ehima_t * decoder_context = &decoder_contexts[channel]; - lc3_decoder = lc3_decoder_ehima_init_instance(decoder_context); + btstack_lc3_decoder_google_t * decoder_context = &decoder_contexts[channel]; + lc3_decoder = btstack_lc3_decoder_google_init_instance(decoder_context); lc3_decoder->configure(decoder_context, sampling_frequency_hz, frame_duration); } number_samples_per_frame = lc3_decoder->get_number_samples_per_frame(&decoder_contexts[0]); diff --git a/test/le_audio/le_audio_unicast_source.c b/test/le_audio/le_audio_unicast_source.c index 0cd5810aa..5b542446a 100644 --- a/test/le_audio/le_audio_unicast_source.c +++ b/test/le_audio/le_audio_unicast_source.c @@ -57,7 +57,7 @@ #include "hci_cmd.h" #include "hci_dump.h" #include "btstack_lc3.h" -#include "btstack_lc3_ehima.h" +#include "btstack_lc3_google.h" #include "hxcmod.h" #include "mods/mod.h" @@ -158,7 +158,7 @@ static uint8_t num_channels = 1; // lc3 encoder static const btstack_lc3_encoder_t * lc3_encoder; -static lc3_encoder_ehima_t encoder_contexts[MAX_CHANNELS]; +static btstack_lc3_encoder_google_t encoder_contexts[MAX_CHANNELS]; static int16_t pcm[MAX_CHANNELS * MAX_SAMPLES_PER_FRAME]; static uint32_t time_generation_ms; @@ -265,8 +265,8 @@ static void print_config(void) { static void setup_lc3_encoder(void){ uint8_t channel; for (channel = 0 ; channel < num_channels ; channel++){ - lc3_encoder_ehima_t * context = &encoder_contexts[channel]; - lc3_encoder = lc3_encoder_ehima_init_instance(context); + btstack_lc3_encoder_google_t * context = &encoder_contexts[channel]; + lc3_encoder = btstack_lc3_encoder_google_init_instance(context); lc3_encoder->configure(context, sampling_frequency_hz, frame_duration); } number_samples_per_frame = lc3_encoder->get_number_samples_per_frame(&encoder_contexts[0]);