diff options
Diffstat (limited to 'lib/rbcodec/dsp/eq.h')
-rw-r--r-- | lib/rbcodec/dsp/eq.h | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/lib/rbcodec/dsp/eq.h b/lib/rbcodec/dsp/eq.h index a44e9153ac..53097beb12 100644 --- a/lib/rbcodec/dsp/eq.h +++ b/lib/rbcodec/dsp/eq.h | |||
@@ -18,33 +18,25 @@ | |||
18 | * KIND, either express or implied. | 18 | * KIND, either express or implied. |
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | |||
22 | #ifndef _EQ_H | 21 | #ifndef _EQ_H |
23 | #define _EQ_H | 22 | #define _EQ_H |
24 | 23 | ||
25 | #include <inttypes.h> | 24 | /* => support from 3 to 32 bands, inclusive |
26 | #include <stdbool.h> | 25 | * Menus and screens must be updated to support changing this from 5 |
27 | 26 | * without modifying other stuff (remove comment when this is no longer | |
28 | /* These depend on the fixed point formats used by the different filter types | 27 | * true :-) */ |
29 | and need to be changed when they change. | 28 | #define EQ_NUM_BANDS 5 |
30 | */ | ||
31 | #define FILTER_BISHELF_SHIFT 5 | ||
32 | #define EQ_PEAK_SHIFT 4 | ||
33 | #define EQ_SHELF_SHIFT 6 | ||
34 | 29 | ||
35 | struct eqfilter { | 30 | struct eq_band_setting |
36 | int32_t coefs[5]; /* Order is b0, b1, b2, a1, a2 */ | 31 | { |
37 | int32_t history[2][4]; | 32 | int cutoff; /* Hz */ |
33 | int q; | ||
34 | int gain; /* +/- dB */ | ||
38 | }; | 35 | }; |
39 | 36 | ||
40 | void filter_shelf_coefs(unsigned long cutoff, long A, bool low, int32_t *c); | 37 | /** DSP interface **/ |
41 | void filter_bishelf_coefs(unsigned long cutoff_low, unsigned long cutoff_high, | 38 | void dsp_set_eq_precut(int precut); |
42 | long A_low, long A_high, long A, int32_t *c); | 39 | void dsp_set_eq_coefs(int band, const struct eq_band_setting *setting); |
43 | void eq_pk_coefs(unsigned long cutoff, unsigned long Q, long db, int32_t *c); | 40 | void dsp_eq_enable(bool enable); |
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 | 41 | ||
42 | #endif /* _EQ_H */ | ||