IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
What does FLAC actually store?, How does the compression work?
MistryMan
post Feb 15 2006, 18:00
Post #1





Group: Members
Posts: 2
Joined: 15-February 06
Member No.: 27779



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.
Go to the top of the page
+Quote Post
Garf
post Feb 15 2006, 20:08
Post #2


Server Admin


Group: Admin
Posts: 4883
Joined: 24-September 01
Member No.: 13



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.
Go to the top of the page
+Quote Post
[JAZ]
post Feb 15 2006, 20:56
Post #3





Group: Members
Posts: 1762
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383



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.
Go to the top of the page
+Quote Post
Garf
post Feb 15 2006, 21:09
Post #4


Server Admin


Group: Admin
Posts: 4883
Joined: 24-September 01
Member No.: 13



QUOTE ([JAZ)
,Feb 15 2006, 09:56 PM]Following info is for completeness.
*


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.

This post has been edited by Garf: Feb 15 2006, 21:15
Go to the top of the page
+Quote Post
MistryMan
post Feb 19 2006, 21:01
Post #5





Group: Members
Posts: 2
Joined: 15-February 06
Member No.: 27779



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.
Go to the top of the page
+Quote Post
jcoalson
post Feb 20 2006, 01:41
Post #6


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



see also http://flac.sourceforge.net/format.html
Go to the top of the page
+Quote Post
Shade[ST]
post Feb 20 2006, 03:09
Post #7





Group: Members
Posts: 1189
Joined: 19-May 05
From: Montreal, Canada
Member No.: 22144



For MAC, this page is available.

http://www.monkeysaudio.com/theory.html
Go to the top of the page
+Quote Post
UED77
post Feb 20 2006, 05:38
Post #8





Group: Members
Posts: 41
Joined: 12-February 06
Member No.: 27709



Some more material for reading smile.gif :

TTA: http://www.true-audio.com/codec.theory/
LA: http://www.lossless-audio.com/theory.htm
WV 3.2: http://www.wavpack.com/technical.htm

UED77


--------------------
UED77
wavpack 4.50 -hx3; lame 3.97 -V4 --vbr-new
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 28th July 2014 - 15:05