diff options
author | Max Kellermann <max@duempel.org> | 2015-06-22 17:20:37 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-06-22 17:20:37 +0200 |
commit | 16639f9d71a11f2d63df84c7ec660f2a9bd5f526 (patch) | |
tree | b43c4ea466593079ff5a491dcb7240284bdc3cca | |
parent | 22f2605e2569eaa51495e23ac335bdfde217c23c (diff) | |
download | mpd-16639f9d71a11f2d63df84c7ec660f2a9bd5f526.tar.gz mpd-16639f9d71a11f2d63df84c7ec660f2a9bd5f526.tar.xz mpd-16639f9d71a11f2d63df84c7ec660f2a9bd5f526.zip |
pcm/Interleave: instantiate a 16 bit optimization
-rw-r--r-- | src/pcm/Interleave.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pcm/Interleave.cxx b/src/pcm/Interleave.cxx index 9926b5f7f..1152a7070 100644 --- a/src/pcm/Interleave.cxx +++ b/src/pcm/Interleave.cxx @@ -51,6 +51,14 @@ PcmInterleaveT(T *gcc_restrict dest, } } +static void +PcmInterleave16(int16_t *gcc_restrict dest, + const ConstBuffer<const int16_t *> src, + size_t n_frames) +{ + PcmInterleaveT(dest, src, n_frames); +} + void PcmInterleave32(int32_t *gcc_restrict dest, const ConstBuffer<const int32_t *> src, @@ -65,6 +73,13 @@ PcmInterleave(void *gcc_restrict dest, size_t n_frames, size_t sample_size) { switch (sample_size) { + case 2: + PcmInterleave16((int16_t *)dest, + ConstBuffer<const int16_t *>((const int16_t *const*)src.data, + src.size), + n_frames); + break; + case 4: PcmInterleave32((int32_t *)dest, ConstBuffer<const int32_t *>((const int32_t *const*)src.data, |