diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index fb69561010..d02b3e4626 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -876,10 +876,10 @@ static void encode_residual_fixed(int32_t *res, const int32_t *smp, int n, } #define LPC1(x) {\ - int s = smp[i-(x)+1];\ - p1 += c*s;\ - c = coefs[(x)-2];\ + int c = coefs[(x)-1];\ p0 += c*s;\ + s = smp[i-(x)+1];\ + p1 += c*s;\ } static av_always_inline void encode_residual_lpc_unrolled( @@ -888,9 +888,8 @@ static av_always_inline void encode_residual_lpc_unrolled( { int i; for(i=order; i> shift); res[i+1] = smp[i+1] - (p1 >> shift); } @@ -952,16 +952,15 @@ static void encode_residual_lpc(int32_t *res, const int32_t *smp, int n, #ifdef CONFIG_SMALL for(i=order; i> shift); + res[i ] = smp[i ] - (p0 >> shift); res[i+1] = smp[i+1] - (p1 >> shift); } #else