commit | f00872c222f42dd4c90dfff523eb2d0cacd1b6af | [log] [tgz] |
---|---|---|
author | David Duarte <licorne@google.com> | Wed Sep 06 02:37:33 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Sep 06 02:37:33 2023 +0000 |
tree | fc3b2c570275191ff43e45b6837ca6eba5394f63 | |
parent | dfc4377d0927be8f726a91d0073b21d50feaa104 [diff] | |
parent | cc8cb8411d4603e7b9a50a776bedf753fb8c3e63 [diff] |
Add Android.bp am: ef58cc944e am: a61c863b77 am: cc8cb8411d Original change: https://android-review.googlesource.com/c/platform/external/liblc3/+/2709218 Change-Id: Icbde5225cea0a790faec8d6d0f992542505ca790 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
The LC3 is an efficient low latency audio codec.
Low Complexity Communication Codec
The directory layout is as follows :
The default toolchain used is GCC. Invoke make
to build the library.
$ make -j
Compiled library liblc3.a
will be found in bin
directory.
The cc, as, ld and ar can be selected with respective Makefile variables CC
, AS
, LD
and AR
. The AS
and LD
selections are optionnal, and fallback to CC
selection when not defined.
The LIBC
must be set to bionic
for android cross-compilation. This switch prevent link with pthread
and rt
libraries, that is included in the bionic libc.
Following example build for android, using NDK toolset.
$ make -j CC=path_to_android_ndk_prebuilt/toolchain-prefix-clang LIBC=bionic
Compiled library will be found in bin
directory.
Tools can be all compiled, while involking make
as follows :
$ make tools
The standalone encoder elc3
take a wave
file as input and encode it according given parameter. The LC3 binary file format used is the non standard format described by the reference encoder / decoder tools. The standalone decoder dlc3
do the inverse operation.
Refer to elc3 -h
or dlc3 -h
for options.
Note that elc3
output bitstream to standard output when output file is omitted. On the other side dlc3
read from standard input when input output file are omitted. In such way you can easly test encoding / decoding loop with :
$ ./elc3 <in.wav> -b <bitrate> | ./dlc3 > <out.wav>
Adding Linux aplay
tools, you will be able to instant hear the result :
$ ./elc3 <in.wav> -b <bitrate> | ./dlc3 | aplay
A python implementation of the encoder is provided in test
diretory. The C implementation is unitary validated against this implementation and intermediate values given in Appendix C of the specification.
# apt install python3 python3-dev python3-pip $ pip3 install scipy numpy
$ make test
Roundtrip fuzz testing harness is available in fuzz
directory. LLVM clang
and clang++
compilers are needed to run fuzzing.
The encoder and decoder fuzzers can be run, for 1 million iterations, using target respectively dfuzz
and efuzz
. The fuzz
target runs both.
$ make efuzz # Run encoder fuzzer for 1M iteration $ make dfuzz # Run decoder fuzzer for 1M iteration $ make fuzz -j # Run encoder and decoder fuzzers in parallel
The implementation is qualified under the QDID 194161 as part of Google Fluoride 1.5.
For more detail on conformance, refer to Bluetooth Conformance Documents and scripts
The codec was here subjectively evaluated in a blind listening test.
Meson build system is also available to build and install lc3 codec in Linux environment.
$ meson build
$ cd build
$ ninja
$ sudo ninja install