Previously it was used only for displaying frequency response.
Unified · Split
| @@ -135,6 +135,7 @@ static int iir_ch_## name(AVFilterContext *ctx, void *arg, int ch, int nb_jobs) · 134 unmodified lines | ||
| 135 | 135 | const int nb_b = s->iir[ch].nb_ab[1]; \ |
| 136 | 136 | const double *a = s->iir[ch].ab[0]; \ |
| 137 | 137 | const double *b = s->iir[ch].ab[1]; \ |
| 138 | + const double g = s->iir[ch].g; \ | |
| 138 | 139 | int *clippings = &s->iir[ch].clippings; \ |
| 139 | 140 | type *dst = (type *)out->extended_data[ch]; \ |
| 140 | 141 | int n; \ |
| @@ -153,7 +154,7 @@ static int iir_ch_## name(AVFilterContext *ctx, void *arg, int ch, int nb_jobs) · 12 unmodified lines | ||
| 153 | 154 | sample -= a[x] * oc[x]; \ |
| 154 | 155 | \ |
| 155 | 156 | oc[0] = sample; \ |
| 156 | − sample *= og; \ | |
| 157 | + sample *= og * g; \ | |
| 157 | 158 | sample = sample * mix + ic[0] * (1. - mix); \ |
| 158 | 159 | if (need_clipping && sample < min) { \ |
| 159 | 160 | (*clippings)++; \ |
| @@ -186,6 +187,7 @@ static int iir_ch_serial_## name(AVFilterContext *ctx, void *arg, int ch, int nb · 26 unmodified lines | ||
| 186 | 187 | const type *src = (const type *)in->extended_data[ch]; \ |
| 187 | 188 | type *dst = (type *)out->extended_data[ch]; \ |
| 188 | 189 | IIRChannel *iir = &s->iir[ch]; \ |
| 190 | + const double g = iir->g; \ | |
| 189 | 191 | int *clippings = &iir->clippings; \ |
| 190 | 192 | int nb_biquads = (FFMAX(iir->nb_ab[0], iir->nb_ab[1]) + 1) / 2; \ |
| 191 | 193 | int n, i; \ |
| @@ -209,7 +211,7 @@ static int iir_ch_serial_## name(AVFilterContext *ctx, void *arg, int ch, int nb · 17 unmodified lines | ||
| 209 | 211 | i1 = src[n]; \ |
| 210 | 212 | o2 = o1; \ |
| 211 | 213 | o1 = o0; \ |
| 212 | − o0 *= og; \ | |
| 214 | + o0 *= og * g; \ | |
| 213 | 215 | \ |
| 214 | 216 | o0 = o0 * mix + (1. - mix) * sample; \ |
| 215 | 217 | if (need_clipping && o0 < min) { \ |