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
93 const int32_t *samples,
int blocksize,
int min_order,
94 int max_order,
int precision,
97 int omethod,
int max_shift,
int zero_shift);
100 const int32_t *samples,
int order,
double *ref);
114 #ifdef LPC_USE_DOUBLE
115 #define LPC_TYPE double
117 #define LPC_TYPE float
131 for (i = 0; i < max_order; i++)
132 gen0[i] = gen1[i] = autoc[i + 1];
135 ref[0] = -gen1[0] / err;
136 err += gen1[0] * ref[0];
139 for (i = 1; i < max_order; i++) {
140 for (j = 0; j < max_order - i; j++) {
141 gen1[j] = gen1[j + 1] + ref[i - 1] * gen0[j];
142 gen0[j] = gen1[j + 1] * ref[i - 1] + gen0[j];
144 ref[i] = -gen1[0] / err;
145 err += gen1[0] * ref[i];
156 LPC_TYPE *lpc,
int lpc_stride,
int fail,
168 if (fail && (autoc[max_order - 1] == 0 || err <= 0))
171 for(i=0; i<max_order; i++) {
176 r -= lpc_last[j] * autoc[i-j-1];
179 err *= 1.0 - (r *
r);
184 for(j=0; j < (i+1)>>1; j++) {
188 lpc[i-1-j] = b + r * f;