Skip to content

AnmiTaliDev/crystal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crystal Audio Codec — Specification 1.0

Crystal is a scalable lossless audio codec designed for real-time wireless audio over Bluetooth. It delivers bit-perfect lossless audio when the channel permits, and degrades gracefully to perceptually transparent lossy audio under interference — never to silence, glitches, or dropouts.


Key Properties

Property Value
Architecture Two-layer: lossy base + lossless enhancement residual
Lossless mode Bit-perfect at 0–2% packet loss
Lossy mode Perceptually transparent at up to 20% packet loss
Latency ≤ 20 ms algorithmic (encode + decode)
Decode complexity ≤ 40 MIPS on ARM Cortex-M4
Compression 1.5:1 – 2.5:1 (lossless); base layer ~320 kbps
Patent status All techniques public domain or prior art
License GPLv3+ / CC BY-SA 4.0

Specification Quick Navigation

Topic File
Design goals and patent avoidance spec/01-introduction.md
Two-layer architecture diagram spec/02-architecture.md
MDCT, psychoacoustic model, Huffman coding spec/03-base-layer.md
Lossless residual, LPC, Rice coding spec/04-enhancement-layer.md
Reed-Solomon FEC, interleaving, adaptive bitrate spec/05-wireless-resilience.md
Bitstream format (superframe, transport packet) spec/06-stream-format.md
Encoder profiles (wireless / low-latency / archival) spec/07-encoder-profiles.md
Decoder state machine spec/08-decoder.md
Street-condition performance vs aptX Lossless spec/09-scenarios.md
Conformance requirements spec/14-conformance.md

Formal Verification Summary

Theorem Property Status
1 Lossless reconstruction (both layers present) Proven
2 Mid-Side stereo invertibility Proven
3 LPC residual bounded bit width Proven
4 Rice coding bijectivity Proven
5 RS erasure recovery capacity Proven (classical)
6 Convolutional interleaving burst protection Proven
7 UEP probability bounds (exact binomial) Proven
8 Crystal > aptX Lossless under independent loss Proven (all p ≤ 0.25)
9 Crystal > aptX Lossless under burst loss Proven (Gilbert-Elliott)
10 Adaptive FEC allocation optimality Proven (convex optimization)
11 Concealment continuity and energy decay Proven

Full proofs: formal/


License

The Crystal specification is released under the Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0).

The reference implementation is GNU GPLv3+. All contributors waive patent claims under GPLv3 Section 11. No patents. No royalties. No CLA required.

About

Crystal is a scalable lossless audio codec designed for real-time wireless audio over Bluetooth.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors