From 41bba5310a5324f54fa5c0200aff2bf697ced000 Mon Sep 17 00:00:00 2001 From: merry Date: Sun, 15 Jan 2023 04:20:49 +0000 Subject: Audren: Implement polyphase upsampler (#4256) * Audren: Implement polyphase upsampler * prefer shifting to modulo * prefer MathF * fix nits * rm ResampleForUpsampler * oop * Array20 * nits --- .../Renderer/Server/Upsampler/UpsamplerBufferState.cs | 14 ++++++++++++++ Ryujinx.Audio/Renderer/Server/Upsampler/UpsamplerState.cs | 5 +++++ 2 files changed, 19 insertions(+) create mode 100644 Ryujinx.Audio/Renderer/Server/Upsampler/UpsamplerBufferState.cs (limited to 'Ryujinx.Audio/Renderer/Server') diff --git a/Ryujinx.Audio/Renderer/Server/Upsampler/UpsamplerBufferState.cs b/Ryujinx.Audio/Renderer/Server/Upsampler/UpsamplerBufferState.cs new file mode 100644 index 00000000..a45fa8e5 --- /dev/null +++ b/Ryujinx.Audio/Renderer/Server/Upsampler/UpsamplerBufferState.cs @@ -0,0 +1,14 @@ +using Ryujinx.Common.Memory; + +namespace Ryujinx.Audio.Renderer.Server.Upsampler +{ + public struct UpsamplerBufferState + { + public const int HistoryLength = 20; + + public float Scale; + public Array20 History; + public bool Initialized; + public int Phase; + } +} \ No newline at end of file diff --git a/Ryujinx.Audio/Renderer/Server/Upsampler/UpsamplerState.cs b/Ryujinx.Audio/Renderer/Server/Upsampler/UpsamplerState.cs index 065e4838..e508f35b 100644 --- a/Ryujinx.Audio/Renderer/Server/Upsampler/UpsamplerState.cs +++ b/Ryujinx.Audio/Renderer/Server/Upsampler/UpsamplerState.cs @@ -37,6 +37,11 @@ namespace Ryujinx.Audio.Renderer.Server.Upsampler /// public ushort[] InputBufferIndices; + /// + /// State of each input buffer index kept across invocations of the upsampler. + /// + public UpsamplerBufferState[] BufferStates; + /// /// Create a new . /// -- cgit v1.2.3