diff options
author | gdkchan <gab.dark.100@gmail.com> | 2024-10-01 07:30:57 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-01 11:30:57 +0100 |
commit | a2c003501371463fd1f98d2e5a7602ae19c21d7c (patch) | |
tree | 3943fb3d7396e4db9bb9758787533ede381d2f2e /src/Ryujinx.Audio/Renderer/Parameter/Effect/CompressorStatistics.cs | |
parent | 7d158acc3b5826a08941d6e8d50d3a3897021bcd (diff) |
Update audio renderer to REV13: Add support for compressor statistics and volume reset (#7372)HEAD1.1.1403master
* Update audio renderer to REV13: Add support for compressor statistics and volume reset
* XML docs
* Disable stats reset
* Wrong comment
* Fix more XML docs
* PR feedback
Diffstat (limited to 'src/Ryujinx.Audio/Renderer/Parameter/Effect/CompressorStatistics.cs')
-rw-r--r-- | src/Ryujinx.Audio/Renderer/Parameter/Effect/CompressorStatistics.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/Ryujinx.Audio/Renderer/Parameter/Effect/CompressorStatistics.cs b/src/Ryujinx.Audio/Renderer/Parameter/Effect/CompressorStatistics.cs new file mode 100644 index 00000000..65335e2d --- /dev/null +++ b/src/Ryujinx.Audio/Renderer/Parameter/Effect/CompressorStatistics.cs @@ -0,0 +1,38 @@ +using Ryujinx.Common.Memory; +using System.Runtime.InteropServices; + +namespace Ryujinx.Audio.Renderer.Parameter.Effect +{ + /// <summary> + /// Effect result state for <seealso cref="Common.EffectType.Compressor"/>. + /// </summary> + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct CompressorStatistics + { + /// <summary> + /// Maximum input mean value since last reset. + /// </summary> + public float MaximumMean; + + /// <summary> + /// Minimum output gain since last reset. + /// </summary> + public float MinimumGain; + + /// <summary> + /// Last processed input sample, per channel. + /// </summary> + public Array6<float> LastSamples; + + /// <summary> + /// Reset the statistics. + /// </summary> + /// <param name="channelCount">Number of channels to reset.</param> + public void Reset(ushort channelCount) + { + MaximumMean = 0.0f; + MinimumGain = 1.0f; + LastSamples.AsSpan()[..channelCount].Clear(); + } + } +} |