[Flac-dev] Building a Rice Encoder/Decoder from FLAC

Ralph Giles giles at xiph.org
Tue Jul 11 16:36:40 PDT 2006

On Tue, Jul 11, 2006 at 04:17:41PM -0700, Mary Amon wrote:

>                                                          Right now, I am
> looking in the src code of libFLAC, (I am looking through stream_encoder.c
> in libFLAC src code), but its really confusing to someone who just learned
> what ./configure meant today.

Well, configure is obfuscating, but that's not really the problem. 

You're on the right track; the rice encode/decode stuff is all
in libFLAC/stream_decoder.c, stream_encoder.c, and 
stream_encoder_framing.c. The decoder routine
read_residual_partitioned_rice_() might be a good place to start.

FLAC is highly modular code with lots of interfaces and abstraction
layers; it takes lots of tracing to follow the flow and sort out
the actual implementation. Keep at it though; it's good practice.

> P.S.  I totally appreciate the very clean code and documentation!  It's
> making the learning much less painful than I think it could be.

Yes, Josh's code is well written, in a C++ sort of way. :-)

Good luck and let us know if you get stuck,

More information about the Flac-dev mailing list