[flac-dev] Supporting 32 bit data

Martijn van Beurden mvanb1 at gmail.com
Thu Oct 1 13:22:34 PDT 2015


Op 01-10-15 om 18:14 schreef lvqcl:
> Currently libFLAC stores residual signal as 32-bit signed int. And there
> are the following comments in stream_encoder.c:

The residual is stored as a Golomb/Rice code. As far as I know, 
that is not limited to 32-bit in the format itself, only in the 
implementation.

However, there are two residual coding methods now: rice and 
rice2. rice2 was added when it turned out rice (with a 4 bit 
rice parameter) wasn't able to cope with the larger residuals 
that 24-bit material. It looks like a 5-bit rice parameter is 
enough for 32-bit material as well (highest divisor is 2^30, 
whereas a 4-bit parameter is limited to 2^14), but maybe a rice 
partition with 6 bits has to be added, who knows?

Anyway, I don't think the format is in any way unsupportive of 
32-bit int material, it's just the current implementation of the 
codec.


More information about the flac-dev mailing list