summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2006-02-02 20:03:43 +0000
committerThom Johansen <thomj@rockbox.org>2006-02-02 20:03:43 +0000
commit440d75f93873e2ed0e471d4cd7f27e0d2c324a16 (patch)
tree9c9f6dcd8c398e5f9e5ca98e507707408c9b2de8
parente6c2e197b3664bc2f9dd508c07e0743ab9ea1ca5 (diff)
downloadrockbox-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
-rw-r--r--apps/dsp.c27
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
but adding peaking filters are possible. */
struct eq_state {
char enabled[5]; /* Flags for active filters */
- struct eqfilter ls;
- struct eqfilter pk[3];
- struct eqfilter hs;
+ struct eqfilter filters[5];
};
static struct dsp_config dsp_conf[2] IBSS_ATTR;
@@ -621,22 +619,25 @@ static void apply_crossfeed(long* src[], int count)
#endif
/* Apply EQ filters to those bands that have got it switched on. */
-void eq_process(long **x, unsigned num)
+static void eq_process(long **x, unsigned num)
{
int i;
unsigned int channels = dsp->stereo_mode != STEREO_MONO ? 2 : 1;
-
+ unsigned shift;
+
/* filter configuration currently is 1 low shelf filter, 3 band peaking
- filters and 1 high shelf filter, in that order.
+ filters and 1 high shelf filter, in that order. we need to know this
+ so we can choose the correct shift factor.
*/
- if (eq_data.enabled[0])
- eq_filter(x, &eq_data.ls, num, channels, EQ_SHELF_SHIFT);
- for (i = 0; i < 3; i++) {
- if (eq_data.enabled[1 + i])
- eq_filter(x, &eq_data.pk[i], num, channels, EQ_PEAK_SHIFT);
+ for (i = 0; i < 5; i++) {
+ if (eq_data.enabled[i]) {
+ if (i == 0 || i == 4) /* shelving filters */
+ shift = EQ_SHELF_SHIFT;
+ else
+ shift = EQ_PEAK_SHIFT;
+ eq_filter(x, &eq_data.filters[i], num, channels, shift);
+ }
}
- if (eq_data.enabled[4])
- eq_filter(x, &eq_data.hs, num, channels, EQ_SHELF_SHIFT);
}
/* Apply a constant gain to the samples (e.g., for ReplayGain). May update