-static void lpc_filter(const int16_t *lpc_coefs, const int16_t *adapt_coef,
- void *out, int *statbuf, int len)
-{
- int x, i;
- uint16_t work[50];
- int16_t *ptr = work;
-
- memcpy(work, statbuf,20);
- memcpy(work + 10, adapt_coef, len * 2);
-
- for (i=0; i<len; i++) {
- int sum = 0;
- int new_val;
-
- for(x=0; x<10; x++)
- sum += lpc_coefs[9-x] * ptr[x];
-
- sum >>= 12;
-
- new_val = ptr[10] - sum;
-
- if (new_val < -32768 || new_val > 32767) {
- memset(out, 0, len * 2);
- memset(statbuf, 0, 20);
- return;
- }
-
- ptr[10] = new_val;
- ptr++;
- }
-
- memcpy(out, work+10, len * 2);
- memcpy(statbuf, work + 40, 20);
-}
-
-static unsigned int rescale_rms(int rms, int energy)