Fix a regression that severely impacted compression levels.
authorErik de Castro Lopo <erikd@mega-nerd.com>
Fri, 12 Oct 2012 11:02:49 +0000 (22:02 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Fri, 12 Oct 2012 11:02:49 +0000 (22:02 +1100)
Regression was introducted in commit 8bbbf56403808ff75126cd0840a936aedbc4113b
(Feb 1 19:58:09 2012) when fixing compiler warnings. In src/libFLAC/lpc.c the
line:

        ref[i] = (r/=err);

was erroniously removed because the left hand side, ref[i] was never used.
Obviously, the correct thing to do was to replace that line with:

        r /= err;

This code has not been officially released. The only people who would have
been affected are people who compiled FLAC from git between February and
now.

The only adverse affect of this error was that compression ratio would have
been severely compromised. No audio is lost, and if anyone has a file that
compressed with a bad version of FLAC can decompress it to WAV and then
re-compress with a fixed version.

src/libFLAC/lpc.c

index f5eaf22..66a6899 100644 (file)
@@ -140,6 +140,7 @@ void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], unsigned *max_o
                r = -autoc[i+1];
                for(j = 0; j < i; j++)
                        r -= lpc[j] * autoc[i-j];
+               r /= err;
 
                /* Update LPC coefficients and total error. */
                lpc[i]=r;