29 #define ORDER_METHOD_EST 0
30 #define ORDER_METHOD_2LEVEL 1
31 #define ORDER_METHOD_4LEVEL 2
32 #define ORDER_METHOD_8LEVEL 3
33 #define ORDER_METHOD_SEARCH 4
34 #define ORDER_METHOD_LOG 5
36 #define MIN_LPC_ORDER 1
37 #define MAX_LPC_ORDER 32
91 int max_order,
int precision,
94 int omethod,
int max_shift,
int zero_shift);
111 #ifdef LPC_USE_DOUBLE
112 #define LPC_TYPE double
114 #define LPC_TYPE float
128 for (i = 0; i < max_order; i++)
129 gen0[i] = gen1[i] = autoc[i + 1];
132 ref[0] = -gen1[0] / err;
133 err += gen1[0] * ref[0];
136 for (i = 1; i < max_order; i++) {
137 for (j = 0; j < max_order - i; j++) {
138 gen1[j] = gen1[j + 1] + ref[i - 1] * gen0[j];
139 gen0[j] = gen1[j + 1] * ref[i - 1] + gen0[j];
141 ref[i] = -gen1[0] / err;
142 err += gen1[0] * ref[i];
153 LPC_TYPE *lpc,
int lpc_stride,
int fail,
165 if (fail && (autoc[max_order - 1] == 0 || err <= 0))
168 for(i=0; i<max_order; i++) {
173 r -= lpc_last[j] * autoc[i-j-1];
176 err *= 1.0 - (r *
r);
181 for(j=0; j < (i+1)>>1; j++) {
185 lpc[i-1-j] = b + r * f;