diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2019-09-20 21:30:15 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2019-09-20 21:30:15 +0000 |
| commit | 93a1aac589e0b270136aaa6774fa333457a6228a (patch) | |
| tree | a30cdfd38a9f9aa39afec9bea6dafb2b7d178c3b /src | |
| parent | d557c0c071fccfb1c00989f05567e817e4d4973b (diff) | |
| download | qmmp-93a1aac589e0b270136aaa6774fa333457a6228a.tar.gz qmmp-93a1aac589e0b270136aaa6774fa333457a6228a.tar.bz2 qmmp-93a1aac589e0b270136aaa6774fa333457a6228a.zip | |
equalizer: added feature to disable clipping
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9072 90c681e8-e032-0410-971d-27865f9a5e38
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) { |
