[Flac] audio data encoding in FLAC: how complex ?

porte64 at free.fr porte64 at free.fr
Mon Mar 9 07:53:21 PDT 2009


Hello !

The following algorithm describes Golomb(=Rice?) encoding:
http://en.wikipedia.org/wiki/Golomb_coding#Simple_algorithm

What is unclear to me is how many audio samples
encoded with a fixed parameter (denoted 'M' in the wiki,
which i presume is equivalent to the 'Rice parameter'
invohed here):
http://flac.sourceforge.net/documentation_format_overview.html

But things are a bit more complicated because the wiki says:
"audio codecs [...] use a Rice code after the linear prediction step".
But it does not tell us about how many points/samples get
interpolated, and what criteria are used.

So i guess that in the end, for every frame,
2 points of the interpolating line and a Rice parameter are stored,
and, at each point/sample, the distance to this line is encoded
as a series of residues ?!

On the whole, it *seems* to me that it boils down to simple
operations (after all, it's just basic school arithmetic)
but it's really hard to put all the pieces together and it's a pity
(and may be dangerous for maintenance over years -- where project
poeple may change) that it's not documented besides the source code.

It would enjoy writing a note on the whole process but there are
too many unknowns.
Sorry, i am feeling a bit desperate, having spent several nights
in a row trying to understand the encoding process globally
from the source code.

So if any of you has notes about it, please share !

Phil


More information about the Flac mailing list