[Flac-dev] floating point
Christopher Key
cjk32 at cam.ac.uk
Fri Aug 7 08:16:48 PDT 2009
Didier Dambrin wrote:
> Hi,
>
> I've tried to find info about unofficial 32bit float support in FLAC, and found several conversations.
> Most of them were talking about a 24bit limit, but from the manual I guess that this limitation is gone, as it supports up to 32bit integer.
>
> So my question is, what would be the best way, or what is a common way to FLAC-encode floating point audio?
>
>
> The first idea is obvious, we have a 32bit float, FLAC supports 32bit integer, and it's lossless. So I'd just make it encode 32bit float, it's lossless afterall.
> 2 problems, first I would suspect it wouldn't encode very well, since the data wouldn't be "audio" anymore, right? It would be like trying to FLAC-encode random data.
I suspect FLAC may perform somewhat better doing this than it would
compressing purely random data. If you plot floating point numbers
against their binary representation interpreted as a (big endian) signed
integer, I believe the resulting line will vary monotonically, apart
from a discontinuity at zero. This should mean that the data still
looks a bit like audio to FLAC, and that it will still compress
reasonably well.
Christopher Key
More information about the Flac-dev
mailing list