Mercurial > libavcodec.hg
comparison lpc.c @ 7591:7dfb28d3ccd1 libavcodec
use limited range of lpc orders when quantizing coefficients
author | jbr |
---|---|
date | Sat, 16 Aug 2008 21:24:06 +0000 |
parents | d6126c8b57e9 |
children | 377fddcc6288 |
comparison
equal
deleted
inserted
replaced
7590:d6126c8b57e9 | 7591:7dfb28d3ccd1 |
---|---|
133 | 133 |
134 /** | 134 /** |
135 * Calculate LPC coefficients for multiple orders | 135 * Calculate LPC coefficients for multiple orders |
136 */ | 136 */ |
137 int ff_lpc_calc_coefs(DSPContext *s, | 137 int ff_lpc_calc_coefs(DSPContext *s, |
138 const int32_t *samples, int blocksize, int max_order, | 138 const int32_t *samples, int blocksize, int min_order, int max_order, |
139 int precision, int32_t coefs[][MAX_LPC_ORDER], | 139 int precision, int32_t coefs[][MAX_LPC_ORDER], |
140 int *shift, int use_lpc, int omethod, int max_shift, int zero_shift) | 140 int *shift, int use_lpc, int omethod, int max_shift, int zero_shift) |
141 { | 141 { |
142 double autoc[MAX_LPC_ORDER+1]; | 142 double autoc[MAX_LPC_ORDER+1]; |
143 double ref[MAX_LPC_ORDER]; | 143 double ref[MAX_LPC_ORDER]; |
193 if(omethod == ORDER_METHOD_EST) { | 193 if(omethod == ORDER_METHOD_EST) { |
194 opt_order = estimate_best_order(ref, max_order); | 194 opt_order = estimate_best_order(ref, max_order); |
195 i = opt_order-1; | 195 i = opt_order-1; |
196 quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift); | 196 quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift); |
197 } else { | 197 } else { |
198 for(i=0; i<max_order; i++) { | 198 for(i=min_order-1; i<max_order; i++) { |
199 quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift); | 199 quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift); |
200 } | 200 } |
201 } | 201 } |
202 | 202 |
203 return opt_order; | 203 return opt_order; |