diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-07-02 13:10:08 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-07-02 13:10:08 +0000 |
commit | 5d2f52b98980fd49c3d1f35a742912f7952262b0 (patch) | |
tree | cbf8c891c65933a80a1804645c228a7bed20dc4e | |
parent | b2e30cb32407a434086f613282c6b1802311b671 (diff) | |
download | ffmpeg-5d2f52b98980fd49c3d1f35a742912f7952262b0.tar.gz |
simplify
Originally committed as revision 5576 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/flacenc.c | 11 |
1 files 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<order; i++) { - d = lpc_in[i]; - if(d < 0) d = -d; - if(d > 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<order; i++) { - lpc_out[i] = 0; - } + memset(lpc_out, 0, sizeof(int32_t) * order); return; } |