changeset 7593:9687dcb225e9 libavcodec

use range of lpc orders in ORDER_METHOD_EST
author jbr
date Sat, 16 Aug 2008 21:39:09 +0000
parents 377fddcc6288
children cd6217c9ce92
files lpc.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lpc.c	Sat Aug 16 21:32:03 2008 +0000
+++ b/lpc.c	Sat Aug 16 21:39:09 2008 +0000
@@ -117,12 +117,12 @@
     *shift = sh;
 }
 
-static int estimate_best_order(double *ref, int max_order)
+static int estimate_best_order(double *ref, int min_order, int max_order)
 {
     int i, est;
 
-    est = 1;
-    for(i=max_order-1; i>=0; i--) {
+    est = min_order;
+    for(i=max_order-1; i>=min_order-1; i--) {
         if(ref[i] > 0.10) {
             est = i+1;
             break;
@@ -192,7 +192,7 @@
     opt_order = max_order;
 
     if(omethod == ORDER_METHOD_EST) {
-        opt_order = estimate_best_order(ref, max_order);
+        opt_order = estimate_best_order(ref, min_order, max_order);
         i = opt_order-1;
         quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift);
     } else {