-
Notifications
You must be signed in to change notification settings - Fork 0
Home
vbloom-x3 edited this page Oct 4, 2025
·
4 revisions
BLOS is a modern, open-source, efficient audio codec designed for high-quality audio compression with low computational complexity. It combines Linear Predictive Coding (LPC) with Rice coding and innovative transient bypass to achieve good compression ratios while maintaining audio quality.
BLOS is a lossless audio codec that provides:
- High Compression Efficiency: Leverages LPC prediction and Rice coding for compact representation
- Low Computational Complexity: Fast encoding and decoding suitable for real-time applications
- Transient Handling: Smart escape mechanism for handling transients and large residuals
- Stereo Support: Mid/Side (M/S) stereo encoding for better compression
- GCC compiler
- libsndfile development libraries
- Make build system
git clone https://github.com/vbloom-x3/audio-format.git
cd audio-format
make
make install # Optional installation# Encode a WAV file to BLOS format
libblos input.wav output.blos
# Decode a BLOS file back to WAV
libblos -d input.blos output.wavOffset Size Description
0 4 Magic number: "BLOS"
4 4 Sample rate (uint32_t, little-endian)
8 4 Total frames (uint32_t)
12 1 Channels (uint8_t, always 2 for stereo)
13 4 Frame size (uint32_t, typically 512)
17 4 Number of frames (uint32_t)
21 11 Reserved/padding
- Frame Header: Frame size, LPC order, Rice parameters
- Seeds: Initial samples for LPC reconstruction (int16_t)
- Coefficients: Double-precision LPC coefficients
- Residuals: Rice-coded residuals with escape sequences
- Adaptive LPC Order: Automatically selects optimal prediction order (2-16)
- Rice Coding: Efficient residual encoding with adaptive k-parameter
- Transient Bypass: Raw sample storage when residuals exceed threshold
- Mid/Side Stereo: Improved stereo channel correlation
- Frame-Based Processing: 512-sample frames with bit-packing
- Frame Splitting: Input divided into 512-sample frames
- M/S Conversion: Left/Right → Mid/Side channels
- LPC Analysis: Levinson-Durbin algorithm for prediction coefficients
- Residual Calculation: Difference between actual and predicted samples
- Rice Encoding: Efficient residual compression with escape handling
- Bit Packing: Compact binary representation
BLOS is optimized for:
- Fast decoding for real-time playback
- Low memory footprint
- Progressive decoding support
Typical compression percentages are 1-6% depending on content complexity.
# Ubuntu/Debian
sudo apt-get install libsndfile1-dev build-essential
### Compilation
```bash
make # Build the codec
make clean # Clean build artifacts
make install # Install to system (optional)BLOS is released under the GNU GPL v3.0 License - see the LICENSE file for details.