1 /* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 2 * Use of this source code is governed by a BSD-style license that can be 3 * found in the LICENSE file. 4 */ 5 6 #ifndef CROSSOVER_H_ 7 #define CROSSOVER_H_ 8 9 #include "biquad.h" 10 /* An LR4 filter is two biquads with the same parameters connected in series: 11 * 12 * x -- [BIQUAD] -- y -- [BIQUAD] -- z 13 * 14 * Both biquad filter has the same parameter b[012] and a[12], 15 * The variable [xyz][12] keep the history values. 16 */ 17 struct lr4 { 18 struct biquad bq; 19 float x1, x2; 20 float y1, y2; 21 float z1, z2; 22 }; 23 24 void lr4_set(struct lr4 *lr4, enum biquad_type type, float freq); 25 26 void lr4_process_float32(struct lr4 *lr4, int samples, int channels, float *src, float *dest); 27 void lr4_process_s16(struct lr4 *lr4, int samples, int channels, short *src, short *dest); 28 29 #endif /* CROSSOVER_H_ */ 30