Somehow I forgot to hit submit on this hours ago. Here it now, out of time.

Originally Posted By: audiosavant
There's a lot of debate about whether Apple lossless really is lossless! I'm thinking that any compressed format is compromised... but on the other hand, I'm very intrigued by Flac files.


Really? I've never seen any debate (but I don't follow Apple news that closely). As long as a codec's input equals it's output, then it is lossless. I prefer FLAC (because it is open), but there's more than one way to remove the redundancies from digital data in such a way it can be restored.

Do you find Zip files, RAR, LHA, etc compromised? There's been decades of research showing that it is entirely mathematically possible to store data with patterns (i.e. not truly random) in less space.

Complex compression routines are difficult to explain. But RLE is simple. Though, it wouldn't work too well for audio, unless you're in the habit of listening to low frequency square waves. But I'll use that as an example.

Say you're using a sampling rate of 10 kHz with a bit depth of 1, and you're trying to store PCM samples of a 1 kHz square wave. 1 is the speaker pushing out, and 0 is the speaker pulling in. The signal would look like this:

0000000000111111111100000000001111111111

Using RLE (run length encoding), you'd use a system to store the first sample, and then the "run" of how many identical samples follow. So the lossless encode would look like:

0R10,1R10,0R10,1R10

What took 40 characters to store before now only takes 19. That's better than 2:1 compression (in this highly contrived example).

All lossless schemes work with the same basic premise. Come up with a way of detecting redundancies, or patterns in the data, and then use an encoding system that takes less space to represent that information.

One note: In truly random data, there will be no patterns, so the overhead of storing the file inside a container will make it larger than the original.

A more interesting note: The same can be said for a file that already has had its redundancies removed. Even if it is with a less superior method. Like if you take an uncompressed BMP file and put it inside a Zip, it'll shrink quite a lot. But if you RLE encode that BMP first, and then try to Zip it, you'll have a larger file than with the first try.

Last edited by ClubNeon; 01/29/11 06:02 AM.

Pioneer PDP-5020FD, Marantz SR6011
Axiom M5HP, VP160HP, QS8
Sony PS4, surround backs
-Chris