~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.2.1/third_party/ilbc/hpOutput.c

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2015-01-07 14:51:16 UTC
  • mfrom: (4.3.5 sid)
  • Revision ID: package-import@ubuntu.com-20150107145116-yxnafinf4lrdvrmx
Tags: 1.4.1-0.1ubuntu1
* Merge with Debian, remaining changes:
 - Drop soprano, nepomuk build-dep
* Drop ubuntu patches, now upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
   /******************************************************************
 
3
 
 
4
       iLBC Speech Coder ANSI-C Source Code
 
5
 
 
6
       hpOutput.c
 
7
 
 
8
       Copyright (C) The Internet Society (2004).
 
9
       All Rights Reserved.
 
10
 
 
11
   ******************************************************************/
 
12
 
 
13
   #include "constants.h"
 
14
 
 
15
   /*----------------------------------------------------------------*
 
16
    *  Output high-pass filter
 
17
    *---------------------------------------------------------------*/
 
18
 
 
19
   void hpOutput(
 
20
 
 
21
 
 
22
 
 
23
 
 
24
 
 
25
       float *In,  /* (i) vector to filter */
 
26
       int len,/* (i) length of vector to filter */
 
27
       float *Out, /* (o) the resulting filtered vector */
 
28
       float *mem  /* (i/o) the filter state */
 
29
   ){
 
30
       int i;
 
31
       float *pi, *po;
 
32
 
 
33
       /* all-zero section*/
 
34
 
 
35
       pi = &In[0];
 
36
       po = &Out[0];
 
37
       for (i=0; i<len; i++) {
 
38
           *po = hpo_zero_coefsTbl[0] * (*pi);
 
39
           *po += hpo_zero_coefsTbl[1] * mem[0];
 
40
           *po += hpo_zero_coefsTbl[2] * mem[1];
 
41
 
 
42
           mem[1] = mem[0];
 
43
           mem[0] = *pi;
 
44
           po++;
 
45
           pi++;
 
46
 
 
47
       }
 
48
 
 
49
       /* all-pole section*/
 
50
 
 
51
       po = &Out[0];
 
52
       for (i=0; i<len; i++) {
 
53
           *po -= hpo_pole_coefsTbl[1] * mem[2];
 
54
           *po -= hpo_pole_coefsTbl[2] * mem[3];
 
55
 
 
56
           mem[3] = mem[2];
 
57
           mem[2] = *po;
 
58
           po++;
 
59
       }
 
60
   }
 
61