I've just recently gotten into all these different kinds of lossless codecs and I'm fascinated by how they work.
I understand that codecs like FLAC and TTA make a prediction for the next sample and then simply store the difference between the prediction and the actual value - which is most of the time significantly smaller than storing the full amplitude.
My question is.. does it only store that difference value? Or is it having to store the prediction model/function/curve or whatever was used for that particular chunk of data. If it's only storing the difference, and that difference is usually a very small number, then shouldnt compression ratios be much better than 2:1 or 3:1?
Maybe I havent fully understood how this stuff works, anyone able to shed a bit of light on it for me? Thanks.
FLAC and related codecs do store the prediction model (an LPC filter), also called forwards prediction.
However, that only takes a relatively low amount of bytes. The problem is that the prediction mostly a bit off, but the amount by which it is off is very random, so the error cannot be compressed that well.
Monkey's Audio and WavPack use another system, in which they predict based on the previous decoded samples (backwards prediction). This means that you dont have to store the predictor, but it will also be a bit less accurate which means bigger prediction errors.
Following info is for completeness. Current lossless codecs are more advanced that this.
Codecs that *only* store the difference are called delta codecs. both, the coding and decoding is pretty simple (just a sum or a difference), and they aren't much efficient in compression. Storing just the difference would actually require one more bit for each sample, not less! To compress, they store just the needed number of bits to represent that value, but here is the drawback: you need a way to tell the decoder how many bits you're storing, and of course, this goes in the compressed data.
,Feb 15 2006, 09:56 PM]Following info is for completeness.
[a href="index.php?act=findpost&pid=364592"][{POST_SNAPBACK}][/a]
Actually I don't see what it has to do with anything, other than confuse matters. Lossless codecs simply don't work like that at all.
Thanks for the info, I'm studying music tech software development, and lossless compression for audio is something i want to research for my final year. I'm thinking of working at my own form of prediction-difference methods but I also want to try and attack this whole issue from another angle. For now I'm just gonna heavily investigate whats currently going on this field. I may be back for more questions!
Thanks again.
see also http://flac.sourceforge.net/format.html (http://flac.sourceforge.net/format.html)
For MAC, this page is available.
http://www.monkeysaudio.com/theory.html (http://www.monkeysaudio.com/theory.html)
Some more material for reading :
TTA: http://www.true-audio.com/codec.theory/ (http://www.true-audio.com/codec.theory/)
LA: http://www.lossless-audio.com/theory.htm (http://www.lossless-audio.com/theory.htm)
WV 3.2: http://www.wavpack.com/technical.htm (http://www.wavpack.com/technical.htm)
UED77