mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-21 15:56:58 +02:00
Add a specialized path for deinterleaving u8 samples.
This is not yet optimized.
This commit is contained in:
+13
@@ -52450,6 +52450,19 @@ MA_API void ma_deinterleave_pcm_frames(ma_format format, ma_uint32 channels, ma_
|
||||
|
||||
/* For efficiency we do this per format. */
|
||||
switch (format) {
|
||||
case ma_format_u8:
|
||||
{
|
||||
const ma_uint8* pSrcU8 = (const ma_uint8*)pInterleavedPCMFrames;
|
||||
ma_uint64 iPCMFrame;
|
||||
for (iPCMFrame = 0; iPCMFrame < frameCount; ++iPCMFrame) {
|
||||
ma_uint32 iChannel;
|
||||
for (iChannel = 0; iChannel < channels; ++iChannel) {
|
||||
ma_uint8* pDstU8 = (ma_uint8*)ppDeinterleavedPCMFrames[iChannel];
|
||||
pDstU8[iPCMFrame] = pSrcU8[iPCMFrame*channels+iChannel];
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
case ma_format_s16:
|
||||
{
|
||||
const ma_int16* pSrcS16 = (const ma_int16*)pInterleavedPCMFrames;
|
||||
|
||||
Reference in New Issue
Block a user