diff options
author | Thom Johansen <thomj@rockbox.org> | 2006-02-02 20:03:43 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2006-02-02 20:03:43 +0000 |
commit | 440d75f93873e2ed0e471d4cd7f27e0d2c324a16 (patch) | |
tree | 9c9f6dcd8c398e5f9e5ca98e507707408c9b2de8 /apps/dsp.c | |
parent | e6c2e197b3664bc2f9dd508c07e0743ab9ea1ca5 (diff) | |
download | rockbox-440d75f93873e2ed0e471d4cd7f27e0d2c324a16.tar.gz rockbox-440d75f93873e2ed0e471d4cd7f27e0d2c324a16.zip |
No need for different name members in eq_data struct.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8534 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/dsp.c')
-rw-r--r-- | apps/dsp.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/apps/dsp.c b/apps/dsp.c index b2fc0ce7a2..789cf72b20 100644 --- a/apps/dsp.c +++ b/apps/dsp.c | |||
@@ -172,9 +172,7 @@ struct crossfeed_data | |||
172 | but adding peaking filters are possible. */ | 172 | but adding peaking filters are possible. */ |
173 | struct eq_state { | 173 | struct eq_state { |
174 | char enabled[5]; /* Flags for active filters */ | 174 | char enabled[5]; /* Flags for active filters */ |
175 | struct eqfilter ls; | 175 | struct eqfilter filters[5]; |
176 | struct eqfilter pk[3]; | ||
177 | struct eqfilter hs; | ||
178 | }; | 176 | }; |
179 | 177 | ||
180 | static struct dsp_config dsp_conf[2] IBSS_ATTR; | 178 | static struct dsp_config dsp_conf[2] IBSS_ATTR; |
@@ -621,22 +619,25 @@ static void apply_crossfeed(long* src[], int count) | |||
621 | #endif | 619 | #endif |
622 | 620 | ||
623 | /* Apply EQ filters to those bands that have got it switched on. */ | 621 | /* Apply EQ filters to those bands that have got it switched on. */ |
624 | void eq_process(long **x, unsigned num) | 622 | static void eq_process(long **x, unsigned num) |
625 | { | 623 | { |
626 | int i; | 624 | int i; |
627 | unsigned int channels = dsp->stereo_mode != STEREO_MONO ? 2 : 1; | 625 | unsigned int channels = dsp->stereo_mode != STEREO_MONO ? 2 : 1; |
628 | 626 | unsigned shift; | |
627 | |||
629 | /* filter configuration currently is 1 low shelf filter, 3 band peaking | 628 | /* filter configuration currently is 1 low shelf filter, 3 band peaking |
630 | filters and 1 high shelf filter, in that order. | 629 | filters and 1 high shelf filter, in that order. we need to know this |
630 | so we can choose the correct shift factor. | ||
631 | */ | 631 | */ |
632 | if (eq_data.enabled[0]) | 632 | for (i = 0; i < 5; i++) { |
633 | eq_filter(x, &eq_data.ls, num, channels, EQ_SHELF_SHIFT); | 633 | if (eq_data.enabled[i]) { |
634 | for (i = 0; i < 3; i++) { | 634 | if (i == 0 || i == 4) /* shelving filters */ |
635 | if (eq_data.enabled[1 + i]) | 635 | shift = EQ_SHELF_SHIFT; |
636 | eq_filter(x, &eq_data.pk[i], num, channels, EQ_PEAK_SHIFT); | 636 | else |
637 | shift = EQ_PEAK_SHIFT; | ||
638 | eq_filter(x, &eq_data.filters[i], num, channels, shift); | ||
639 | } | ||
637 | } | 640 | } |
638 | if (eq_data.enabled[4]) | ||
639 | eq_filter(x, &eq_data.hs, num, channels, EQ_SHELF_SHIFT); | ||
640 | } | 641 | } |
641 | 642 | ||
642 | /* Apply a constant gain to the samples (e.g., for ReplayGain). May update | 643 | /* Apply a constant gain to the samples (e.g., for ReplayGain). May update |