Makes code significantly faster for higher orders.
Unified · Split
| @@ -288,7 +288,25 @@ static void biquad_process_## name(const BiquadCoeffs *const c,\ · 287 unmodified lines | |||
| 288 | type z1 = b->z1; \ | 288 | type z1 = b->z1; \ |
| 289 | type z2 = b->z2; \ | 289 | type z2 = b->z2; \ |
| 290 | \ | 290 | \ |
| 291 | for (int n = 0; n < nb_samples; n++) { \ | 291 | for (int n = 0; n + 1 < nb_samples; n++) { \ |
| 292 | type in = src[n]; \ | ||
| 293 | type out; \ | ||
| 294 | \ | ||
| 295 | out = in * b0 + z1; \ | ||
| 296 | z1 = b1 * in + z2 + a1 * out; \ | ||
| 297 | z2 = b2 * in + a2 * out; \ | ||
| 298 | dst[n] = out; \ | ||
| 299 | \ | ||
| 300 | n++; \ | ||
| 301 | in = src[n]; \ | ||
| 302 | out = in * b0 + z1; \ | ||
| 303 | z1 = b1 * in + z2 + a1 * out; \ | ||
| 304 | z2 = b2 * in + a2 * out; \ | ||
| 305 | dst[n] = out; \ | ||
| 306 | } \ | ||
| 307 | \ | ||
| 308 | if (nb_samples & 1) { \ | ||
| 309 | const int n = nb_samples - 1; \ | ||
| 292 | const type in = src[n]; \ | 310 | const type in = src[n]; \ |
| 293 | type out; \ | 311 | type out; \ |
| 294 | \ | 312 | \ |