Commit fc424d9f authored by David Reid's avatar David Reid

Some minor code cleanup.

parent c3aae67b
...@@ -51876,10 +51876,8 @@ static ma_result ma_channel_map_apply_mono_in_f32(float* MA_RESTRICT pFramesOut, ...@@ -51876,10 +51876,8 @@ static ma_result ma_channel_map_apply_mono_in_f32(float* MA_RESTRICT pFramesOut,
} }
/* Tail. */ /* Tail. */
for (iFrame = unrolledFrameCount << 1; iFrame < frameCount; iFrame += 1) { iFrame = unrolledFrameCount << 1;
pFramesOut[iFrame*2 + 0] = pFramesIn[iFrame]; goto generic_on_fastpath;
pFramesOut[iFrame*2 + 1] = pFramesIn[iFrame];
}
} else } else
#endif #endif
{ {
...@@ -51905,18 +51903,17 @@ static ma_result ma_channel_map_apply_mono_in_f32(float* MA_RESTRICT pFramesOut, ...@@ -51905,18 +51903,17 @@ static ma_result ma_channel_map_apply_mono_in_f32(float* MA_RESTRICT pFramesOut,
} }
/* Tail. */ /* Tail. */
for (iFrame = unrolledFrameCount << 1; iFrame < frameCount; iFrame += 1) { iFrame = unrolledFrameCount << 1;
for (iChannelOut = 0; iChannelOut < 6; iChannelOut += 1) { goto generic_on_fastpath;
pFramesOut[iFrame*6 + iChannelOut] = pFramesIn[iFrame];
}
}
} else } else
#endif #endif
{
for (iFrame = 0; iFrame < frameCount; iFrame += 1) { for (iFrame = 0; iFrame < frameCount; iFrame += 1) {
for (iChannelOut = 0; iChannelOut < 6; iChannelOut += 1) { for (iChannelOut = 0; iChannelOut < 6; iChannelOut += 1) {
pFramesOut[iFrame*6 + iChannelOut] = pFramesIn[iFrame]; pFramesOut[iFrame*6 + iChannelOut] = pFramesIn[iFrame];
} }
} }
}
} else if (channelsOut == 8) { } else if (channelsOut == 8) {
#if defined(MA_SUPPORT_SSE2) #if defined(MA_SUPPORT_SSE2)
if (ma_has_sse2()) { if (ma_has_sse2()) {
...@@ -51935,9 +51932,14 @@ static ma_result ma_channel_map_apply_mono_in_f32(float* MA_RESTRICT pFramesOut, ...@@ -51935,9 +51932,14 @@ static ma_result ma_channel_map_apply_mono_in_f32(float* MA_RESTRICT pFramesOut,
} }
} }
} else { } else {
for (iFrame = 0; iFrame < frameCount; iFrame += 1) { iFrame = 0;
generic_on_fastpath:
{
for (; iFrame < frameCount; iFrame += 1) {
for (iChannelOut = 0; iChannelOut < channelsOut; iChannelOut += 1) { for (iChannelOut = 0; iChannelOut < channelsOut; iChannelOut += 1) {
pFramesOut[iFrame*channelsOut + iChannelOut] = pFramesIn[iFrame + 0]; pFramesOut[iFrame*channelsOut + iChannelOut] = pFramesIn[iFrame];
}
} }
} }
} }
...@@ -51946,7 +51948,7 @@ static ma_result ma_channel_map_apply_mono_in_f32(float* MA_RESTRICT pFramesOut, ...@@ -51946,7 +51948,7 @@ static ma_result ma_channel_map_apply_mono_in_f32(float* MA_RESTRICT pFramesOut,
for (iFrame = 0; iFrame < frameCount; iFrame += 1) { for (iFrame = 0; iFrame < frameCount; iFrame += 1) {
for (iChannelOut = 0; iChannelOut < channelsOut; iChannelOut += 1) { for (iChannelOut = 0; iChannelOut < channelsOut; iChannelOut += 1) {
if (channelPositions[iChannelOut] != MA_CHANNEL_NONE) { if (channelPositions[iChannelOut] != MA_CHANNEL_NONE) {
pFramesOut[iFrame*channelsOut + iChannelOut] = pFramesIn[iFrame + 0]; pFramesOut[iFrame*channelsOut + iChannelOut] = pFramesIn[iFrame];
} }
} }
} }
...@@ -51957,7 +51959,7 @@ static ma_result ma_channel_map_apply_mono_in_f32(float* MA_RESTRICT pFramesOut, ...@@ -51957,7 +51959,7 @@ static ma_result ma_channel_map_apply_mono_in_f32(float* MA_RESTRICT pFramesOut,
for (iChannelOut = 0; iChannelOut < channelsOut; iChannelOut += 1) { for (iChannelOut = 0; iChannelOut < channelsOut; iChannelOut += 1) {
ma_channel channelOut = ma_channel_map_get_channel(pChannelMapOut, channelsOut, iChannelOut); ma_channel channelOut = ma_channel_map_get_channel(pChannelMapOut, channelsOut, iChannelOut);
if (channelOut != MA_CHANNEL_NONE) { if (channelOut != MA_CHANNEL_NONE) {
pFramesOut[iFrame*channelsOut + iChannelOut] = pFramesIn[iFrame + 0]; pFramesOut[iFrame*channelsOut + iChannelOut] = pFramesIn[iFrame];
} }
} }
} }
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