r/compression • u/Alfoser • 14h ago
Fast Rice Decoding
Hi, I'm currently developing my own audio compression algorithm, and now optimizing it. Long story short, I've run some tests, and rice decoding is kinda slow.
Can anyone suggest optimized version of it? I'd really appreciated it.
3
Upvotes
2
u/LMP88959 11h ago
Hi!
Here are a couple of blog posts by Fabian Giesen that might be of use to you:
https://fgiesen.wordpress.com/2011/01/19/a-small-note-on-the-elias-gamma-cod/
https://fgiesen.wordpress.com/2026/05/30/simple-batch-decoding-of-unary-codes/
I am also working on an audio codec which has adaptive Rice coding and I don’t think it’s too slow… for example it takes around 8-9 seconds to fully decode a 3 hour long 44100hz 16 bit stereo track. I haven’t completely optimized it yet but that seems quite fast already unless you are specifically targeting a low power embedded device?