MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

Interleave.hxx
Go to the documentation of this file.
1 /*
2 * Copyright 2003-2017 The Music Player Daemon Project
3 * http://www.musicpd.org
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef MPD_PCM_INTERLEAVE_HXX
21 #define MPD_PCM_INTERLEAVE_HXX
22
23 #include "check.h"
24 #include "Compiler.h"
25 #include "util/ConstBuffer.hxx"
26
27 #include <stdint.h>
28
32 void
33 PcmInterleave(void *gcc_restrict dest, ConstBuffer<const void *> src,
34 size_t n_frames, size_t sample_size);
35
40 void
41 PcmInterleave32(int32_t *gcc_restrict dest, ConstBuffer<const int32_t *> src,
42 size_t n_frames);
43
44 static inline void
45 PcmInterleaveFloat(float *gcc_restrict dest, ConstBuffer<const float *> src,
46 size_t n_frames)
47 {
48 PcmInterleave32((int32_t *)dest,
49 ConstBuffer<const int32_t *>((const int32_t *const*)src.data,
50 src.size),
51 n_frames);
52 }
53
54 #endif
check.h
PcmInterleaveFloat
static void PcmInterleaveFloat(float *gcc_restrict dest, ConstBuffer< const float * > src, size_t n_frames)
Definition: Interleave.hxx:45
PcmInterleave32
void PcmInterleave32(int32_t *gcc_restrict dest, ConstBuffer< const int32_t * > src, size_t n_frames)
A variant of PcmInterleave() that assumes 32 bit samples (4 bytes per sample).
ConstBuffer::size
size_type size
Definition: ConstBuffer.hxx:97
Compiler.h
gcc_restrict
#define gcc_restrict
Definition: Compiler.h:154
ConstBuffer::data
pointer_type data
Definition: ConstBuffer.hxx:96
ConstBuffer
A reference to a memory area that is read-only.
Definition: FlacPcm.hxx:29
ConstBuffer.hxx
PcmInterleave
void PcmInterleave(void *gcc_restrict dest, ConstBuffer< const void * > src, size_t n_frames, size_t sample_size)
Interleave planar PCM samples from #src to #dest.