cellMic: simplify BE translation loop

We are looping over each channel of each sample without gaps.
So we can just make it a single loop.
This commit is contained in:
Megamouse 2024-08-07 23:32:15 +02:00
parent 161edbf2f6
commit 6a6cd82070
1 changed files with 2 additions and 8 deletions

View File

@ -602,15 +602,9 @@ void microphone_device::get_data(const u32 num_samples)
ensure(bufsize <= temp_buf.size());
// BE Translation
for (u32 index = 0; index < num_samples; index++)
for (u32 index = 0; index < bufsize; index += channel_size)
{
const u32 sample_pos = index * sample_size;
for (u32 indchan = 0; indchan < num_channels; indchan++)
{
const u32 curindex = sample_pos + indchan * channel_size;
microphone_device::variable_byteswap<channel_size>(buf.data() + curindex, tmp_ptr + curindex);
}
microphone_device::variable_byteswap<channel_size>(buf.data() + index, tmp_ptr + index);
}
break;
}