This is the SBC encoder/decoder adapted for the Nuclei CPU.
The origin source code is available here, current version is based on the commit 6e50565.
We designed a sbc_demo to show how to use the SBC codec by encoding/decoding loop. We also encode and decode the same audio data on x86 platform, and compare the results run on Nuclei CPU to ensure the correctness.
| Directory | Description |
|---|---|
| src | libsbc source files |
| include | libsbc public header files |
| data | data manipulation source files and some test results |
Please refer to the Prerequests section in the README.md of parent directory.
First, change to the directory where Makefile is located. We take Nuclei N300 CPU as an example.
To build without extension:
make CORE=n300 ARCH_EXT= allTo build with B and P extension:
make CORE=n300 ARCH_EXT=_zba_zbb_zbc_zbs_xxldspn3x allFor more information about Nuclei CPU Architecture extension, please refer to ARCH_EXT section in Nuclei SDK documentation.
The data for test input is prepared in input.h. The input data is generated from in_1s.wav by xxd tool. The enc.sbc is the encoded output run on x86 platform, and the dec.wav is the decoded output run on x86 platform. We also transfer these two files to enc_sbc.h and dec_wav.h for reference. We compare the results run on Nuclei CPU with the reference output to ensure the correctness.
We record the CPU cycles consumed to encode/decode, and caclulate the average cycles as shown in the following table. To show the performance of Nuclei CPU extensions, we compare the cpu cycles consumed between w/ and w/o extension. For w/o extension, the build option is ARCH_EXT=, for w/ extension, the build option is ARCH_EXT=_zba_zbb_zbc_zbs_xxldspn3x.
Test bitstream: n300_dual_best_config_ku060_16M_7cd945994_18d811786_202408191002.bit
| case | w/o ext (avg cycles) | w/ ext (avg cycles) | speedup ratio |
|---|---|---|---|
| encode | 17806.76 | 16355.42 | 1.09 |
| decode | 17422.02 | 16360.46 | 1.06 |