aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Audio/Renderer/Dsp/Command/CompressorCommand.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2023-09-29 07:48:49 -0300
committerGitHub <noreply@github.com>2023-09-29 10:48:49 +0000
commit41b104d0fbf1e8cf280ab594f1316d815afdd1d6 (patch)
tree0cbcd43f4543b20a2b0f3064799140c32c3488c1 /src/Ryujinx.Audio/Renderer/Dsp/Command/CompressorCommand.cs
parentbc44b85b0bdcaf8140a04130e4a895677a01111f (diff)
Fix audio renderer compressor effect (#5742)1.1.1036
* Delete DecibelToLinearExtended and fix Log10 function * Fix CopyBuffer and ClearBuffer * Change effect states from class to struct + formatting * Formatting * Make UpdateLowPassFilter readonly * More compressor fixes
Diffstat (limited to 'src/Ryujinx.Audio/Renderer/Dsp/Command/CompressorCommand.cs')
-rw-r--r--src/Ryujinx.Audio/Renderer/Dsp/Command/CompressorCommand.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Ryujinx.Audio/Renderer/Dsp/Command/CompressorCommand.cs b/src/Ryujinx.Audio/Renderer/Dsp/Command/CompressorCommand.cs
index 01291852..1d5917bb 100644
--- a/src/Ryujinx.Audio/Renderer/Dsp/Command/CompressorCommand.cs
+++ b/src/Ryujinx.Audio/Renderer/Dsp/Command/CompressorCommand.cs
@@ -94,18 +94,18 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
float newMean = inputMovingAverage.Update(FloatingPointHelper.MeanSquare(channelInput), _parameter.InputGain);
float y = FloatingPointHelper.Log10(newMean) * 10.0f;
- float z = 0.0f;
+ float z = 1.0f;
- bool unknown10OutOfRange = false;
+ bool unknown10OutOfRange = y >= state.Unknown10;
if (newMean < 1.0e-10f)
{
- z = 1.0f;
+ y = -100.0f;
- unknown10OutOfRange = state.Unknown10 < -100.0f;
+ unknown10OutOfRange = state.Unknown10 <= -100.0f;
}
- if (y >= state.Unknown10 || unknown10OutOfRange)
+ if (unknown10OutOfRange)
{
float tmpGain;
@@ -118,7 +118,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
tmpGain = (y - state.Unknown10) * ((y - state.Unknown10) * -state.CompressorGainReduction);
}
- z = FloatingPointHelper.DecibelToLinearExtended(tmpGain);
+ z = FloatingPointHelper.DecibelToLinear(tmpGain);
}
float unknown4New = z;