~ubuntu-branches/ubuntu/saucy/openal-soft/saucy

« back to all changes in this revision

Viewing changes to OpenAL32/Include/alFilter.h

  • Committer: Bazaar Package Importer
  • Author(s): Andres Mejia
  • Date: 2011-04-22 18:30:58 UTC
  • mfrom: (7.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110422183058-pgxqd8022xk3vwao
Tags: 1:1.13-2
Don't build with ALSA compatibility on non-Linux architectures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    return output;
62
62
}
63
63
 
 
64
static __inline ALfloat lpFilter4PC(const FILTER *iir, ALuint offset, ALfloat input)
 
65
{
 
66
    const ALfloat *history = &iir->history[offset];
 
67
    ALfloat a = iir->coeff;
 
68
    ALfloat output = input;
 
69
 
 
70
    output = output + (history[0]-output)*a;
 
71
    output = output + (history[1]-output)*a;
 
72
    output = output + (history[2]-output)*a;
 
73
    output = output + (history[3]-output)*a;
 
74
 
 
75
    return output;
 
76
}
 
77
 
 
78
static __inline ALfloat lpFilter2PC(const FILTER *iir, ALuint offset, ALfloat input)
 
79
{
 
80
    const ALfloat *history = &iir->history[offset];
 
81
    ALfloat a = iir->coeff;
 
82
    ALfloat output = input;
 
83
 
 
84
    output = output + (history[0]-output)*a;
 
85
    output = output + (history[1]-output)*a;
 
86
 
 
87
    return output;
 
88
}
 
89
 
 
90
static __inline ALfloat lpFilter1PC(FILTER *iir, ALuint offset, ALfloat input)
 
91
{
 
92
    const ALfloat *history = &iir->history[offset];
 
93
    ALfloat a = iir->coeff;
 
94
    ALfloat output = input;
 
95
 
 
96
    output = output + (history[0]-output)*a;
 
97
 
 
98
    return output;
 
99
}
 
100
 
64
101
/* Calculates the low-pass filter coefficient given the pre-scaled gain and
65
102
 * cos(w) value. Note that g should be pre-scaled (sqr(gain) for one-pole,
66
103
 * sqrt(gain) for four-pole, etc) */
89
126
 
90
127
    // Index to itself
91
128
    ALuint filter;
92
 
 
93
 
    struct ALfilter *next;
94
129
} ALfilter;
95
130
 
96
131