Skip to content

Commit

Permalink
lc3: Moved LC3
Browse files Browse the repository at this point in the history
Moved LC3 from separate repo to sdk-nrfxlib

Signed-off-by: Kristoffer Rist Skøien <kristoffer.skoien@nordicsemi.no>
  • Loading branch information
koffes committed Sep 8, 2022
1 parent ee0d1c6 commit 0427c8e
Show file tree
Hide file tree
Showing 20 changed files with 2,562 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ add_subdirectory_ifdef(CONFIG_NRF_RPC nrf_rpc)
add_subdirectory_ifdef(CONFIG_ZIGBEE zboss)
add_subdirectory_ifdef(CONFIG_GZLL gzll)
add_subdirectory_ifdef(CONFIG_NRF_DM nrf_dm)
add_subdirectory_ifdef(CONFIG_SW_CODEC_LC3_T2_SOFTWARE lc3)
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ doc/* @b-gent
/zephyr/ @carlescufi
/nrf_rpc/ @doki-nordic @KAGA164
/nrf_dm/ @Tschet1 @eriksandgren
/lc3/ @koffes @alexsven
1 change: 1 addition & 0 deletions Kconfig.nrfxlib
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ rsource "openthread/Kconfig"
rsource "nrf_802154/zephyr/Kconfig.nrfxlib"
rsource "gzll/Kconfig"
rsource "nrf_dm/Kconfig"
rsource "lc3/Kconfig"

endmenu
24 changes: 24 additions & 0 deletions lc3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright (c) 2022 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

zephyr_sources(
src/sw_codec_lc3.c
platform/os/baremetal/src/osal.c
)

zephyr_include_directories(
codec/inc
platform/os/inc
platform/os/baremetal/inc
include
)

nrfxlib_calculate_lib_path(LC3_LIB_DIR SOC_MODE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
if(NOT LC3_LIB_DIR)
message(WARNING "This combination of SoC and floating point ABI is not supported by the LC3 lib.")
endif()

target_link_libraries(app PRIVATE ${LC3_LIB_DIR}/libLC3.a)
114 changes: 114 additions & 0 deletions lc3/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#
# Copyright (c) 2022 Nordic Semiconductor ASA
#
# All rights reserved.
#
# SPDX-License-Identifier: Nordic-5-Clause
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form, except as embedded into a Nordic
# Semiconductor ASA integrated circuit in a product or a software update for
# such product, must reproduce the above copyright notice, this list of
# conditions and the following disclaimer in the documentation and/or other
# materials provided with the distribution.
#
# 3. Neither the name of Nordic Semiconductor ASA nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# 4. This software, with or without modification, must only be used with a
# Nordic Semiconductor ASA integrated circuit.
#
# 5. Any software provided in binary form under this license must not be
# reverse engineered, decompiled, modified and/or disassembled.
#
# THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

config SW_CODEC_LC3_T2_SOFTWARE
bool "Select the T2 Software LC3 codec"
depends on FP_HARDABI

config LC3_PLC_DISABLED
bool "Override the decoded frame with zeroes if PLC was applied"
default n

config LC3_ENC_CHAN_MAX
int "Max number of encoder channels"
default 1

config LC3_DEC_CHAN_MAX
int "Max number of decoder channels"
default 1

menu "Encoder sample rates"

config LC3_ENC_SAMPLE_RATE_8KHZ_SUPPORT
bool "Support encoding 8 kHz"
default y

config LC3_ENC_SAMPLE_RATE_16KHZ_SUPPORT
bool "Support encoding 16 kHz"
default y

config LC3_ENC_SAMPLE_RATE_24KHZ_SUPPORT
bool "Support encoding 24 kHz"
default y

config LC3_ENC_SAMPLE_RATE_32KHZ_SUPPORT
bool "Support encoding 32 kHz"
default y

config LC3_ENC_SAMPLE_RATE_441KHZ_SUPPORT
bool "Support encoding 44.1 kHz"
default y

config LC3_ENC_SAMPLE_RATE_48KHZ_SUPPORT
bool "Support encoding 48 kHz"
default y

endmenu #Encoder sample rates

#----------------------------------------------------------------------------#
menu "Decoder sample rates"

config LC3_DEC_SAMPLE_RATE_8KHZ_SUPPORT
bool "Support decoding 8 kHz"
default y

config LC3_DEC_SAMPLE_RATE_16KHZ_SUPPORT
bool "Support decoding 16 kHz"
default y

config LC3_DEC_SAMPLE_RATE_24KHZ_SUPPORT
bool "Support decoding 24 kHz"
default y

config LC3_DEC_SAMPLE_RATE_32KHZ_SUPPORT
bool "Support decoding 32 kHz"
default y

config LC3_DEC_SAMPLE_RATE_441KHZ_SUPPORT
bool "Support decoding 44.1 kHz"
default y

config LC3_DEC_SAMPLE_RATE_48KHZ_SUPPORT
bool "Support decoding 48 kHz"
default y

endmenu #Decoder sample rates
8 changes: 8 additions & 0 deletions lc3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2022 Nordic Semiconductor ASA

Scope. LC3 library
----------------------
- LC3 Library: delivered as .a library format
- The - LC3 Library - contain BT5.2 compliant codec (QDID: 156294)
- Terms and Conditions for LC3
- For the terms and conditions, see license.txt
Loading

0 comments on commit 0427c8e

Please sign in to comment.