This project provides the minimp3 MP1/MP2/MP3 decoder optimized for Nuclei CPUs.
The source code comes from the upstream lieff/minimp3 project.
| Directory | Description |
|---|---|
| data | test data, generated headers, and helper scripts |
| minimp3.h | core decoder implementation |
| minimp3_ex.h | extended streaming and file decoding interfaces |
| minimp3_test.c | test and benchmark entry |
Please refer to the Prerequests section in the parent directory's README.
Switch to the directory containing the Makefile.
Below are build examples for the Nuclei N900 CPU.
Build without extension:
make CORE=n900 ARCH_EXT= allBuild with B and P extension:
make CORE=n900 ARCH_EXT=_zba_zbb_zbc_zbs_xxldspn1x allBuild with a specific test pattern:
make CORE=n900 PATTERN=1 allWhen PATTERN is not specified, the build uses the pre-generated test data in
data/. When PATTERN is set, the build regenerates bit_input.h,
pcm_output.h, and args.h before compiling.
For details about Nuclei CPU architecture extensions, see the ARCH_EXT section in the Nuclei SDK documentation.
The test program compares decoded PCM output against reference data embedded in the build. A helper script is provided to switch among the bundled test patterns:
To view usage details:
./data/bin/gendata.sh -hTo generate data from a specific pattern line in pattern.txt:
./data/bin/gendata.sh -p 1The script updates:
data/bit_input.h: embedded MP3 bitstream inputdata/pcm_output.h: embedded PCM reference outputdata/args.h: default decode command arguments
A typical output looks like this:
Nuclei SDK Build Time: Sep 29 2025, 09:40:40
Download Mode: DDR
CPU Frequency 50303907 Hz
CPU HartID: 0
rate=44100 samples=4608 max_diff=0 PSNR=99.000000
PASSThe key validation metric is PSNR. The test is considered successful when
the decoded PCM matches the embedded reference closely enough and the program
prints PASS.
The PATTERN build variable can be used to benchmark multiple bundled vectors.
The CI configuration currently covers a large set of patterns from
data/bin/pattern.txt.