Reply To: Lossless streaming?

March 19, 2023 at 4:22 pm #5525

128 kbits/second is a lotta reduction in information than, say a raw CD (not including redundancy for error correction): 2 ch × 44100 sample/sec × 16 bits/word, which is 1378 kbits/second.  More than 10 times more.

Now, I know about two mathematical processes that have been used for lossless encoding since ca. 1990.  These would be Linear Predictive Coding to make a very good guess at what the next sample value will be, then coding only the difference between the actual sample value and the guess.  If that difference is small, then fewer bits are needed to code it.  And then entropy coding (like Huffman coding) can be used on the LPC difference data.  White noise that’s uniform pdf (essentially what comes out of a good random number generator) will not compress this.

But for bandlimited audio that has a meaningful predictable spectrum, you can maybe cut the required data to a third or a quarter.  So I dunno how else FLAC does it.  They might be bandsplitting like lossy algs do, and I know they separate the sound into independent frames, so all of the analysis and bit-allocation rules happen to a short snippet of audio with no regard to the adjacent snippets of audio.

There is Shannon Information Theory that sets a limit on how much you can losslessly compress something.  And Gerzon and Craven sorta turned it around to say how many dB S/N ratio you can squeeze into a binary data stream.

But FLAC should sound exactly like if you just got the .wav file of the original and played it back through the same hardware and sound system.  Once decoded, they should be exactly the same bits.