mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
use range of lpc orders in ORDER_METHOD_EST
Originally committed as revision 14796 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
9045f5e72d
commit
81fc8a63c5
@ -117,12 +117,12 @@ static void quantize_lpc_coefs(double *lpc_in, int order, int precision,
|
|||||||
*shift = sh;
|
*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;
|
int i, est;
|
||||||
|
|
||||||
est = 1;
|
est = min_order;
|
||||||
for(i=max_order-1; i>=0; i--) {
|
for(i=max_order-1; i>=min_order-1; i--) {
|
||||||
if(ref[i] > 0.10) {
|
if(ref[i] > 0.10) {
|
||||||
est = i+1;
|
est = i+1;
|
||||||
break;
|
break;
|
||||||
@ -192,7 +192,7 @@ int ff_lpc_calc_coefs(DSPContext *s,
|
|||||||
opt_order = max_order;
|
opt_order = max_order;
|
||||||
|
|
||||||
if(omethod == ORDER_METHOD_EST) {
|
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;
|
i = opt_order-1;
|
||||||
quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift);
|
quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user