mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-01 02:03:47 +01:00
Convert s16->float using SSE2.
This commit is contained in:
1 parent
f3654795a3
commit
4705a2568e
3 files changed
+33
-5
No files matched your search
@@ -1,6 +1,7 @@
|
||||
#include "native/thread/threadutil.h"
|
||||
#include "Common/CommonWindows.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include "Core/Util/AudioFormat.h"
|
||||
|
||||
#include <dsound.h>
|
||||
|
||||
@@ -378,11 +379,7 @@ int WASAPIAudioBackend::RunThread() {
|
||||
// What to do?
|
||||
} else if (pNumAvFrames) {
|
||||
callback_(shortBuf, pNumAvFrames, 16, sampleRate_, 2);
|
||||
// Sigh, another format conversion :)
|
||||
float *ptr = (float *)pData;
|
||||
for (int i = 0; i < (int)(pNumAvFrames * pDeviceFormat->Format.nChannels); i++) {
|
||||
ptr[i] = shortBuf[i] * (1.0f / 32767.0f);
|
||||
}
|
||||
ConvertS16ToF32((float *)pData, shortBuf, pNumAvFrames * pDeviceFormat->Format.nChannels);
|
||||
}
|
||||
|
||||
hresult = pAudioRenderClient->ReleaseBuffer(pNumAvFrames, flags);
|
||||
|
||||
Reference in new issue
Block a user