Make file access in cdr_custom similar to cdr_csv.
[asterisk-bristuff.git] / codecs / ilbc / hpOutput.c
blobfdc0f6db92b9eb8e7829ce922d3897a2c7a9c966
2 /******************************************************************
4 iLBC Speech Coder ANSI-C Source Code
6 hpOutput.c
8 Copyright (C) The Internet Society (2004).
9 All Rights Reserved.
13 ******************************************************************/
15 #include "constants.h"
16 #include "hpOutput.h"
17 /*----------------------------------------------------------------*
18 * Output high-pass filter
19 *---------------------------------------------------------------*/
21 void hpOutput(
22 float *In, /* (i) vector to filter */
23 int len,/* (i) length of vector to filter */
24 float *Out, /* (o) the resulting filtered vector */
25 float *mem /* (i/o) the filter state */
27 int i;
28 float *pi, *po;
30 /* all-zero section*/
32 pi = &In[0];
33 po = &Out[0];
34 for (i=0; i<len; i++) {
35 *po = hpo_zero_coefsTbl[0] * (*pi);
36 *po += hpo_zero_coefsTbl[1] * mem[0];
37 *po += hpo_zero_coefsTbl[2] * mem[1];
39 mem[1] = mem[0];
40 mem[0] = *pi;
41 po++;
42 pi++;
46 /* all-pole section*/
48 po = &Out[0];
49 for (i=0; i<len; i++) {
50 *po -= hpo_pole_coefsTbl[1] * mem[2];
51 *po -= hpo_pole_coefsTbl[2] * mem[3];
53 mem[3] = mem[2];
54 mem[2] = *po;
55 po++;