From f15e3d07e737e4f9e4d73a647b90446f237277d9 Mon Sep 17 00:00:00 2001 From: Joel Linn Date: Tue, 8 Jun 2021 03:53:18 +0200 Subject: [PATCH] [APU] Use vectorized converter in xaudio2 backend --- src/xenia/apu/xaudio2/xaudio2_audio_driver.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/xenia/apu/xaudio2/xaudio2_audio_driver.cc b/src/xenia/apu/xaudio2/xaudio2_audio_driver.cc index 4d3ef9c37..f393706c9 100644 --- a/src/xenia/apu/xaudio2/xaudio2_audio_driver.cc +++ b/src/xenia/apu/xaudio2/xaudio2_audio_driver.cc @@ -13,6 +13,7 @@ #include "xenia/base/platform_win.h" #include "xenia/apu/apu_flags.h" +#include "xenia/apu/conversion.h" #include "xenia/base/clock.h" #include "xenia/base/logging.h" @@ -208,12 +209,8 @@ void XAudio2AudioDriver::SubmitFrame(uint32_t frame_ptr) { auto interleave_channels = frame_channels_; // interleave the data - for (uint32_t index = 0, o = 0; index < channel_samples_; ++index) { - for (uint32_t channel = 0, table = 0; channel < interleave_channels; - ++channel, table += channel_samples_) { - output_frame[o++] = xe::byte_swap(input_frame[table + index]); - } - } + conversion::sequential_6_BE_to_interleaved_6_LE(output_frame, input_frame, + channel_samples_); api::XAUDIO2_BUFFER buffer; buffer.Flags = 0;