summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
172 but adding peaking filters are possible. */ 172 but adding peaking filters are possible. */
173struct eq_state { 173struct 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
180static struct dsp_config dsp_conf[2] IBSS_ATTR; 178static 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. */
624void eq_process(long **x, unsigned num) 622static 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