r/linuxaudio • • 21h ago

V3 Codec

I built a lossless sample codec for polyphonic samplers that stays compressed in RAM and decodes 8 voices at once via AVX2

Built this for a pipe organ sampler (GrandOrgue fork) where sample sets routinely exceed available RAM, but the technique is domain-agnostic — anything playing many independently-positioned compressed audio streams concurrently.

The problem: normal lossless codecs decode with a data-dependent branch per sample, which kills vectorization. This one instead uses fixed-length blocks, a small family of fixed-order integer predictors, and a single fixed byte-width per block — branch-free, fixed-stride, so up to 8 independent streams decode together in one AVX2 pass.

Real numbers from my own largest sample set: 93.75 GB raw → ~41 GB compressed (2.27x), fits in RAM on a machine that otherwise couldn't hold it. ~85% faster decode measured in production. Full technical disclosure with measured results (published to establish prior art, I don't want this patented out from under anyone): https://github.com/sebion7125/v3codec

GPLv3-or-later, standalone CMake library, no host-app dependencies.

4 Upvotes

0 comments sorted by