diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/qmmp/equ/iir.h | 2 | ||||
| -rw-r--r-- | src/qmmp/equ/iir_fpu.c | 26 | ||||
| -rw-r--r-- | src/qmmp/outputwriter.cpp | 1 |
3 files changed, 18 insertions, 11 deletions
diff --git a/src/qmmp/equ/iir.h b/src/qmmp/equ/iir.h index 9d6afe336..173ff3a4f 100644 --- a/src/qmmp/equ/iir.h +++ b/src/qmmp/equ/iir.h @@ -62,7 +62,7 @@ */ typedef enum { EQ_TWO_PASSES = 0x01, - EQ_LIMITER = 0x02 + EQ_CLIP = 0x02 } eq_option_t; diff --git a/src/qmmp/equ/iir_fpu.c b/src/qmmp/equ/iir_fpu.c index 5c2caf157..23d748bda 100644 --- a/src/qmmp/equ/iir_fpu.c +++ b/src/qmmp/equ/iir_fpu.c @@ -144,16 +144,22 @@ __inline__ int eq_iir(float *d, int samples, int nch) } /* For each band */ } - /* Volume stuff - Scale down original PCM sample and add it to the filters - output. This substitutes the multiplication by 0.25 - Go back to use the floating point multiplication before the - conversion to give more dynamic range - */ - out[channel] += pcm[channel]*0.25; - - - data[index+channel] = out[channel] > 1.0 ? 1.0 : (out[channel] < -1.0 ? -1.0 : out[channel]); + if (eq_options & EQ_CLIP) + { + /* Volume stuff + Scale down original PCM sample and add it to the filters + output. This substitutes the multiplication by 0.25 + Go back to use the floating point multiplication before the + conversion to give more dynamic range + */ + out[channel] += pcm[channel]*0.25; + data[index+channel] = out[channel] > 1.0 ? 1.0 : (out[channel] < -1.0 ? -1.0 : out[channel]); + } + else + { + out[channel] += pcm[channel]; + data[index+channel] = out[channel]; + } } /* For each channel */ diff --git a/src/qmmp/outputwriter.cpp b/src/qmmp/outputwriter.cpp index 182be7ac6..3fc36af2c 100644 --- a/src/qmmp/outputwriter.cpp +++ b/src/qmmp/outputwriter.cpp @@ -382,6 +382,7 @@ void OutputWriter::updateEqSettings() eq_init_iir(m_frequency, bands); eq_set_option(EQ_TWO_PASSES, m_settings->eqSettings().twoPasses()); + eq_set_option(EQ_CLIP, 1); for(int ch = 0; ch < m_channels; ++ch) { |
