diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-01-07 19:45:00 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-01-07 19:45:00 +0000 |
| commit | 6788444ce3aee9c74dc4ac1518a779c8c663c319 (patch) | |
| tree | 9c6743491422e8f26ade580102beb0fc6a8cc649 /src/plugins | |
| parent | 60049a475c6c842ffab96cef87fe1fc8cd18afcc (diff) | |
| download | qmmp-6788444ce3aee9c74dc4ac1518a779c8c663c319.tar.gz qmmp-6788444ce3aee9c74dc4ac1518a779c8c663c319.tar.bz2 qmmp-6788444ce3aee9c74dc4ac1518a779c8c663c319.zip | |
ladspa: added optimization
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5978 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins')
| -rw-r--r-- | src/plugins/Effect/ladspa/ladspahost.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/Effect/ladspa/ladspahost.cpp b/src/plugins/Effect/ladspa/ladspahost.cpp index 918be9a45..3070270c4 100644 --- a/src/plugins/Effect/ladspa/ladspahost.cpp +++ b/src/plugins/Effect/ladspa/ladspahost.cpp @@ -421,10 +421,9 @@ int LADSPAHost::applyEffect(float *data, size_t samples) size_t frames = samples / m_chan; - for(size_t i = 0; i < frames; ++i) + for(size_t i = 0; i < samples; ++i) { - for(int c = 0; c < m_chan; c++) - m_buf[c][i] = data[i*m_chan + c]; + m_buf[i % m_chan][i / m_chan] = data[i]; } for(int i = 0; i < m_effects.count(); ++i) @@ -435,10 +434,9 @@ int LADSPAHost::applyEffect(float *data, size_t samples) } } - for(size_t i = 0; i < frames; ++i) + for(size_t i = 0; i < samples; ++i) { - for(int c = 0; c < m_chan; c++) - data[i*m_chan + c] = m_buf[c][i]; + data[i] = m_buf[i % m_chan][i / m_chan]; } return samples; } |
