diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/audio_core/renderer/command/effect/compressor.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/audio_core/renderer/command/effect/compressor.cpp b/src/audio_core/renderer/command/effect/compressor.cpp index 2ebc140f1..7229618e8 100644 --- a/src/audio_core/renderer/command/effect/compressor.cpp +++ b/src/audio_core/renderer/command/effect/compressor.cpp | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | namespace AudioCore::AudioRenderer { | 12 | namespace AudioCore::AudioRenderer { |
| 13 | 13 | ||
| 14 | static void SetCompressorEffectParameter(CompressorInfo::ParameterVersion2& params, | 14 | static void SetCompressorEffectParameter(const CompressorInfo::ParameterVersion2& params, |
| 15 | CompressorInfo::State& state) { | 15 | CompressorInfo::State& state) { |
| 16 | const auto ratio{1.0f / params.compressor_ratio}; | 16 | const auto ratio{1.0f / params.compressor_ratio}; |
| 17 | auto makeup_gain{0.0f}; | 17 | auto makeup_gain{0.0f}; |
| @@ -31,9 +31,9 @@ static void SetCompressorEffectParameter(CompressorInfo::ParameterVersion2& para | |||
| 31 | state.unk_20 = c; | 31 | state.unk_20 = c; |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | static void InitializeCompressorEffect(CompressorInfo::ParameterVersion2& params, | 34 | static void InitializeCompressorEffect(const CompressorInfo::ParameterVersion2& params, |
| 35 | CompressorInfo::State& state) { | 35 | CompressorInfo::State& state) { |
| 36 | std::memset(&state, 0, sizeof(CompressorInfo::State)); | 36 | state = {}; |
| 37 | 37 | ||
| 38 | state.unk_00 = 0; | 38 | state.unk_00 = 0; |
| 39 | state.unk_04 = 1.0f; | 39 | state.unk_04 = 1.0f; |
| @@ -42,7 +42,7 @@ static void InitializeCompressorEffect(CompressorInfo::ParameterVersion2& params | |||
| 42 | SetCompressorEffectParameter(params, state); | 42 | SetCompressorEffectParameter(params, state); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | static void ApplyCompressorEffect(CompressorInfo::ParameterVersion2& params, | 45 | static void ApplyCompressorEffect(const CompressorInfo::ParameterVersion2& params, |
| 46 | CompressorInfo::State& state, bool enabled, | 46 | CompressorInfo::State& state, bool enabled, |
| 47 | std::vector<std::span<const s32>> input_buffers, | 47 | std::vector<std::span<const s32>> input_buffers, |
| 48 | std::vector<std::span<s32>> output_buffers, u32 sample_count) { | 48 | std::vector<std::span<s32>> output_buffers, u32 sample_count) { |
| @@ -103,8 +103,7 @@ static void ApplyCompressorEffect(CompressorInfo::ParameterVersion2& params, | |||
| 103 | } else { | 103 | } else { |
| 104 | for (s16 channel = 0; channel < params.channel_count; channel++) { | 104 | for (s16 channel = 0; channel < params.channel_count; channel++) { |
| 105 | if (params.inputs[channel] != params.outputs[channel]) { | 105 | if (params.inputs[channel] != params.outputs[channel]) { |
| 106 | std::memcpy((char*)output_buffers[channel].data(), | 106 | std::memcpy(output_buffers[channel].data(), input_buffers[channel].data(), |
| 107 | (char*)input_buffers[channel].data(), | ||
| 108 | output_buffers[channel].size_bytes()); | 107 | output_buffers[channel].size_bytes()); |
| 109 | } | 108 | } |
| 110 | } | 109 | } |