diff options
Diffstat (limited to 'libs/qm-dsp/dsp/rateconversion/Decimator.cpp')
-rw-r--r-- | libs/qm-dsp/dsp/rateconversion/Decimator.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/libs/qm-dsp/dsp/rateconversion/Decimator.cpp b/libs/qm-dsp/dsp/rateconversion/Decimator.cpp index c150ee0e11..593474f7be 100644 --- a/libs/qm-dsp/dsp/rateconversion/Decimator.cpp +++ b/libs/qm-dsp/dsp/rateconversion/Decimator.cpp @@ -199,10 +199,15 @@ void Decimator::doAntiAlias(const float *src, double *dst, unsigned int length) void Decimator::process(const double *src, double *dst) { - if( m_decFactor != 1 ) - { - doAntiAlias( src, decBuffer, m_inputLength ); + if (m_decFactor == 1) { + for( unsigned int i = 0; i < m_outputLength; i++ ) { + dst[i] = src[i]; + } + return; } + + doAntiAlias( src, decBuffer, m_inputLength ); + unsigned idx = 0; for( unsigned int i = 0; i < m_outputLength; i++ ) @@ -213,10 +218,15 @@ void Decimator::process(const double *src, double *dst) void Decimator::process(const float *src, float *dst) { - if( m_decFactor != 1 ) - { - doAntiAlias( src, decBuffer, m_inputLength ); + if (m_decFactor == 1) { + for( unsigned int i = 0; i < m_outputLength; i++ ) { + dst[i] = src[i]; + } + return; } + + doAntiAlias( src, decBuffer, m_inputLength ); + unsigned idx = 0; for( unsigned int i = 0; i < m_outputLength; i++ ) |