From f74471e043c6788a59bf6e8143f71d3968353152 Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Tue, 25 Sep 2007 23:30:29 +0000 Subject: [PATCH] optimize encode_residual_lpc() 37%/45%/90% faster on core2/k8/p4, making flac encoding overall 15%/17%/40% faster at compression_level>=8 (less at low levels). Originally committed as revision 10585 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/flacenc.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 9dd6c7eb87..8dd55eabe0 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -838,17 +838,22 @@ static void encode_residual_lpc(int32_t *res, const int32_t *smp, int n, int order, const int32_t *coefs, int shift) { int i, j; - int32_t pred; for(i=0; i> shift); + p0 += c*smp[i-order]; + res[i+0] = smp[i+0] - (p0 >> shift); + res[i+1] = smp[i+1] - (p1 >> shift); } }