Revision 98cfadd6 libavcodec/iirfilter.c

View differences:

libavcodec/iirfilter.c
137 137

  
138 138
    if (filt_mode == FF_FILTER_MODE_HIGHPASS) {
139 139
        c->gain  =  ((1.0 + cos_w0) / 2.0)  / a0;
140
        x0       = (-(1.0 + cos_w0))        / a0;
141
        x1       =  ((1.0 + cos_w0) / 2.0)  / a0;
140
        x0       =  ((1.0 + cos_w0) / 2.0)  / a0;
141
        x1       = (-(1.0 + cos_w0))        / a0;
142 142
    } else { // FF_FILTER_MODE_LOWPASS
143 143
        c->gain  =  ((1.0 - cos_w0) / 2.0)  / a0;
144
        x0       =   (1.0 - cos_w0)         / a0;
145
        x1       =  ((1.0 - cos_w0) / 2.0)  / a0;
144
        x0       =  ((1.0 - cos_w0) / 2.0)  / a0;
145
        x1       =   (1.0 - cos_w0)         / a0;
146 146
    }
147
    c->cy[0] =  (2.0 *  cos_w0)        / a0;
148
    c->cy[1] = (-1.0 + (sin_w0 / 2.0)) / a0;
147
    c->cy[0] = (-1.0 + (sin_w0 / 2.0)) / a0;
148
    c->cy[1] =  (2.0 *  cos_w0)        / a0;
149 149

  
150 150
    // divide by gain to make the x coeffs integers.
151 151
    // during filtering, the delay state will include the gain multiplication

Also available in: Unified diff