i.MX31: Allow interrupts in thread context, not just ISR context, during the lengthy...
[kugel-rb.git] / apps / eq.h
bloba44e9153aca5eb2d96f0a27279a2cabdf89ab4c9
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006-2007 Thom Johansen
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef _EQ_H
23 #define _EQ_H
25 #include <inttypes.h>
26 #include <stdbool.h>
28 /* These depend on the fixed point formats used by the different filter types
29 and need to be changed when they change.
31 #define FILTER_BISHELF_SHIFT 5
32 #define EQ_PEAK_SHIFT 4
33 #define EQ_SHELF_SHIFT 6
35 struct eqfilter {
36 int32_t coefs[5]; /* Order is b0, b1, b2, a1, a2 */
37 int32_t history[2][4];
40 void filter_shelf_coefs(unsigned long cutoff, long A, bool low, int32_t *c);
41 void filter_bishelf_coefs(unsigned long cutoff_low, unsigned long cutoff_high,
42 long A_low, long A_high, long A, int32_t *c);
43 void eq_pk_coefs(unsigned long cutoff, unsigned long Q, long db, int32_t *c);
44 void eq_ls_coefs(unsigned long cutoff, unsigned long Q, long db, int32_t *c);
45 void eq_hs_coefs(unsigned long cutoff, unsigned long Q, long db, int32_t *c);
46 void eq_filter(int32_t **x, struct eqfilter *f, unsigned num,
47 unsigned channels, unsigned shift);
49 #endif