Skip to main content

Topic: What does FLAC actually store? (Read 4202 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • MistryMan
  • [*]
What does FLAC actually store?
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.

  • Garf
  • [*][*][*][*][*]
  • Developer (Donating)
What does FLAC actually store?
Reply #1
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.

  • [JAZ]
  • [*][*][*][*][*]
What does FLAC actually store?
Reply #2
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.

  • Garf
  • [*][*][*][*][*]
  • Developer (Donating)
What does FLAC actually store?
Reply #3
Quote
,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.
  • Last Edit: 15 February, 2006, 03:15:13 PM by Garf

  • MistryMan
  • [*]
What does FLAC actually store?
Reply #4
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.

  • jcoalson
  • [*][*][*][*][*]
  • Developer
What does FLAC actually store?
Reply #5

  • Shade[ST]
  • [*][*][*][*][*]
What does FLAC actually store?
Reply #6
For MAC, this page is available.

http://www.monkeysaudio.com/theory.html

  • UED77
  • [*]
What does FLAC actually store?
Reply #7
UED77
wavpack 4.50 -hx3; lame 3.97 -V4 --vbr-new