DVDInterface: Better memory locality for DTK byteswapping
This commit is contained in:
parent
e1f6ab5592
commit
a6bb1b642a
|
@ -324,13 +324,14 @@ static size_t ProcessDTKSamples(std::vector<s16>* temp_pcm, const std::vector<u8
|
||||||
while (samples_processed < temp_pcm->size() / 2 && bytes_processed < audio_data.size())
|
while (samples_processed < temp_pcm->size() / 2 && bytes_processed < audio_data.size())
|
||||||
{
|
{
|
||||||
StreamADPCM::DecodeBlock(&(*temp_pcm)[samples_processed * 2], &audio_data[bytes_processed]);
|
StreamADPCM::DecodeBlock(&(*temp_pcm)[samples_processed * 2], &audio_data[bytes_processed]);
|
||||||
samples_processed += StreamADPCM::SAMPLES_PER_BLOCK;
|
for (size_t i = 0; i < StreamADPCM::SAMPLES_PER_BLOCK * 2; ++i)
|
||||||
bytes_processed += StreamADPCM::ONE_BLOCK_SIZE;
|
|
||||||
}
|
|
||||||
for (size_t i = 0; i < samples_processed * 2; ++i)
|
|
||||||
{
|
{
|
||||||
// TODO: Fix the mixer so it can accept non-byte-swapped samples.
|
// TODO: Fix the mixer so it can accept non-byte-swapped samples.
|
||||||
(*temp_pcm)[i] = Common::swap16((*temp_pcm)[i]);
|
s16* sample = &(*temp_pcm)[samples_processed * 2 + i];
|
||||||
|
*sample = Common::swap16(*sample);
|
||||||
|
}
|
||||||
|
samples_processed += StreamADPCM::SAMPLES_PER_BLOCK;
|
||||||
|
bytes_processed += StreamADPCM::ONE_BLOCK_SIZE;
|
||||||
}
|
}
|
||||||
return samples_processed;
|
return samples_processed;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue