Revision 81fc8a63 libavcodec/lpc.c

View differences:

libavcodec/lpc.c
117 117
    *shift = sh;
118 118
}
119 119

  
120
static int estimate_best_order(double *ref, int max_order)
120
static int estimate_best_order(double *ref, int min_order, int max_order)
121 121
{
122 122
    int i, est;
123 123

  
124
    est = 1;
125
    for(i=max_order-1; i>=0; i--) {
124
    est = min_order;
125
    for(i=max_order-1; i>=min_order-1; i--) {
126 126
        if(ref[i] > 0.10) {
127 127
            est = i+1;
128 128
            break;
......
192 192
    opt_order = max_order;
193 193

  
194 194
    if(omethod == ORDER_METHOD_EST) {
195
        opt_order = estimate_best_order(ref, max_order);
195
        opt_order = estimate_best_order(ref, min_order, max_order);
196 196
        i = opt_order-1;
197 197
        quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i], max_shift, zero_shift);
198 198
    } else {

Also available in: Unified diff