Commit 81ae390c authored by David Reid's avatar David Reid

Use the term "deinterleaved" instead of "separated".

parent 7272a092
...@@ -695,7 +695,7 @@ typedef struct ...@@ -695,7 +695,7 @@ typedef struct
typedef struct mal_format_converter mal_format_converter; typedef struct mal_format_converter mal_format_converter;
typedef mal_uint32 (* mal_format_converter_read_proc) (mal_format_converter* pConverter, mal_uint32 frameCount, void* pFramesOut, void* pUserData); typedef mal_uint32 (* mal_format_converter_read_proc) (mal_format_converter* pConverter, mal_uint32 frameCount, void* pFramesOut, void* pUserData);
typedef mal_uint32 (* mal_format_converter_read_separated_proc)(mal_format_converter* pConverter, mal_uint32 frameCount, void** ppSamplesOut, void* pUserData); typedef mal_uint32 (* mal_format_converter_read_deinterleaved_proc)(mal_format_converter* pConverter, mal_uint32 frameCount, void** ppSamplesOut, void* pUserData);
typedef struct typedef struct
{ {
...@@ -711,7 +711,7 @@ struct mal_format_converter ...@@ -711,7 +711,7 @@ struct mal_format_converter
{ {
mal_format_converter_config config; mal_format_converter_config config;
mal_format_converter_read_proc onRead; mal_format_converter_read_proc onRead;
mal_format_converter_read_separated_proc onReadSeparated; mal_format_converter_read_deinterleaved_proc onReadDeinterleaved;
void* pUserData; void* pUserData;
void (* onConvertPCM)(void* dst, const void* src, mal_uint64 count, mal_dither_mode ditherMode); void (* onConvertPCM)(void* dst, const void* src, mal_uint64 count, mal_dither_mode ditherMode);
void (* onInterleavePCM)(void* dst, const void** src, mal_uint64 frameCount, mal_uint32 channels); void (* onInterleavePCM)(void* dst, const void** src, mal_uint64 frameCount, mal_uint32 channels);
...@@ -722,7 +722,7 @@ struct mal_format_converter ...@@ -722,7 +722,7 @@ struct mal_format_converter
typedef struct mal_channel_router mal_channel_router; typedef struct mal_channel_router mal_channel_router;
//typedef mal_uint32 (* mal_channel_router_read_proc) (mal_channel_router* pRouter, mal_uint32 frameCount, void* pFramesOut, void* pUserData); //typedef mal_uint32 (* mal_channel_router_read_proc) (mal_channel_router* pRouter, mal_uint32 frameCount, void* pFramesOut, void* pUserData);
typedef mal_uint32 (* mal_channel_router_read_separated_proc)(mal_channel_router* pRouter, mal_uint32 frameCount, void** ppSamplesOut, void* pUserData); typedef mal_uint32 (* mal_channel_router_read_deinterleaved_proc)(mal_channel_router* pRouter, mal_uint32 frameCount, void** ppSamplesOut, void* pUserData);
typedef struct typedef struct
{ {
...@@ -737,7 +737,7 @@ struct mal_channel_router ...@@ -737,7 +737,7 @@ struct mal_channel_router
{ {
mal_channel_router_config config; mal_channel_router_config config;
//mal_channel_router_read_proc onRead; //mal_channel_router_read_proc onRead;
mal_channel_router_read_separated_proc onReadSeparated; mal_channel_router_read_deinterleaved_proc onReadDeinterleaved;
void* pUserData; void* pUserData;
mal_bool32 isPassthrough : 1; mal_bool32 isPassthrough : 1;
mal_bool32 isSimpleShuffle : 1; mal_bool32 isSimpleShuffle : 1;
...@@ -1835,13 +1835,13 @@ mal_bool32 mal_channel_map_contains_channel_position(mal_uint32 channels, const ...@@ -1835,13 +1835,13 @@ mal_bool32 mal_channel_map_contains_channel_position(mal_uint32 channels, const
mal_result mal_format_converter_init(const mal_format_converter_config* pConfig, mal_format_converter_read_proc onRead, void* pUserData, mal_format_converter* pConverter); mal_result mal_format_converter_init(const mal_format_converter_config* pConfig, mal_format_converter_read_proc onRead, void* pUserData, mal_format_converter* pConverter);
// Initializes a format converter when the input data is non-interleaved. // Initializes a format converter when the input data is non-interleaved.
mal_result mal_format_converter_init_separated(const mal_format_converter_config* pConfig, mal_format_converter_read_separated_proc onRead, void* pUserData, mal_format_converter* pConverter); mal_result mal_format_converter_init_deinterleaved(const mal_format_converter_config* pConfig, mal_format_converter_read_deinterleaved_proc onRead, void* pUserData, mal_format_converter* pConverter);
// Reads data from the format converter as interleaved channels. // Reads data from the format converter as interleaved channels.
mal_uint64 mal_format_converter_read_frames(mal_format_converter* pConverter, mal_uint64 frameCount, void* pFramesOut); mal_uint64 mal_format_converter_read_frames(mal_format_converter* pConverter, mal_uint64 frameCount, void* pFramesOut);
// Reads data from the format converter as separated channels. // Reads data from the format converter as deinterleaved channels.
mal_uint64 mal_format_converter_read_frames_separated(mal_format_converter* pConverter, mal_uint64 frameCount, void** ppSamplesOut); mal_uint64 mal_format_converter_read_frames_deinterleaved(mal_format_converter* pConverter, mal_uint64 frameCount, void** ppSamplesOut);
...@@ -1855,10 +1855,10 @@ mal_uint64 mal_format_converter_read_frames_separated(mal_format_converter* pCon ...@@ -1855,10 +1855,10 @@ mal_uint64 mal_format_converter_read_frames_separated(mal_format_converter* pCon
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Initializes a channel router where it is assumed that the input data is non-interleaved. // Initializes a channel router where it is assumed that the input data is non-interleaved.
mal_result mal_channel_router_init_separated(const mal_channel_router_config* pConfig, mal_channel_router_read_separated_proc onRead, void* pUserData, mal_channel_router* pRouter); mal_result mal_channel_router_init_deinterleaved(const mal_channel_router_config* pConfig, mal_channel_router_read_deinterleaved_proc onRead, void* pUserData, mal_channel_router* pRouter);
// Reads data from the channel router as separated channels. // Reads data from the channel router as deinterleaved channels.
mal_uint64 mal_channel_router_read_frames_separated(mal_channel_router* pRouter, mal_uint64 frameCount, void** ppSamplesOut); mal_uint64 mal_channel_router_read_frames_deinterleaved(mal_channel_router* pRouter, mal_uint64 frameCount, void** ppSamplesOut);
...@@ -10741,7 +10741,7 @@ int mal_device__jack_process_callback(mal_jack_nframes_t frameCount, void* pUser ...@@ -10741,7 +10741,7 @@ int mal_device__jack_process_callback(mal_jack_nframes_t frameCount, void* pUser
if (pDevice->type == mal_device_type_playback) { if (pDevice->type == mal_device_type_playback) {
mal_device__read_frames_from_client(pDevice, frameCount, pDevice->jack.pIntermediaryBuffer); mal_device__read_frames_from_client(pDevice, frameCount, pDevice->jack.pIntermediaryBuffer);
// Channels need to be separated. // Channels need to be deinterleaved.
for (mal_uint32 iChannel = 0; iChannel < pDevice->internalChannels; ++iChannel) { for (mal_uint32 iChannel = 0; iChannel < pDevice->internalChannels; ++iChannel) {
float* pDst = (float*)((mal_jack_port_get_buffer_proc)pContext->jack.jack_port_get_buffer)((mal_jack_port_t*)pDevice->jack.pPorts[iChannel], frameCount); float* pDst = (float*)((mal_jack_port_get_buffer_proc)pContext->jack.jack_port_get_buffer)((mal_jack_port_t*)pDevice->jack.pPorts[iChannel], frameCount);
if (pDst != NULL) { if (pDst != NULL) {
...@@ -16861,14 +16861,14 @@ mal_result mal_format_converter_init(const mal_format_converter_config* pConfig, ...@@ -16861,14 +16861,14 @@ mal_result mal_format_converter_init(const mal_format_converter_config* pConfig,
return MAL_SUCCESS; return MAL_SUCCESS;
} }
mal_result mal_format_converter_init_separated(const mal_format_converter_config* pConfig, mal_format_converter_read_separated_proc onRead, void* pUserData, mal_format_converter* pConverter) mal_result mal_format_converter_init_deinterleaved(const mal_format_converter_config* pConfig, mal_format_converter_read_deinterleaved_proc onRead, void* pUserData, mal_format_converter* pConverter)
{ {
mal_result result = mal_format_converter_init__common(pConfig, pUserData, pConverter); mal_result result = mal_format_converter_init__common(pConfig, pUserData, pConverter);
if (result != MAL_SUCCESS) { if (result != MAL_SUCCESS) {
return result; return result;
} }
pConverter->onReadSeparated = onRead; pConverter->onReadDeinterleaved = onRead;
return MAL_SUCCESS; return MAL_SUCCESS;
} }
...@@ -16931,7 +16931,7 @@ mal_uint64 mal_format_converter_read_frames(mal_format_converter* pConverter, ma ...@@ -16931,7 +16931,7 @@ mal_uint64 mal_format_converter_read_frames(mal_format_converter* pConverter, ma
} }
} }
} else { } else {
// Input data is separated. If a conversion is required we need to do an intermediary step. // Input data is deinterleaved. If a conversion is required we need to do an intermediary step.
mal_uint8 tempSamplesOfOutFormat[MAL_MAX_CHANNELS][MAL_MAX_PCM_SAMPLE_SIZE_IN_BYTES * 128]; mal_uint8 tempSamplesOfOutFormat[MAL_MAX_CHANNELS][MAL_MAX_PCM_SAMPLE_SIZE_IN_BYTES * 128];
mal_assert(sizeof(tempSamplesOfOutFormat[0]) <= 0xFFFFFFFFF); mal_assert(sizeof(tempSamplesOfOutFormat[0]) <= 0xFFFFFFFFF);
...@@ -16953,7 +16953,7 @@ mal_uint64 mal_format_converter_read_frames(mal_format_converter* pConverter, ma ...@@ -16953,7 +16953,7 @@ mal_uint64 mal_format_converter_read_frames(mal_format_converter* pConverter, ma
if (pConverter->config.formatIn == pConverter->config.formatOut) { if (pConverter->config.formatIn == pConverter->config.formatOut) {
// Only interleaving. // Only interleaving.
framesJustRead = (mal_uint32)pConverter->onReadSeparated(pConverter, (mal_uint32)framesToReadRightNow, ppTempSampleOfOutFormat, pConverter->pUserData); framesJustRead = (mal_uint32)pConverter->onReadDeinterleaved(pConverter, (mal_uint32)framesToReadRightNow, ppTempSampleOfOutFormat, pConverter->pUserData);
if (framesJustRead == 0) { if (framesJustRead == 0) {
break; break;
} }
...@@ -16967,7 +16967,7 @@ mal_uint64 mal_format_converter_read_frames(mal_format_converter* pConverter, ma ...@@ -16967,7 +16967,7 @@ mal_uint64 mal_format_converter_read_frames(mal_format_converter* pConverter, ma
} }
framesJustRead = (mal_uint32)pConverter->onReadSeparated(pConverter, (mal_uint32)framesToReadRightNow, ppTempSampleOfInFormat, pConverter->pUserData); framesJustRead = (mal_uint32)pConverter->onReadDeinterleaved(pConverter, (mal_uint32)framesToReadRightNow, ppTempSampleOfInFormat, pConverter->pUserData);
if (framesJustRead == 0) { if (framesJustRead == 0) {
break; break;
} }
...@@ -16987,7 +16987,7 @@ mal_uint64 mal_format_converter_read_frames(mal_format_converter* pConverter, ma ...@@ -16987,7 +16987,7 @@ mal_uint64 mal_format_converter_read_frames(mal_format_converter* pConverter, ma
return totalFramesRead; return totalFramesRead;
} }
mal_uint64 mal_format_converter_read_frames_separated(mal_format_converter* pConverter, mal_uint64 frameCount, void** ppSamplesOut) mal_uint64 mal_format_converter_read_frames_deinterleaved(mal_format_converter* pConverter, mal_uint64 frameCount, void** ppSamplesOut)
{ {
if (pConverter == NULL || ppSamplesOut == NULL) { if (pConverter == NULL || ppSamplesOut == NULL) {
return 0; return 0;
...@@ -17042,7 +17042,7 @@ mal_uint64 mal_format_converter_read_frames_separated(mal_format_converter* pCon ...@@ -17042,7 +17042,7 @@ mal_uint64 mal_format_converter_read_frames_separated(mal_format_converter* pCon
} }
} }
} else { } else {
// Input data is separated. // Input data is deinterleaved.
if (pConverter->config.formatIn == pConverter->config.formatOut) { if (pConverter->config.formatIn == pConverter->config.formatOut) {
// Pass through. // Pass through.
while (totalFramesRead < frameCount) { while (totalFramesRead < frameCount) {
...@@ -17052,7 +17052,7 @@ mal_uint64 mal_format_converter_read_frames_separated(mal_format_converter* pCon ...@@ -17052,7 +17052,7 @@ mal_uint64 mal_format_converter_read_frames_separated(mal_format_converter* pCon
framesToReadRightNow = 0xFFFFFFFF; framesToReadRightNow = 0xFFFFFFFF;
} }
mal_uint32 framesJustRead = (mal_uint32)pConverter->onReadSeparated(pConverter, (mal_uint32)framesToReadRightNow, (void**)ppNextSamplesOut, pConverter->pUserData); mal_uint32 framesJustRead = (mal_uint32)pConverter->onReadDeinterleaved(pConverter, (mal_uint32)framesToReadRightNow, (void**)ppNextSamplesOut, pConverter->pUserData);
if (framesJustRead == 0) { if (framesJustRead == 0) {
break; break;
} }
...@@ -17081,7 +17081,7 @@ mal_uint64 mal_format_converter_read_frames_separated(mal_format_converter* pCon ...@@ -17081,7 +17081,7 @@ mal_uint64 mal_format_converter_read_frames_separated(mal_format_converter* pCon
framesToReadRightNow = maxFramesToReadAtATime; framesToReadRightNow = maxFramesToReadAtATime;
} }
mal_uint32 framesJustRead = (mal_uint32)pConverter->onReadSeparated(pConverter, (mal_uint32)framesToReadRightNow, ppTemp, pConverter->pUserData); mal_uint32 framesJustRead = (mal_uint32)pConverter->onReadDeinterleaved(pConverter, (mal_uint32)framesToReadRightNow, ppTemp, pConverter->pUserData);
if (framesJustRead == 0) { if (framesJustRead == 0) {
break; break;
} }
...@@ -17654,7 +17654,7 @@ mal_result mal_channel_router_init__common(const mal_channel_router_config* pCon ...@@ -17654,7 +17654,7 @@ mal_result mal_channel_router_init__common(const mal_channel_router_config* pCon
return MAL_SUCCESS; return MAL_SUCCESS;
} }
mal_result mal_channel_router_init_separated(const mal_channel_router_config* pConfig, mal_channel_router_read_separated_proc onRead, void* pUserData, mal_channel_router* pRouter) mal_result mal_channel_router_init_deinterleaved(const mal_channel_router_config* pConfig, mal_channel_router_read_deinterleaved_proc onRead, void* pUserData, mal_channel_router* pRouter)
{ {
mal_result result = mal_channel_router_init__common(pConfig, pUserData, pRouter); mal_result result = mal_channel_router_init__common(pConfig, pUserData, pRouter);
if (result != MAL_SUCCESS) { if (result != MAL_SUCCESS) {
...@@ -17665,7 +17665,7 @@ mal_result mal_channel_router_init_separated(const mal_channel_router_config* pC ...@@ -17665,7 +17665,7 @@ mal_result mal_channel_router_init_separated(const mal_channel_router_config* pC
return MAL_INVALID_ARGS; return MAL_INVALID_ARGS;
} }
pRouter->onReadSeparated = onRead; pRouter->onReadDeinterleaved = onRead;
return MAL_SUCCESS; return MAL_SUCCESS;
} }
...@@ -17701,7 +17701,7 @@ void mal_channel_router__do_routing(mal_channel_router* pRouter, mal_uint64 fram ...@@ -17701,7 +17701,7 @@ void mal_channel_router__do_routing(mal_channel_router* pRouter, mal_uint64 fram
} }
} }
mal_uint64 mal_channel_router_read_frames_separated(mal_channel_router* pRouter, mal_uint64 frameCount, void** ppSamplesOut) mal_uint64 mal_channel_router_read_frames_deinterleaved(mal_channel_router* pRouter, mal_uint64 frameCount, void** ppSamplesOut)
{ {
if (pRouter == NULL || ppSamplesOut == NULL) { if (pRouter == NULL || ppSamplesOut == NULL) {
return 0; return 0;
...@@ -17710,7 +17710,7 @@ mal_uint64 mal_channel_router_read_frames_separated(mal_channel_router* pRouter, ...@@ -17710,7 +17710,7 @@ mal_uint64 mal_channel_router_read_frames_separated(mal_channel_router* pRouter,
// Fast path for a passthrough. // Fast path for a passthrough.
if (pRouter->isPassthrough) { if (pRouter->isPassthrough) {
if (frameCount <= 0xFFFFFFFF) { if (frameCount <= 0xFFFFFFFF) {
return (mal_uint32)pRouter->onReadSeparated(pRouter, (mal_uint32)frameCount, ppSamplesOut, pRouter->pUserData); return (mal_uint32)pRouter->onReadDeinterleaved(pRouter, (mal_uint32)frameCount, ppSamplesOut, pRouter->pUserData);
} else { } else {
float* ppNextSamplesOut[MAL_MAX_CHANNELS]; float* ppNextSamplesOut[MAL_MAX_CHANNELS];
mal_copy_memory(ppNextSamplesOut, ppSamplesOut, sizeof(float*) * pRouter->config.channelsOut); mal_copy_memory(ppNextSamplesOut, ppSamplesOut, sizeof(float*) * pRouter->config.channelsOut);
...@@ -17723,7 +17723,7 @@ mal_uint64 mal_channel_router_read_frames_separated(mal_channel_router* pRouter, ...@@ -17723,7 +17723,7 @@ mal_uint64 mal_channel_router_read_frames_separated(mal_channel_router* pRouter,
framesToReadRightNow = 0xFFFFFFFF; framesToReadRightNow = 0xFFFFFFFF;
} }
mal_uint32 framesJustRead = (mal_uint32)pRouter->onReadSeparated(pRouter, (mal_uint32)framesToReadRightNow, (void**)ppNextSamplesOut, pRouter->pUserData); mal_uint32 framesJustRead = (mal_uint32)pRouter->onReadDeinterleaved(pRouter, (mal_uint32)framesToReadRightNow, (void**)ppNextSamplesOut, pRouter->pUserData);
if (framesJustRead == 0) { if (framesJustRead == 0) {
break; break;
} }
...@@ -17758,7 +17758,7 @@ mal_uint64 mal_channel_router_read_frames_separated(mal_channel_router* pRouter, ...@@ -17758,7 +17758,7 @@ mal_uint64 mal_channel_router_read_frames_separated(mal_channel_router* pRouter,
framesToReadRightNow = maxFramesToReadEachIteration; framesToReadRightNow = maxFramesToReadEachIteration;
} }
mal_uint32 framesJustRead = pRouter->onReadSeparated(pRouter, (mal_uint32)framesToReadRightNow, (void**)ppTemp, pRouter->pUserData); mal_uint32 framesJustRead = pRouter->onReadDeinterleaved(pRouter, (mal_uint32)framesToReadRightNow, (void**)ppTemp, pRouter->pUserData);
if (framesJustRead == 0) { if (framesJustRead == 0) {
break; break;
} }
......
...@@ -657,20 +657,20 @@ int do_format_conversion_tests() ...@@ -657,20 +657,20 @@ int do_format_conversion_tests()
} }
int compare_interleaved_and_separated_buffers(const void* interleaved, const void** separated, mal_uint32 frameCount, mal_uint32 channels, mal_format format) int compare_interleaved_and_deinterleaved_buffers(const void* interleaved, const void** deinterleaved, mal_uint32 frameCount, mal_uint32 channels, mal_format format)
{ {
mal_uint32 bytesPerSample = mal_get_bytes_per_sample(format); mal_uint32 bytesPerSample = mal_get_bytes_per_sample(format);
const mal_uint8* interleaved8 = (const mal_uint8*)interleaved; const mal_uint8* interleaved8 = (const mal_uint8*)interleaved;
const mal_uint8** separated8 = (const mal_uint8**)separated; const mal_uint8** deinterleaved8 = (const mal_uint8**)deinterleaved;
for (mal_uint32 iFrame = 0; iFrame < frameCount; iFrame += 1) { for (mal_uint32 iFrame = 0; iFrame < frameCount; iFrame += 1) {
const mal_uint8* interleavedFrame = interleaved8 + iFrame*channels*bytesPerSample; const mal_uint8* interleavedFrame = interleaved8 + iFrame*channels*bytesPerSample;
for (mal_uint32 iChannel = 0; iChannel < channels; iChannel += 1) { for (mal_uint32 iChannel = 0; iChannel < channels; iChannel += 1) {
const mal_uint8* separatedFrame = separated8[iChannel] + iFrame*bytesPerSample; const mal_uint8* deinterleavedFrame = deinterleaved8[iChannel] + iFrame*bytesPerSample;
int result = memcmp(interleavedFrame + iChannel*bytesPerSample, separatedFrame, bytesPerSample); int result = memcmp(interleavedFrame + iChannel*bytesPerSample, deinterleavedFrame, bytesPerSample);
if (result != 0) { if (result != 0) {
return -1; return -1;
} }
...@@ -715,16 +715,16 @@ int do_interleaving_test(mal_format format) ...@@ -715,16 +715,16 @@ int do_interleaving_test(mal_format format)
// Interleave. // Interleave.
mal_pcm_interleave_u8__reference(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration); mal_pcm_interleave_u8__reference(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration);
if (compare_interleaved_and_separated_buffers(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration, format) != 0) { if (compare_interleaved_and_deinterleaved_buffers(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration, format) != 0) {
printf("FAILED. Separated to Interleaved (Channels = %u)\n", i); printf("FAILED. Deinterleaved to Interleaved (Channels = %u)\n", i);
result = -1; result = -1;
break; break;
} }
// Deinterleave. // Deinterleave.
mal_pcm_deinterleave_u8__reference((void**)ppDst, dsti, frameCount, channelCountForThisIteration); mal_pcm_deinterleave_u8__reference((void**)ppDst, dsti, frameCount, channelCountForThisIteration);
if (compare_interleaved_and_separated_buffers(dsti, (const void**)ppDst, frameCount, channelCountForThisIteration, format) != 0) { if (compare_interleaved_and_deinterleaved_buffers(dsti, (const void**)ppDst, frameCount, channelCountForThisIteration, format) != 0) {
printf("FAILED. Interleaved to Separated (Channels = %u)\n", i); printf("FAILED. Interleaved to Deinterleaved (Channels = %u)\n", i);
result = -1; result = -1;
break; break;
} }
...@@ -756,16 +756,16 @@ int do_interleaving_test(mal_format format) ...@@ -756,16 +756,16 @@ int do_interleaving_test(mal_format format)
// Interleave. // Interleave.
mal_pcm_interleave_s16__reference(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration); mal_pcm_interleave_s16__reference(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration);
if (compare_interleaved_and_separated_buffers(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration, format) != 0) { if (compare_interleaved_and_deinterleaved_buffers(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration, format) != 0) {
printf("FAILED. Separated to Interleaved (Channels = %u)\n", i); printf("FAILED. Deinterleaved to Interleaved (Channels = %u)\n", i);
result = -1; result = -1;
break; break;
} }
// Deinterleave. // Deinterleave.
mal_pcm_deinterleave_s16__reference((void**)ppDst, dsti, frameCount, channelCountForThisIteration); mal_pcm_deinterleave_s16__reference((void**)ppDst, dsti, frameCount, channelCountForThisIteration);
if (compare_interleaved_and_separated_buffers(dsti, (const void**)ppDst, frameCount, channelCountForThisIteration, format) != 0) { if (compare_interleaved_and_deinterleaved_buffers(dsti, (const void**)ppDst, frameCount, channelCountForThisIteration, format) != 0) {
printf("FAILED. Interleaved to Separated (Channels = %u)\n", i); printf("FAILED. Interleaved to Deinterleaved (Channels = %u)\n", i);
result = -1; result = -1;
break; break;
} }
...@@ -799,16 +799,16 @@ int do_interleaving_test(mal_format format) ...@@ -799,16 +799,16 @@ int do_interleaving_test(mal_format format)
// Interleave. // Interleave.
mal_pcm_interleave_s24__reference(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration); mal_pcm_interleave_s24__reference(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration);
if (compare_interleaved_and_separated_buffers(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration, format) != 0) { if (compare_interleaved_and_deinterleaved_buffers(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration, format) != 0) {
printf("FAILED. Separated to Interleaved (Channels = %u)\n", channelCountForThisIteration); printf("FAILED. Deinterleaved to Interleaved (Channels = %u)\n", channelCountForThisIteration);
result = -1; result = -1;
break; break;
} }
// Deinterleave. // Deinterleave.
mal_pcm_deinterleave_s24__reference((void**)ppDst, dsti, frameCount, channelCountForThisIteration); mal_pcm_deinterleave_s24__reference((void**)ppDst, dsti, frameCount, channelCountForThisIteration);
if (compare_interleaved_and_separated_buffers(dsti, (const void**)ppDst, frameCount, channelCountForThisIteration, format) != 0) { if (compare_interleaved_and_deinterleaved_buffers(dsti, (const void**)ppDst, frameCount, channelCountForThisIteration, format) != 0) {
printf("FAILED. Interleaved to Separated (Channels = %u)\n", channelCountForThisIteration); printf("FAILED. Interleaved to Deinterleaved (Channels = %u)\n", channelCountForThisIteration);
result = -1; result = -1;
break; break;
} }
...@@ -840,16 +840,16 @@ int do_interleaving_test(mal_format format) ...@@ -840,16 +840,16 @@ int do_interleaving_test(mal_format format)
// Interleave. // Interleave.
mal_pcm_interleave_s32__reference(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration); mal_pcm_interleave_s32__reference(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration);
if (compare_interleaved_and_separated_buffers(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration, format) != 0) { if (compare_interleaved_and_deinterleaved_buffers(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration, format) != 0) {
printf("FAILED. Separated to Interleaved (Channels = %u)\n", i); printf("FAILED. Deinterleaved to Interleaved (Channels = %u)\n", i);
result = -1; result = -1;
break; break;
} }
// Deinterleave. // Deinterleave.
mal_pcm_deinterleave_s32__reference((void**)ppDst, dsti, frameCount, channelCountForThisIteration); mal_pcm_deinterleave_s32__reference((void**)ppDst, dsti, frameCount, channelCountForThisIteration);
if (compare_interleaved_and_separated_buffers(dsti, (const void**)ppDst, frameCount, channelCountForThisIteration, format) != 0) { if (compare_interleaved_and_deinterleaved_buffers(dsti, (const void**)ppDst, frameCount, channelCountForThisIteration, format) != 0) {
printf("FAILED. Interleaved to Separated (Channels = %u)\n", i); printf("FAILED. Interleaved to Deinterleaved (Channels = %u)\n", i);
result = -1; result = -1;
break; break;
} }
...@@ -881,16 +881,16 @@ int do_interleaving_test(mal_format format) ...@@ -881,16 +881,16 @@ int do_interleaving_test(mal_format format)
// Interleave. // Interleave.
mal_pcm_interleave_f32__reference(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration); mal_pcm_interleave_f32__reference(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration);
if (compare_interleaved_and_separated_buffers(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration, format) != 0) { if (compare_interleaved_and_deinterleaved_buffers(dsti, (const void**)ppSrc, frameCount, channelCountForThisIteration, format) != 0) {
printf("FAILED. Separated to Interleaved (Channels = %u)\n", i); printf("FAILED. Deinterleaved to Interleaved (Channels = %u)\n", i);
result = -1; result = -1;
break; break;
} }
// Deinterleave. // Deinterleave.
mal_pcm_deinterleave_f32__reference((void**)ppDst, dsti, frameCount, channelCountForThisIteration); mal_pcm_deinterleave_f32__reference((void**)ppDst, dsti, frameCount, channelCountForThisIteration);
if (compare_interleaved_and_separated_buffers(dsti, (const void**)ppDst, frameCount, channelCountForThisIteration, format) != 0) { if (compare_interleaved_and_deinterleaved_buffers(dsti, (const void**)ppDst, frameCount, channelCountForThisIteration, format) != 0) {
printf("FAILED. Interleaved to Separated (Channels = %u)\n", i); printf("FAILED. Interleaved to Deinterleaved (Channels = %u)\n", i);
result = -1; result = -1;
break; break;
} }
...@@ -964,7 +964,7 @@ mal_uint32 converter_test_interleaved_callback(mal_format_converter* pConverter, ...@@ -964,7 +964,7 @@ mal_uint32 converter_test_interleaved_callback(mal_format_converter* pConverter,
return frameCount; return frameCount;
} }
mal_uint32 converter_test_separated_callback(mal_format_converter* pConverter, mal_uint32 frameCount, void** ppSamplesOut, void* pUserData) mal_uint32 converter_test_deinterleaved_callback(mal_format_converter* pConverter, mal_uint32 frameCount, void** ppSamplesOut, void* pUserData)
{ {
mal_sine_wave* pSineWave = (mal_sine_wave*)pUserData; mal_sine_wave* pSineWave = (mal_sine_wave*)pUserData;
mal_assert(pSineWave != NULL); mal_assert(pSineWave != NULL);
...@@ -1034,13 +1034,13 @@ int do_format_converter_tests() ...@@ -1034,13 +1034,13 @@ int do_format_converter_tests()
return -1; return -1;
} }
mal_int16 separatedFrames[MAL_MAX_CHANNELS][1024]; mal_int16 deinterleavedFrames[MAL_MAX_CHANNELS][1024];
void* ppSeparatedFrames[MAL_MAX_CHANNELS]; void* ppDeinterleavedFrames[MAL_MAX_CHANNELS];
for (mal_uint32 iChannel = 0; iChannel < converter.config.channels; iChannel += 1) { for (mal_uint32 iChannel = 0; iChannel < converter.config.channels; iChannel += 1) {
ppSeparatedFrames[iChannel] = &separatedFrames[iChannel]; ppDeinterleavedFrames[iChannel] = &deinterleavedFrames[iChannel];
} }
mal_uint64 framesRead = mal_format_converter_read_frames_separated(&converter, 1024, ppSeparatedFrames); mal_uint64 framesRead = mal_format_converter_read_frames_deinterleaved(&converter, 1024, ppDeinterleavedFrames);
if (framesRead != 1024) { if (framesRead != 1024) {
printf("Failed to read interleaved data from converter.\n"); printf("Failed to read interleaved data from converter.\n");
return -1; return -1;
...@@ -1057,7 +1057,7 @@ int do_format_converter_tests() ...@@ -1057,7 +1057,7 @@ int do_format_converter_tests()
return -1; return -1;
} }
fwrite(ppSeparatedFrames[iChannel], sizeof(mal_int16), framesRead, pFile); fwrite(ppDeinterleavedFrames[iChannel], sizeof(mal_int16), framesRead, pFile);
fclose(pFile); fclose(pFile);
} }
} }
...@@ -1065,7 +1065,7 @@ int do_format_converter_tests() ...@@ -1065,7 +1065,7 @@ int do_format_converter_tests()
// Deinterleaved/Interleaved f32 to s16. // Deinterleaved/Interleaved f32 to s16.
{ {
mal_sine_wave_init(amplitude, periodsPerSecond, sampleRate, &sineWave); mal_sine_wave_init(amplitude, periodsPerSecond, sampleRate, &sineWave);
result = mal_format_converter_init_separated(&config, converter_test_separated_callback, &sineWave, &converter); result = mal_format_converter_init_deinterleaved(&config, converter_test_deinterleaved_callback, &sineWave, &converter);
if (result != MAL_SUCCESS) { if (result != MAL_SUCCESS) {
printf("Failed to initialize converter.\n"); printf("Failed to initialize converter.\n");
return -1; return -1;
...@@ -1091,19 +1091,19 @@ int do_format_converter_tests() ...@@ -1091,19 +1091,19 @@ int do_format_converter_tests()
// Deinterleaved/Deinterleaved f32 to s16. // Deinterleaved/Deinterleaved f32 to s16.
{ {
mal_sine_wave_init(amplitude, periodsPerSecond, sampleRate, &sineWave); mal_sine_wave_init(amplitude, periodsPerSecond, sampleRate, &sineWave);
result = mal_format_converter_init_separated(&config, converter_test_separated_callback, &sineWave, &converter); result = mal_format_converter_init_deinterleaved(&config, converter_test_deinterleaved_callback, &sineWave, &converter);
if (result != MAL_SUCCESS) { if (result != MAL_SUCCESS) {
printf("Failed to initialize converter.\n"); printf("Failed to initialize converter.\n");
return -1; return -1;
} }
mal_int16 separatedFrames[MAL_MAX_CHANNELS][1024]; mal_int16 deinterleavedFrames[MAL_MAX_CHANNELS][1024];
void* ppSeparatedFrames[MAL_MAX_CHANNELS]; void* ppDeinterleavedFrames[MAL_MAX_CHANNELS];
for (mal_uint32 iChannel = 0; iChannel < converter.config.channels; iChannel += 1) { for (mal_uint32 iChannel = 0; iChannel < converter.config.channels; iChannel += 1) {
ppSeparatedFrames[iChannel] = &separatedFrames[iChannel]; ppDeinterleavedFrames[iChannel] = &deinterleavedFrames[iChannel];
} }
mal_uint64 framesRead = mal_format_converter_read_frames_separated(&converter, 1024, ppSeparatedFrames); mal_uint64 framesRead = mal_format_converter_read_frames_deinterleaved(&converter, 1024, ppDeinterleavedFrames);
if (framesRead != 1024) { if (framesRead != 1024) {
printf("Failed to read interleaved data from converter.\n"); printf("Failed to read interleaved data from converter.\n");
return -1; return -1;
...@@ -1120,7 +1120,7 @@ int do_format_converter_tests() ...@@ -1120,7 +1120,7 @@ int do_format_converter_tests()
return -1; return -1;
} }
fwrite(ppSeparatedFrames[iChannel], sizeof(mal_int16), framesRead, pFile); fwrite(ppDeinterleavedFrames[iChannel], sizeof(mal_int16), framesRead, pFile);
fclose(pFile); fclose(pFile);
} }
} }
...@@ -1164,13 +1164,13 @@ int do_format_converter_tests() ...@@ -1164,13 +1164,13 @@ int do_format_converter_tests()
return -1; return -1;
} }
float separatedFrames[MAL_MAX_CHANNELS][1024]; float deinterleavedFrames[MAL_MAX_CHANNELS][1024];
void* ppSeparatedFrames[MAL_MAX_CHANNELS]; void* ppDeinterleavedFrames[MAL_MAX_CHANNELS];
for (mal_uint32 iChannel = 0; iChannel < converter.config.channels; iChannel += 1) { for (mal_uint32 iChannel = 0; iChannel < converter.config.channels; iChannel += 1) {
ppSeparatedFrames[iChannel] = &separatedFrames[iChannel]; ppDeinterleavedFrames[iChannel] = &deinterleavedFrames[iChannel];
} }
mal_uint64 framesRead = mal_format_converter_read_frames_separated(&converter, 1024, ppSeparatedFrames); mal_uint64 framesRead = mal_format_converter_read_frames_deinterleaved(&converter, 1024, ppDeinterleavedFrames);
if (framesRead != 1024) { if (framesRead != 1024) {
printf("Failed to read interleaved data from converter.\n"); printf("Failed to read interleaved data from converter.\n");
return -1; return -1;
...@@ -1187,7 +1187,7 @@ int do_format_converter_tests() ...@@ -1187,7 +1187,7 @@ int do_format_converter_tests()
return -1; return -1;
} }
fwrite(ppSeparatedFrames[iChannel], sizeof(float), framesRead, pFile); fwrite(ppDeinterleavedFrames[iChannel], sizeof(float), framesRead, pFile);
fclose(pFile); fclose(pFile);
} }
} }
...@@ -1195,7 +1195,7 @@ int do_format_converter_tests() ...@@ -1195,7 +1195,7 @@ int do_format_converter_tests()
// Deinterleaved/Interleaved f32 to f32. // Deinterleaved/Interleaved f32 to f32.
{ {
mal_sine_wave_init(amplitude, periodsPerSecond, sampleRate, &sineWave); mal_sine_wave_init(amplitude, periodsPerSecond, sampleRate, &sineWave);
result = mal_format_converter_init_separated(&config, converter_test_separated_callback, &sineWave, &converter); result = mal_format_converter_init_deinterleaved(&config, converter_test_deinterleaved_callback, &sineWave, &converter);
if (result != MAL_SUCCESS) { if (result != MAL_SUCCESS) {
printf("Failed to initialize converter.\n"); printf("Failed to initialize converter.\n");
return -1; return -1;
...@@ -1221,19 +1221,19 @@ int do_format_converter_tests() ...@@ -1221,19 +1221,19 @@ int do_format_converter_tests()
// Deinterleaved/Deinterleaved f32 to f32. // Deinterleaved/Deinterleaved f32 to f32.
{ {
mal_sine_wave_init(amplitude, periodsPerSecond, sampleRate, &sineWave); mal_sine_wave_init(amplitude, periodsPerSecond, sampleRate, &sineWave);
result = mal_format_converter_init_separated(&config, converter_test_separated_callback, &sineWave, &converter); result = mal_format_converter_init_deinterleaved(&config, converter_test_deinterleaved_callback, &sineWave, &converter);
if (result != MAL_SUCCESS) { if (result != MAL_SUCCESS) {
printf("Failed to initialize converter.\n"); printf("Failed to initialize converter.\n");
return -1; return -1;
} }
float separatedFrames[MAL_MAX_CHANNELS][1024]; float deinterleavedFrames[MAL_MAX_CHANNELS][1024];
void* ppSeparatedFrames[MAL_MAX_CHANNELS]; void* ppDeinterleavedFrames[MAL_MAX_CHANNELS];
for (mal_uint32 iChannel = 0; iChannel < converter.config.channels; iChannel += 1) { for (mal_uint32 iChannel = 0; iChannel < converter.config.channels; iChannel += 1) {
ppSeparatedFrames[iChannel] = &separatedFrames[iChannel]; ppDeinterleavedFrames[iChannel] = &deinterleavedFrames[iChannel];
} }
mal_uint64 framesRead = mal_format_converter_read_frames_separated(&converter, 1024, ppSeparatedFrames); mal_uint64 framesRead = mal_format_converter_read_frames_deinterleaved(&converter, 1024, ppDeinterleavedFrames);
if (framesRead != 1024) { if (framesRead != 1024) {
printf("Failed to read interleaved data from converter.\n"); printf("Failed to read interleaved data from converter.\n");
return -1; return -1;
...@@ -1250,7 +1250,7 @@ int do_format_converter_tests() ...@@ -1250,7 +1250,7 @@ int do_format_converter_tests()
return -1; return -1;
} }
fwrite(ppSeparatedFrames[iChannel], sizeof(float), framesRead, pFile); fwrite(ppDeinterleavedFrames[iChannel], sizeof(float), framesRead, pFile);
fclose(pFile); fclose(pFile);
} }
} }
...@@ -1288,7 +1288,7 @@ int do_channel_routing_tests() ...@@ -1288,7 +1288,7 @@ int do_channel_routing_tests()
mal_get_standard_channel_map(mal_standard_channel_map_microsoft, routerConfig.channelsOut, routerConfig.channelMapOut); mal_get_standard_channel_map(mal_standard_channel_map_microsoft, routerConfig.channelsOut, routerConfig.channelMapOut);
mal_channel_router router; mal_channel_router router;
mal_result result = mal_channel_router_init_separated(&routerConfig, channel_router_callback__passthrough_test, NULL, &router); mal_result result = mal_channel_router_init_deinterleaved(&routerConfig, channel_router_callback__passthrough_test, NULL, &router);
if (result == MAL_SUCCESS) { if (result == MAL_SUCCESS) {
if (!router.isPassthrough) { if (!router.isPassthrough) {
printf("Failed to init router as passthrough.\n"); printf("Failed to init router as passthrough.\n");
...@@ -1327,7 +1327,7 @@ int do_channel_routing_tests() ...@@ -1327,7 +1327,7 @@ int do_channel_routing_tests()
} }
} }
mal_channel_router_init_separated(&routerConfig, channel_router_callback__passthrough_test, ppTestData, &router); mal_channel_router_init_deinterleaved(&routerConfig, channel_router_callback__passthrough_test, ppTestData, &router);
float outputA[MAL_MAX_CHANNELS][100]; float outputA[MAL_MAX_CHANNELS][100];
float outputB[MAL_MAX_CHANNELS][100]; float outputB[MAL_MAX_CHANNELS][100];
...@@ -1339,7 +1339,7 @@ int do_channel_routing_tests() ...@@ -1339,7 +1339,7 @@ int do_channel_routing_tests()
} }
// With optimizations. // With optimizations.
mal_uint64 framesRead = mal_channel_router_read_frames_separated(&router, 100, (void**)ppOutputA); mal_uint64 framesRead = mal_channel_router_read_frames_deinterleaved(&router, 100, (void**)ppOutputA);
if (framesRead != 100) { if (framesRead != 100) {
printf("Returned frame count for optimized incorrect."); printf("Returned frame count for optimized incorrect.");
hasError = MAL_TRUE; hasError = MAL_TRUE;
...@@ -1348,7 +1348,7 @@ int do_channel_routing_tests() ...@@ -1348,7 +1348,7 @@ int do_channel_routing_tests()
// Without optimizations. // Without optimizations.
router.isPassthrough = MAL_FALSE; router.isPassthrough = MAL_FALSE;
router.isSimpleShuffle = MAL_FALSE; router.isSimpleShuffle = MAL_FALSE;
framesRead = mal_channel_router_read_frames_separated(&router, 100, (void**)ppOutputB); framesRead = mal_channel_router_read_frames_deinterleaved(&router, 100, (void**)ppOutputB);
if (framesRead != 100) { if (framesRead != 100) {
printf("Returned frame count for unoptimized path incorrect."); printf("Returned frame count for unoptimized path incorrect.");
hasError = MAL_TRUE; hasError = MAL_TRUE;
...@@ -1386,7 +1386,7 @@ int do_channel_routing_tests() ...@@ -1386,7 +1386,7 @@ int do_channel_routing_tests()
} }
mal_channel_router router; mal_channel_router router;
mal_result result = mal_channel_router_init_separated(&routerConfig, channel_router_callback__passthrough_test, NULL, &router); mal_result result = mal_channel_router_init_deinterleaved(&routerConfig, channel_router_callback__passthrough_test, NULL, &router);
if (result == MAL_SUCCESS) { if (result == MAL_SUCCESS) {
if (router.isPassthrough) { if (router.isPassthrough) {
printf("Router incorrectly configured as a passthrough.\n"); printf("Router incorrectly configured as a passthrough.\n");
...@@ -1429,7 +1429,7 @@ int do_channel_routing_tests() ...@@ -1429,7 +1429,7 @@ int do_channel_routing_tests()
} }
} }
mal_channel_router_init_separated(&routerConfig, channel_router_callback__passthrough_test, ppTestData, &router); mal_channel_router_init_deinterleaved(&routerConfig, channel_router_callback__passthrough_test, ppTestData, &router);
float outputA[MAL_MAX_CHANNELS][100]; float outputA[MAL_MAX_CHANNELS][100];
float outputB[MAL_MAX_CHANNELS][100]; float outputB[MAL_MAX_CHANNELS][100];
...@@ -1441,7 +1441,7 @@ int do_channel_routing_tests() ...@@ -1441,7 +1441,7 @@ int do_channel_routing_tests()
} }
// With optimizations. // With optimizations.
mal_uint64 framesRead = mal_channel_router_read_frames_separated(&router, 100, (void**)ppOutputA); mal_uint64 framesRead = mal_channel_router_read_frames_deinterleaved(&router, 100, (void**)ppOutputA);
if (framesRead != 100) { if (framesRead != 100) {
printf("Returned frame count for optimized incorrect."); printf("Returned frame count for optimized incorrect.");
hasError = MAL_TRUE; hasError = MAL_TRUE;
...@@ -1450,7 +1450,7 @@ int do_channel_routing_tests() ...@@ -1450,7 +1450,7 @@ int do_channel_routing_tests()
// Without optimizations. // Without optimizations.
router.isPassthrough = MAL_FALSE; router.isPassthrough = MAL_FALSE;
router.isSimpleShuffle = MAL_FALSE; router.isSimpleShuffle = MAL_FALSE;
framesRead = mal_channel_router_read_frames_separated(&router, 100, (void**)ppOutputB); framesRead = mal_channel_router_read_frames_deinterleaved(&router, 100, (void**)ppOutputB);
if (framesRead != 100) { if (framesRead != 100) {
printf("Returned frame count for unoptimized path incorrect."); printf("Returned frame count for unoptimized path incorrect.");
hasError = MAL_TRUE; hasError = MAL_TRUE;
...@@ -1486,7 +1486,7 @@ int do_channel_routing_tests() ...@@ -1486,7 +1486,7 @@ int do_channel_routing_tests()
mal_get_standard_channel_map(mal_standard_channel_map_microsoft, routerConfig.channelsOut, routerConfig.channelMapOut); mal_get_standard_channel_map(mal_standard_channel_map_microsoft, routerConfig.channelsOut, routerConfig.channelMapOut);
mal_channel_router router; mal_channel_router router;
mal_result result = mal_channel_router_init_separated(&routerConfig, channel_router_callback__passthrough_test, NULL, &router); mal_result result = mal_channel_router_init_deinterleaved(&routerConfig, channel_router_callback__passthrough_test, NULL, &router);
if (result == MAL_SUCCESS) { if (result == MAL_SUCCESS) {
if (router.isPassthrough) { if (router.isPassthrough) {
printf("Router incorrectly configured as a passthrough.\n"); printf("Router incorrectly configured as a passthrough.\n");
...@@ -1532,7 +1532,7 @@ int do_channel_routing_tests() ...@@ -1532,7 +1532,7 @@ int do_channel_routing_tests()
mal_get_standard_channel_map(mal_standard_channel_map_microsoft, routerConfig.channelsOut, routerConfig.channelMapOut); mal_get_standard_channel_map(mal_standard_channel_map_microsoft, routerConfig.channelsOut, routerConfig.channelMapOut);
mal_channel_router router; mal_channel_router router;
mal_result result = mal_channel_router_init_separated(&routerConfig, channel_router_callback__passthrough_test, NULL, &router); mal_result result = mal_channel_router_init_deinterleaved(&routerConfig, channel_router_callback__passthrough_test, NULL, &router);
if (result == MAL_SUCCESS) { if (result == MAL_SUCCESS) {
if (router.isPassthrough) { if (router.isPassthrough) {
printf("Router incorrectly configured as a passthrough.\n"); printf("Router incorrectly configured as a passthrough.\n");
...@@ -1589,7 +1589,7 @@ int do_channel_routing_tests() ...@@ -1589,7 +1589,7 @@ int do_channel_routing_tests()
routerConfig.channelMapOut[7] = MAL_CHANNEL_SIDE_RIGHT; routerConfig.channelMapOut[7] = MAL_CHANNEL_SIDE_RIGHT;
mal_channel_router router; mal_channel_router router;
mal_result result = mal_channel_router_init_separated(&routerConfig, channel_router_callback__passthrough_test, NULL, &router); mal_result result = mal_channel_router_init_deinterleaved(&routerConfig, channel_router_callback__passthrough_test, NULL, &router);
if (result == MAL_SUCCESS) { if (result == MAL_SUCCESS) {
if (router.isPassthrough) { if (router.isPassthrough) {
printf("Router incorrectly configured as a passthrough.\n"); printf("Router incorrectly configured as a passthrough.\n");
...@@ -1645,7 +1645,7 @@ int do_channel_routing_tests() ...@@ -1645,7 +1645,7 @@ int do_channel_routing_tests()
ppTestData[1][iFrame] = +1; ppTestData[1][iFrame] = +1;
} }
mal_channel_router_init_separated(&routerConfig, channel_router_callback__passthrough_test, ppTestData, &router); mal_channel_router_init_deinterleaved(&routerConfig, channel_router_callback__passthrough_test, ppTestData, &router);
float output[MAL_MAX_CHANNELS][100]; float output[MAL_MAX_CHANNELS][100];
float* ppOutput[MAL_MAX_CHANNELS]; float* ppOutput[MAL_MAX_CHANNELS];
...@@ -1653,7 +1653,7 @@ int do_channel_routing_tests() ...@@ -1653,7 +1653,7 @@ int do_channel_routing_tests()
ppOutput[iChannel] = output[iChannel]; ppOutput[iChannel] = output[iChannel];
} }
mal_uint64 framesRead = mal_channel_router_read_frames_separated(&router, 100, (void**)ppOutput); mal_uint64 framesRead = mal_channel_router_read_frames_deinterleaved(&router, 100, (void**)ppOutput);
if (framesRead != 100) { if (framesRead != 100) {
printf("Returned frame count for optimized incorrect.\n"); printf("Returned frame count for optimized incorrect.\n");
hasError = MAL_TRUE; hasError = MAL_TRUE;
...@@ -1704,7 +1704,7 @@ int do_channel_routing_tests() ...@@ -1704,7 +1704,7 @@ int do_channel_routing_tests()
routerConfig.channelMapOut[1] = MAL_CHANNEL_FRONT_RIGHT; routerConfig.channelMapOut[1] = MAL_CHANNEL_FRONT_RIGHT;
mal_channel_router router; mal_channel_router router;
mal_result result = mal_channel_router_init_separated(&routerConfig, channel_router_callback__passthrough_test, NULL, &router); mal_result result = mal_channel_router_init_deinterleaved(&routerConfig, channel_router_callback__passthrough_test, NULL, &router);
if (result == MAL_SUCCESS) { if (result == MAL_SUCCESS) {
if (router.isPassthrough) { if (router.isPassthrough) {
printf("Router incorrectly configured as a passthrough.\n"); printf("Router incorrectly configured as a passthrough.\n");
...@@ -1769,7 +1769,7 @@ int do_channel_routing_tests() ...@@ -1769,7 +1769,7 @@ int do_channel_routing_tests()
routerConfig.channelMapOut[3] = MAL_CHANNEL_LFE; routerConfig.channelMapOut[3] = MAL_CHANNEL_LFE;
mal_channel_router router; mal_channel_router router;
mal_result result = mal_channel_router_init_separated(&routerConfig, channel_router_callback__passthrough_test, NULL, &router); mal_result result = mal_channel_router_init_deinterleaved(&routerConfig, channel_router_callback__passthrough_test, NULL, &router);
if (result == MAL_SUCCESS) { if (result == MAL_SUCCESS) {
if (router.isPassthrough) { if (router.isPassthrough) {
printf("Router incorrectly configured as a passthrough.\n"); printf("Router incorrectly configured as a passthrough.\n");
...@@ -1822,7 +1822,7 @@ int do_channel_routing_tests() ...@@ -1822,7 +1822,7 @@ int do_channel_routing_tests()
routerConfig.channelMapOut[0] = MAL_CHANNEL_MONO; routerConfig.channelMapOut[0] = MAL_CHANNEL_MONO;
mal_channel_router router; mal_channel_router router;
mal_result result = mal_channel_router_init_separated(&routerConfig, channel_router_callback__passthrough_test, NULL, &router); mal_result result = mal_channel_router_init_deinterleaved(&routerConfig, channel_router_callback__passthrough_test, NULL, &router);
if (result == MAL_SUCCESS) { if (result == MAL_SUCCESS) {
if (router.isPassthrough) { if (router.isPassthrough) {
printf("Router incorrectly configured as a passthrough.\n"); printf("Router incorrectly configured as a passthrough.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment