SPC Codec: Ensure no crash occurs on load failure which could cause emulation to...
[kugel-rb.git] / apps / eq.h
blobb895b44b9757f0c2156da6483c30868d0688f4dc
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006-2007 Thom Johansen
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef _EQ_H
21 #define _EQ_H
23 #include <inttypes.h>
25 /* These depend on the fixed point formats used by the different filter types
26 and need to be changed when they change.
28 #define FILTER_BISHELF_SHIFT 5
29 #define EQ_PEAK_SHIFT 4
30 #define EQ_SHELF_SHIFT 6
32 struct eqfilter {
33 int32_t coefs[5]; /* Order is b0, b1, b2, a1, a2 */
34 int32_t history[2][4];
37 void filter_shelf_coefs(unsigned long cutoff, long A, bool low, int32_t *c);
38 void filter_bishelf_coefs(unsigned long cutoff_low, unsigned long cutoff_high,
39 long A_low, long A_high, long A, int32_t *c);
40 void eq_pk_coefs(unsigned long cutoff, unsigned long Q, long db, int32_t *c);
41 void eq_ls_coefs(unsigned long cutoff, unsigned long Q, long db, int32_t *c);
42 void eq_hs_coefs(unsigned long cutoff, unsigned long Q, long db, int32_t *c);
43 void eq_filter(int32_t **x, struct eqfilter *f, unsigned num,
44 unsigned channels, unsigned shift);
46 #endif