diff options
Diffstat (limited to 'apps/dsp.c')
-rw-r--r-- | apps/dsp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/dsp.c b/apps/dsp.c index 1e0ae1fb8d..3c2d7f63b1 100644 --- a/apps/dsp.c +++ b/apps/dsp.c | |||
@@ -758,27 +758,27 @@ void dsp_set_crossfeed(bool enable) | |||
758 | 758 | ||
759 | void dsp_set_crossfeed_direct_gain(int gain) | 759 | void dsp_set_crossfeed_direct_gain(int gain) |
760 | { | 760 | { |
761 | crossfeed_data.gain = get_replaygain_int(gain * -10) << 7; | 761 | crossfeed_data.gain = get_replaygain_int(gain * 10) << 7; |
762 | /* If gain is negative, the calculation overflowed and we need to clamp */ | 762 | /* If gain is negative, the calculation overflowed and we need to clamp */ |
763 | if (crossfeed_data.gain < 0) | 763 | if (crossfeed_data.gain < 0) |
764 | crossfeed_data.gain = 0x7fffffff; | 764 | crossfeed_data.gain = 0x7fffffff; |
765 | } | 765 | } |
766 | 766 | ||
767 | /* Both gains should be below 0 dB (when inverted) */ | 767 | /* Both gains should be below 0 dB */ |
768 | void dsp_set_crossfeed_cross_params(long lf_gain, long hf_gain, long cutoff) | 768 | void dsp_set_crossfeed_cross_params(long lf_gain, long hf_gain, long cutoff) |
769 | { | 769 | { |
770 | int32_t *c = crossfeed_data.coefs; | 770 | int32_t *c = crossfeed_data.coefs; |
771 | long scaler = get_replaygain_int(lf_gain * -10) << 7; | 771 | long scaler = get_replaygain_int(lf_gain * 10) << 7; |
772 | 772 | ||
773 | cutoff = 0xffffffff/NATIVE_FREQUENCY*cutoff; | 773 | cutoff = 0xffffffff/NATIVE_FREQUENCY*cutoff; |
774 | hf_gain -= lf_gain; | 774 | hf_gain -= lf_gain; |
775 | /* Divide cutoff by sqrt(10^(-hf_gain/20)) to place cutoff at the -3 dB | 775 | /* Divide cutoff by sqrt(10^(hf_gain/20)) to place cutoff at the -3 dB |
776 | * point instead of shelf midpoint. This is for compatibility with the old | 776 | * point instead of shelf midpoint. This is for compatibility with the old |
777 | * crossfeed shelf filter and should be removed if crossfeed settings are | 777 | * crossfeed shelf filter and should be removed if crossfeed settings are |
778 | * ever made incompatible for any other good reason. | 778 | * ever made incompatible for any other good reason. |
779 | */ | 779 | */ |
780 | cutoff = DIV64(cutoff, get_replaygain_int(-hf_gain*5), 24); | 780 | cutoff = DIV64(cutoff, get_replaygain_int(hf_gain*5), 24); |
781 | filter_shelf_coefs(cutoff, -hf_gain, false, c); | 781 | filter_shelf_coefs(cutoff, hf_gain, false, c); |
782 | /* Scale coefs by LF gain and shift them to s0.31 format. We have no gains | 782 | /* Scale coefs by LF gain and shift them to s0.31 format. We have no gains |
783 | * over 1 and can do this safely | 783 | * over 1 and can do this safely |
784 | */ | 784 | */ |