[flac-dev] [PATCH] Improve LPC order guess

Martijn van Beurden mvanb1 at gmail.com
Thu Dec 4 00:38:44 PST 2014

Op 04-12-14 om 09:08 schreef Miroslav Lichvar:
> Just curious, is there any explanation why this improves the 
> compression ratio? Is it a bug? 

The error scale is used directly in the calculation of the 
expected bits per residual sample. Substituting the current code 

bps = 0.5 * log(0.5 * M_LN2 * M_LN2 / 
(FLAC__double)total_samples * lpc_error) / M_LN2

which is equivalent to

bps =  0.5 * log(0.5 / (FLAC__double)total_samples * lpc_error) 
/ M_LN2 - 0.23

So, practically, this change increases the expected bits per 
sample by 0.23. Apparently this better estimates the residual 
bits per sample.

I've been experimenting with different values, and it seems 
increasing the bps even further is beneficial for some kinds of 
music, but not for others. This value seems to benefit all kinds 
of sources.

More information about the flac-dev mailing list