diff options
author | Sean Bartell <wingedtachikoma@gmail.com> | 2011-06-24 01:25:21 -0400 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2012-03-18 12:00:39 +0100 |
commit | b5716df4cb2837bbbc42195cf1aefcf03e21d6a6 (patch) | |
tree | 130cd712e2e00893b6df9959a375a8d9523a1aca /lib/rbcodec/dsp/eq.h | |
parent | 24bd9d5393dbe39a5c6194877bc00ede669b1d5d (diff) | |
download | rockbox-b5716df4cb2837bbbc42195cf1aefcf03e21d6a6.tar.gz rockbox-b5716df4cb2837bbbc42195cf1aefcf03e21d6a6.zip |
Build librbcodec with DSP and metadata.
All associated files are moved to /lib/rbcodec.
Change-Id: I572ddd2b8a996aae1e98c081d06b1ed356dce222
Diffstat (limited to 'lib/rbcodec/dsp/eq.h')
-rw-r--r-- | lib/rbcodec/dsp/eq.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/lib/rbcodec/dsp/eq.h b/lib/rbcodec/dsp/eq.h new file mode 100644 index 0000000000..a44e9153ac --- /dev/null +++ b/lib/rbcodec/dsp/eq.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006-2007 Thom Johansen | ||
11 | * | ||
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. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef _EQ_H | ||
23 | #define _EQ_H | ||
24 | |||
25 | #include <inttypes.h> | ||
26 | #include <stdbool.h> | ||
27 | |||
28 | /* These depend on the fixed point formats used by the different filter types | ||
29 | and need to be changed when they change. | ||
30 | */ | ||
31 | #define FILTER_BISHELF_SHIFT 5 | ||
32 | #define EQ_PEAK_SHIFT 4 | ||
33 | #define EQ_SHELF_SHIFT 6 | ||
34 | |||
35 | struct eqfilter { | ||
36 | int32_t coefs[5]; /* Order is b0, b1, b2, a1, a2 */ | ||
37 | int32_t history[2][4]; | ||
38 | }; | ||
39 | |||
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); | ||
48 | |||
49 | #endif | ||
50 | |||