Split 8-bit-to-native conversion in bmp.c into a function, add support for plugging...
[kugel-rb.git] / apps / eq.h
blob1c3efe50e93d8c5cf85b933411eb58235e6221bb
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>
27 /* These depend on the fixed point formats used by the different filter types
28 and need to be changed when they change.
30 #define FILTER_BISHELF_SHIFT 5
31 #define EQ_PEAK_SHIFT 4
32 #define EQ_SHELF_SHIFT 6
34 struct eqfilter {
35 int32_t coefs[5]; /* Order is b0, b1, b2, a1, a2 */
36 int32_t history[2][4];
39 void filter_shelf_coefs(unsigned long cutoff, long A, bool low, int32_t *c);
40 void filter_bishelf_coefs(unsigned long cutoff_low, unsigned long cutoff_high,
41 long A_low, long A_high, long A, int32_t *c);
42 void eq_pk_coefs(unsigned long cutoff, unsigned long Q, long db, int32_t *c);
43 void eq_ls_coefs(unsigned long cutoff, unsigned long Q, long db, int32_t *c);
44 void eq_hs_coefs(unsigned long cutoff, unsigned long Q, long db, int32_t *c);
45 void eq_filter(int32_t **x, struct eqfilter *f, unsigned num,
46 unsigned channels, unsigned shift);
48 #endif