HydrogenAudio

Hydrogenaudio Forum => Scientific Discussion => Topic started by: bryant on 2019-02-23 00:44:13

Title: SLAC - Simple Lossless Audio Compressor
Post by: bryant on 2019-02-23 00:44:13
After dealing with some of the complexities of WavPack, I started to wonder whether it would be possible to create a basic lossless audio compressor in just a few hundred lines that was very easy to understand, really fast and CPU-friendly, and didn't totally suck performance-wise. Something that could be translated into a different language or even implemented in hardware without much effort.

The result is SLAC, and before anyone gets mad, this is not a new or replacement audio compression format. It's just a for-fun project to demonstrate how lossless audio compression works and how simple it can be. There's a little command-line front-end to convert to/from WAV files, but the resulting SLAC files are just for demo...they do not support error checking, metadata or seeking (haha, just like the first WavPack 20 years ago).

And just FYI, it performs in the same ballpark as Shorten or FLAC -0, so there's no threat of anyone adopting it.

Enjoy...  :)

https://github.com/dbry/slac (https://github.com/dbry/slac)
Title: Re: SLAC - Simple Lossless Audio Compressor
Post by: Nick.C on 2019-02-23 13:15:19
Nice one, David. :)

Does it make use of "wasted bits" detection? It does - excellent! :D
Title: Re: SLAC - Simple Lossless Audio Compressor
Post by: Porcus on 2019-02-23 15:34:04
Matches Shorten in features AND - from what I can see - even beats MP3 bitrates on certain material!!!1

;-)
Title: Re: SLAC - Simple Lossless Audio Compressor
Post by: Gryder on 2019-04-08 11:18:16
It beats MP3 bitrates? That's quite impressive! Did you expect that would happen?
Title: Re: SLAC - Simple Lossless Audio Compressor
Post by: ThisInstruction on 2019-04-08 11:44:08
It beats MP3 bitrates? That's quite impressive! Did you expect that would happen?

Even the popular lossless codecs can reach or beat MP3 bitrates. On some content, heck I'm shocked when some noise music reaches 500 ~ 750kbps. One DBC song reached 332kbps on wavpack when i still had it.
 
Title: Re: SLAC - Simple Lossless Audio Compressor
Post by: Porcus on 2019-04-08 13:07:37
It beats MP3 bitrates? That's quite impressive! Did you expect that would happen?

The "!!!1" was there to indicate I was joking. The joke is that it is true "on certain material": MP3 has a minimum bitrate (https://en.wikipedia.org/wiki/MP3#Bit_rate) that lossless encoders easily beat when the source material is silence.