summaryrefslogtreecommitdiff
path: root/libavcodec/flacenc.c
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2007-10-01 05:56:30 +0000
committerLoren Merritt <lorenm@u.washington.edu>2007-10-01 05:56:30 +0000
commit286127c5ddd3ab15097cb025e9d18c34f8bbd0a9 (patch)
treefed68d26020bf8907dbeddae7888ca2fa34aa91e /libavcodec/flacenc.c
parent8eb1c1cd5b03b5c53d36583cf87c202e8cad01cb (diff)
div -> mul
Originally committed as revision 10630 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/flacenc.c')
-rw-r--r--libavcodec/flacenc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index d02b3e4626..c0bd830efe 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -770,7 +770,7 @@ static int lpc_calc_coefs(FlacEncodeContext *s,
compute_lpc_coefs(autoc, max_order, lpc, ref);
}else{
LLSModel m[2];
- double var[MAX_LPC_ORDER+1], eval, weight;
+ double var[MAX_LPC_ORDER+1], weight;
for(pass=0; pass<use_lpc-1; pass++){
av_init_lls(&m[pass&1], max_order);
@@ -781,11 +781,14 @@ static int lpc_calc_coefs(FlacEncodeContext *s,
var[j]= samples[i-j];
if(pass){
+ double eval, inv, rinv;
eval= av_evaluate_lls(&m[(pass-1)&1], var+1, max_order-1);
eval= (512>>pass) + fabs(eval - var[0]);
+ inv = 1/eval;
+ rinv = sqrt(inv);
for(j=0; j<=max_order; j++)
- var[j]/= sqrt(eval);
- weight += 1/eval;
+ var[j] *= rinv;
+ weight += inv;
}else
weight++;