Make file access in cdr_custom similar to cdr_csv.
[asterisk-bristuff.git] / codecs / ilbc / hpInput.c
blob16b98f3df9d014ad5ae8769eb39901a92b9b5c05
2 /******************************************************************
4 iLBC Speech Coder ANSI-C Source Code
6 hpInput.c
8 Copyright (C) The Internet Society (2004).
9 All Rights Reserved.
11 ******************************************************************/
13 #include "constants.h"
14 #include "hpInput.h"
16 /*----------------------------------------------------------------*
17 * Input high-pass filter
18 *---------------------------------------------------------------*/
20 void hpInput(
21 float *In, /* (i) vector to filter */
22 int len, /* (i) length of vector to filter */
23 float *Out, /* (o) the resulting filtered vector */
24 float *mem /* (i/o) the filter state */
26 int i;
27 float *pi, *po;
29 /* all-zero section*/
31 pi = &In[0];
32 po = &Out[0];
33 for (i=0; i<len; i++) {
34 *po = hpi_zero_coefsTbl[0] * (*pi);
35 *po += hpi_zero_coefsTbl[1] * mem[0];
36 *po += hpi_zero_coefsTbl[2] * mem[1];
38 mem[1] = mem[0];
39 mem[0] = *pi;
40 po++;
43 pi++;
47 /* all-pole section*/
49 po = &Out[0];
50 for (i=0; i<len; i++) {
51 *po -= hpi_pole_coefsTbl[1] * mem[2];
52 *po -= hpi_pole_coefsTbl[2] * mem[3];
54 mem[3] = mem[2];
55 mem[2] = *po;
56 po++;