# HG changeset patch # User michael # Date 1153007018 0 # Node ID fa545ed305c99286ebb2ca527490286aec71d84d # Parent 0e0cffe06fb3e9dacb173f82d5fe7cfb90e7e445 calculate all coefficients for several orders during cholesky factorization, the resulting coefficients are not strictly optimal though as there is a small difference in the autocorrelation matrixes which is ignored for the smaller orders diff -r 0e0cffe06fb3 -r fa545ed305c9 flacenc.c --- a/flacenc.c Fri Jul 14 19:31:58 2006 +0000 +++ b/flacenc.c Sat Jul 15 23:43:38 2006 +0000 @@ -742,35 +742,41 @@ compute_autocorr(samples, blocksize, max_order+1, autoc); compute_lpc_coefs(autoc, max_order, lpc, ref); - - opt_order = estimate_best_order(ref, max_order); }else{ LLSModel m[2]; - double var[MAX_LPC_ORDER+1], eval; + double var[MAX_LPC_ORDER+1], eval, weight; for(pass=0; pass>pass) + fabs(eval - var[0]); for(j=0; j<=max_order; j++) var[j]/= sqrt(eval); - } + weight += 1/eval; + }else + weight++; av_update_lls(&m[pass&1], var, 1.0); } - av_solve_lls(&m[pass&1], 0.001); - opt_order= max_order; //FIXME + av_solve_lls(&m[pass&1], 0.001, 0); } - for(i=0; i0; i--) + ref[i] = ref[i-1] - ref[i]; } + opt_order = estimate_best_order(ref, max_order); i = opt_order-1; quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i]);