From 5d2f52b98980fd49c3d1f35a742912f7952262b0 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 2 Jul 2006 13:10:08 +0000 Subject: [PATCH] simplify Originally committed as revision 5576 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/flacenc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 9259d0fc28..1a06cd07bb 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -649,7 +649,7 @@ static void quantize_lpc_coefs(double *lpc_in, int order, int precision, int32_t *lpc_out, int *shift) { int i; - double d, cmax; + double cmax; int32_t qmax; int sh; @@ -659,18 +659,13 @@ static void quantize_lpc_coefs(double *lpc_in, int order, int precision, /* find maximum coefficient value */ cmax = 0.0; for(i=0; i cmax) - cmax = d; + cmax= FFMAX(cmax, fabs(lpc_in[i])); } /* if maximum value quantizes to zero, return all zeros */ if(cmax * (1 << MAX_LPC_SHIFT) < 1.0) { *shift = 0; - for(i=0; i