aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/lpc.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2008-08-16 21:39:09 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2008-08-16 21:39:09 +0000
commit81fc8a63c5eed8b151d3035ef6422663ca4cfce4 (patch)
tree086871aa294b4224016fd012f0ed88d30fdb3c03 /libavcodec/lpc.c
parent9045f5e72d6916bd93e0a9b26a8e4a2598fee6f1 (diff)
downloadffmpeg-81fc8a63c5eed8b151d3035ef6422663ca4cfce4.tar.gz
use range of lpc orders in ORDER_METHOD_EST
Originally committed as revision 14796 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/lpc.c')
-rw-r--r--libavcodec/lpc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c
index 8c21a2c4e5..a8971d3c84 100644
--- a/libavcodec/lpc.c
+++ b/libavcodec/lpc.c
@@ -117,12 +117,12 @@ static void quantize_lpc_coefs(double *lpc_in, int order, int precision,
*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 @@ int ff_lpc_calc_coefs(DSPContext *s,
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 {