diff options
| author | 2023-02-11 13:28:03 -0500 | |
|---|---|---|
| committer | 2023-02-14 12:33:11 -0500 | |
| commit | 45e13b03f372230dbf780f3fa87dd88f388af605 (patch) | |
| tree | 555593e7e5016b6ba2a777d7417ada244abce458 /src/audio_core/renderer | |
| parent | Merge pull request #9795 from Kelebek1/biquad_fix (diff) | |
| download | yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.gz yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.xz yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.zip | |
add static lifetime to constexpr values to force compile time evaluation where possible
Signed-off-by: arades79 <scravers@protonmail.com>
Diffstat (limited to 'src/audio_core/renderer')
11 files changed, 33 insertions, 33 deletions
diff --git a/src/audio_core/renderer/adsp/audio_renderer.cpp b/src/audio_core/renderer/adsp/audio_renderer.cpp index d982ef630..5bafd4c06 100644 --- a/src/audio_core/renderer/adsp/audio_renderer.cpp +++ b/src/audio_core/renderer/adsp/audio_renderer.cpp | |||
| @@ -132,7 +132,7 @@ void AudioRenderer::CreateSinkStreams() { | |||
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | void AudioRenderer::ThreadFunc() { | 134 | void AudioRenderer::ThreadFunc() { |
| 135 | constexpr char name[]{"AudioRenderer"}; | 135 | constexpr static char name[]{"AudioRenderer"}; |
| 136 | MicroProfileOnThreadCreate(name); | 136 | MicroProfileOnThreadCreate(name); |
| 137 | Common::SetCurrentThreadName(name); | 137 | Common::SetCurrentThreadName(name); |
| 138 | Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); | 138 | Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); |
| @@ -144,7 +144,7 @@ void AudioRenderer::ThreadFunc() { | |||
| 144 | 144 | ||
| 145 | mailbox->ADSPSendMessage(RenderMessage::AudioRenderer_InitializeOK); | 145 | mailbox->ADSPSendMessage(RenderMessage::AudioRenderer_InitializeOK); |
| 146 | 146 | ||
| 147 | constexpr u64 max_process_time{2'304'000ULL}; | 147 | constexpr static u64 max_process_time{2'304'000ULL}; |
| 148 | 148 | ||
| 149 | while (true) { | 149 | while (true) { |
| 150 | auto message{mailbox->ADSPWaitMessage()}; | 150 | auto message{mailbox->ADSPWaitMessage()}; |
diff --git a/src/audio_core/renderer/command/data_source/decode.cpp b/src/audio_core/renderer/command/data_source/decode.cpp index ff5d31bd6..68a0aa15d 100644 --- a/src/audio_core/renderer/command/data_source/decode.cpp +++ b/src/audio_core/renderer/command/data_source/decode.cpp | |||
| @@ -27,8 +27,8 @@ constexpr std::array<u8, 3> PitchBySrcQuality = {4, 8, 4}; | |||
| 27 | template <typename T> | 27 | template <typename T> |
| 28 | static u32 DecodePcm(Core::Memory::Memory& memory, std::span<s16> out_buffer, | 28 | static u32 DecodePcm(Core::Memory::Memory& memory, std::span<s16> out_buffer, |
| 29 | const DecodeArg& req) { | 29 | const DecodeArg& req) { |
| 30 | constexpr s32 min{std::numeric_limits<s16>::min()}; | 30 | constexpr static s32 min{std::numeric_limits<s16>::min()}; |
| 31 | constexpr s32 max{std::numeric_limits<s16>::max()}; | 31 | constexpr static s32 max{std::numeric_limits<s16>::max()}; |
| 32 | 32 | ||
| 33 | if (req.buffer == 0 || req.buffer_size == 0) { | 33 | if (req.buffer == 0 || req.buffer_size == 0) { |
| 34 | return 0; | 34 | return 0; |
| @@ -101,8 +101,8 @@ static u32 DecodePcm(Core::Memory::Memory& memory, std::span<s16> out_buffer, | |||
| 101 | */ | 101 | */ |
| 102 | static u32 DecodeAdpcm(Core::Memory::Memory& memory, std::span<s16> out_buffer, | 102 | static u32 DecodeAdpcm(Core::Memory::Memory& memory, std::span<s16> out_buffer, |
| 103 | const DecodeArg& req) { | 103 | const DecodeArg& req) { |
| 104 | constexpr u32 SamplesPerFrame{14}; | 104 | constexpr static u32 SamplesPerFrame{14}; |
| 105 | constexpr u32 NibblesPerFrame{16}; | 105 | constexpr static u32 NibblesPerFrame{16}; |
| 106 | 106 | ||
| 107 | if (req.buffer == 0 || req.buffer_size == 0) { | 107 | if (req.buffer == 0 || req.buffer_size == 0) { |
| 108 | return 0; | 108 | return 0; |
diff --git a/src/audio_core/renderer/command/effect/biquad_filter.cpp b/src/audio_core/renderer/command/effect/biquad_filter.cpp index dea6423dc..84fb6ae7a 100644 --- a/src/audio_core/renderer/command/effect/biquad_filter.cpp +++ b/src/audio_core/renderer/command/effect/biquad_filter.cpp | |||
| @@ -20,8 +20,8 @@ namespace AudioCore::AudioRenderer { | |||
| 20 | void ApplyBiquadFilterFloat(std::span<s32> output, std::span<const s32> input, | 20 | void ApplyBiquadFilterFloat(std::span<s32> output, std::span<const s32> input, |
| 21 | std::array<s16, 3>& b_, std::array<s16, 2>& a_, | 21 | std::array<s16, 3>& b_, std::array<s16, 2>& a_, |
| 22 | VoiceState::BiquadFilterState& state, const u32 sample_count) { | 22 | VoiceState::BiquadFilterState& state, const u32 sample_count) { |
| 23 | constexpr f64 min{std::numeric_limits<s32>::min()}; | 23 | constexpr static f64 min{std::numeric_limits<s32>::min()}; |
| 24 | constexpr f64 max{std::numeric_limits<s32>::max()}; | 24 | constexpr static f64 max{std::numeric_limits<s32>::max()}; |
| 25 | std::array<f64, 3> b{Common::FixedPoint<50, 14>::from_base(b_[0]).to_double(), | 25 | std::array<f64, 3> b{Common::FixedPoint<50, 14>::from_base(b_[0]).to_double(), |
| 26 | Common::FixedPoint<50, 14>::from_base(b_[1]).to_double(), | 26 | Common::FixedPoint<50, 14>::from_base(b_[1]).to_double(), |
| 27 | Common::FixedPoint<50, 14>::from_base(b_[2]).to_double()}; | 27 | Common::FixedPoint<50, 14>::from_base(b_[2]).to_double()}; |
| @@ -61,8 +61,8 @@ void ApplyBiquadFilterFloat(std::span<s32> output, std::span<const s32> input, | |||
| 61 | static void ApplyBiquadFilterInt(std::span<s32> output, std::span<const s32> input, | 61 | static void ApplyBiquadFilterInt(std::span<s32> output, std::span<const s32> input, |
| 62 | std::array<s16, 3>& b, std::array<s16, 2>& a, | 62 | std::array<s16, 3>& b, std::array<s16, 2>& a, |
| 63 | VoiceState::BiquadFilterState& state, const u32 sample_count) { | 63 | VoiceState::BiquadFilterState& state, const u32 sample_count) { |
| 64 | constexpr s64 min{std::numeric_limits<s32>::min()}; | 64 | constexpr static s64 min{std::numeric_limits<s32>::min()}; |
| 65 | constexpr s64 max{std::numeric_limits<s32>::max()}; | 65 | constexpr static s64 max{std::numeric_limits<s32>::max()}; |
| 66 | 66 | ||
| 67 | for (u32 i = 0; i < sample_count; i++) { | 67 | for (u32 i = 0; i < sample_count; i++) { |
| 68 | const s64 in_sample{input[i]}; | 68 | const s64 in_sample{input[i]}; |
diff --git a/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp b/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp index 2187d8a65..98217cd2d 100644 --- a/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp +++ b/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp | |||
| @@ -244,16 +244,16 @@ template <size_t NumChannels> | |||
| 244 | static void ApplyI3dl2ReverbEffect(I3dl2ReverbInfo::State& state, | 244 | static void ApplyI3dl2ReverbEffect(I3dl2ReverbInfo::State& state, |
| 245 | std::span<std::span<const s32>> inputs, | 245 | std::span<std::span<const s32>> inputs, |
| 246 | std::span<std::span<s32>> outputs, const u32 sample_count) { | 246 | std::span<std::span<s32>> outputs, const u32 sample_count) { |
| 247 | constexpr std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes1Ch{ | 247 | constexpr static std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes1Ch{ |
| 248 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 248 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 249 | }; | 249 | }; |
| 250 | constexpr std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes2Ch{ | 250 | constexpr static std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes2Ch{ |
| 251 | 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, | 251 | 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, |
| 252 | }; | 252 | }; |
| 253 | constexpr std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes4Ch{ | 253 | constexpr static std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes4Ch{ |
| 254 | 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 3, 3, 3, | 254 | 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 3, 3, 3, |
| 255 | }; | 255 | }; |
| 256 | constexpr std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes6Ch{ | 256 | constexpr static std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes6Ch{ |
| 257 | 2, 0, 0, 1, 1, 1, 1, 4, 4, 4, 1, 1, 1, 0, 0, 0, 0, 5, 5, 5, | 257 | 2, 0, 0, 1, 1, 1, 1, 4, 4, 4, 1, 1, 1, 0, 0, 0, 0, 5, 5, 5, |
| 258 | }; | 258 | }; |
| 259 | 259 | ||
diff --git a/src/audio_core/renderer/command/effect/light_limiter.cpp b/src/audio_core/renderer/command/effect/light_limiter.cpp index e8fb0e2fc..410e5dac0 100644 --- a/src/audio_core/renderer/command/effect/light_limiter.cpp +++ b/src/audio_core/renderer/command/effect/light_limiter.cpp | |||
| @@ -50,8 +50,8 @@ static void ApplyLightLimiterEffect(const LightLimiterInfo::ParameterVersion2& p | |||
| 50 | std::vector<std::span<const s32>>& inputs, | 50 | std::vector<std::span<const s32>>& inputs, |
| 51 | std::vector<std::span<s32>>& outputs, const u32 sample_count, | 51 | std::vector<std::span<s32>>& outputs, const u32 sample_count, |
| 52 | LightLimiterInfo::StatisticsInternal* statistics) { | 52 | LightLimiterInfo::StatisticsInternal* statistics) { |
| 53 | constexpr s64 min{std::numeric_limits<s32>::min()}; | 53 | constexpr static s64 min{std::numeric_limits<s32>::min()}; |
| 54 | constexpr s64 max{std::numeric_limits<s32>::max()}; | 54 | constexpr static s64 max{std::numeric_limits<s32>::max()}; |
| 55 | 55 | ||
| 56 | const auto recip_estimate = [](f64 a) -> f64 { | 56 | const auto recip_estimate = [](f64 a) -> f64 { |
| 57 | s32 q, s; | 57 | s32 q, s; |
diff --git a/src/audio_core/renderer/command/effect/reverb.cpp b/src/audio_core/renderer/command/effect/reverb.cpp index 427489214..ffe108268 100644 --- a/src/audio_core/renderer/command/effect/reverb.cpp +++ b/src/audio_core/renderer/command/effect/reverb.cpp | |||
| @@ -252,16 +252,16 @@ template <size_t NumChannels> | |||
| 252 | static void ApplyReverbEffect(const ReverbInfo::ParameterVersion2& params, ReverbInfo::State& state, | 252 | static void ApplyReverbEffect(const ReverbInfo::ParameterVersion2& params, ReverbInfo::State& state, |
| 253 | std::vector<std::span<const s32>>& inputs, | 253 | std::vector<std::span<const s32>>& inputs, |
| 254 | std::vector<std::span<s32>>& outputs, const u32 sample_count) { | 254 | std::vector<std::span<s32>>& outputs, const u32 sample_count) { |
| 255 | constexpr std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes1Ch{ | 255 | constexpr static std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes1Ch{ |
| 256 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 256 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 257 | }; | 257 | }; |
| 258 | constexpr std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes2Ch{ | 258 | constexpr static std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes2Ch{ |
| 259 | 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, | 259 | 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, |
| 260 | }; | 260 | }; |
| 261 | constexpr std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes4Ch{ | 261 | constexpr static std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes4Ch{ |
| 262 | 0, 0, 1, 1, 0, 1, 2, 2, 3, 3, | 262 | 0, 0, 1, 1, 0, 1, 2, 2, 3, 3, |
| 263 | }; | 263 | }; |
| 264 | constexpr std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes6Ch{ | 264 | constexpr static std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes6Ch{ |
| 265 | 0, 0, 1, 1, 2, 2, 4, 4, 5, 5, | 265 | 0, 0, 1, 1, 2, 2, 4, 4, 5, 5, |
| 266 | }; | 266 | }; |
| 267 | 267 | ||
diff --git a/src/audio_core/renderer/command/resample/upsample.cpp b/src/audio_core/renderer/command/resample/upsample.cpp index 5f7db12ca..4bd604754 100644 --- a/src/audio_core/renderer/command/resample/upsample.cpp +++ b/src/audio_core/renderer/command/resample/upsample.cpp | |||
| @@ -19,24 +19,24 @@ namespace AudioCore::AudioRenderer { | |||
| 19 | static void SrcProcessFrame(std::span<s32> output, std::span<const s32> input, | 19 | static void SrcProcessFrame(std::span<s32> output, std::span<const s32> input, |
| 20 | const u32 target_sample_count, const u32 source_sample_count, | 20 | const u32 target_sample_count, const u32 source_sample_count, |
| 21 | UpsamplerState* state) { | 21 | UpsamplerState* state) { |
| 22 | constexpr u32 WindowSize = 10; | 22 | constexpr static u32 WindowSize = 10; |
| 23 | constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc1{ | 23 | constexpr static std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc1{ |
| 24 | 0.95376587f, -0.12872314f, 0.060028076f, -0.032470703f, 0.017669678f, | 24 | 0.95376587f, -0.12872314f, 0.060028076f, -0.032470703f, 0.017669678f, |
| 25 | -0.009124756f, 0.004272461f, -0.001739502f, 0.000579834f, -0.000091552734f, | 25 | -0.009124756f, 0.004272461f, -0.001739502f, 0.000579834f, -0.000091552734f, |
| 26 | }; | 26 | }; |
| 27 | constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc2{ | 27 | constexpr static std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc2{ |
| 28 | 0.8230896f, -0.19161987f, 0.093444824f, -0.05090332f, 0.027557373f, | 28 | 0.8230896f, -0.19161987f, 0.093444824f, -0.05090332f, 0.027557373f, |
| 29 | -0.014038086f, 0.0064697266f, -0.002532959f, 0.00079345703f, -0.00012207031f, | 29 | -0.014038086f, 0.0064697266f, -0.002532959f, 0.00079345703f, -0.00012207031f, |
| 30 | }; | 30 | }; |
| 31 | constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc3{ | 31 | constexpr static std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc3{ |
| 32 | 0.6298828f, -0.19274902f, 0.09725952f, -0.05319214f, 0.028625488f, | 32 | 0.6298828f, -0.19274902f, 0.09725952f, -0.05319214f, 0.028625488f, |
| 33 | -0.014373779f, 0.006500244f, -0.0024719238f, 0.0007324219f, -0.000091552734f, | 33 | -0.014373779f, 0.006500244f, -0.0024719238f, 0.0007324219f, -0.000091552734f, |
| 34 | }; | 34 | }; |
| 35 | constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc4{ | 35 | constexpr static std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc4{ |
| 36 | 0.4057312f, -0.1468811f, 0.07601929f, -0.041656494f, 0.022216797f, | 36 | 0.4057312f, -0.1468811f, 0.07601929f, -0.041656494f, 0.022216797f, |
| 37 | -0.011016846f, 0.004852295f, -0.0017700195f, 0.00048828125f, -0.000030517578f, | 37 | -0.011016846f, 0.004852295f, -0.0017700195f, 0.00048828125f, -0.000030517578f, |
| 38 | }; | 38 | }; |
| 39 | constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc5{ | 39 | constexpr static std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc5{ |
| 40 | 0.1854248f, -0.075164795f, 0.03967285f, -0.021728516f, 0.011474609f, | 40 | 0.1854248f, -0.075164795f, 0.03967285f, -0.021728516f, 0.011474609f, |
| 41 | -0.005584717f, 0.0024108887f, -0.0008239746f, 0.00021362305f, 0.0f, | 41 | -0.005584717f, 0.0024108887f, -0.0008239746f, 0.00021362305f, 0.0f, |
| 42 | }; | 42 | }; |
diff --git a/src/audio_core/renderer/command/sink/circular_buffer.cpp b/src/audio_core/renderer/command/sink/circular_buffer.cpp index ded5afc94..1989873db 100644 --- a/src/audio_core/renderer/command/sink/circular_buffer.cpp +++ b/src/audio_core/renderer/command/sink/circular_buffer.cpp | |||
| @@ -21,8 +21,8 @@ void CircularBufferSinkCommand::Dump([[maybe_unused]] const ADSP::CommandListPro | |||
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | void CircularBufferSinkCommand::Process(const ADSP::CommandListProcessor& processor) { | 23 | void CircularBufferSinkCommand::Process(const ADSP::CommandListProcessor& processor) { |
| 24 | constexpr s32 min{std::numeric_limits<s16>::min()}; | 24 | constexpr static s32 min{std::numeric_limits<s16>::min()}; |
| 25 | constexpr s32 max{std::numeric_limits<s16>::max()}; | 25 | constexpr static s32 max{std::numeric_limits<s16>::max()}; |
| 26 | 26 | ||
| 27 | std::vector<s16> output(processor.sample_count); | 27 | std::vector<s16> output(processor.sample_count); |
| 28 | for (u32 channel = 0; channel < input_count; channel++) { | 28 | for (u32 channel = 0; channel < input_count; channel++) { |
diff --git a/src/audio_core/renderer/command/sink/device.cpp b/src/audio_core/renderer/command/sink/device.cpp index e88372a75..2f2e82ae2 100644 --- a/src/audio_core/renderer/command/sink/device.cpp +++ b/src/audio_core/renderer/command/sink/device.cpp | |||
| @@ -20,8 +20,8 @@ void DeviceSinkCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& | |||
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | void DeviceSinkCommand::Process(const ADSP::CommandListProcessor& processor) { | 22 | void DeviceSinkCommand::Process(const ADSP::CommandListProcessor& processor) { |
| 23 | constexpr s32 min = std::numeric_limits<s16>::min(); | 23 | constexpr static s32 min = std::numeric_limits<s16>::min(); |
| 24 | constexpr s32 max = std::numeric_limits<s16>::max(); | 24 | constexpr static s32 max = std::numeric_limits<s16>::max(); |
| 25 | 25 | ||
| 26 | auto stream{processor.GetOutputSinkStream()}; | 26 | auto stream{processor.GetOutputSinkStream()}; |
| 27 | stream->SetSystemChannels(input_count); | 27 | stream->SetSystemChannels(input_count); |
diff --git a/src/audio_core/renderer/system_manager.cpp b/src/audio_core/renderer/system_manager.cpp index f66b2b890..a8517014e 100644 --- a/src/audio_core/renderer/system_manager.cpp +++ b/src/audio_core/renderer/system_manager.cpp | |||
| @@ -94,7 +94,7 @@ bool SystemManager::Remove(System& system_) { | |||
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | void SystemManager::ThreadFunc() { | 96 | void SystemManager::ThreadFunc() { |
| 97 | constexpr char name[]{"AudioRenderSystemManager"}; | 97 | constexpr static char name[]{"AudioRenderSystemManager"}; |
| 98 | MicroProfileOnThreadCreate(name); | 98 | MicroProfileOnThreadCreate(name); |
| 99 | Common::SetCurrentThreadName(name); | 99 | Common::SetCurrentThreadName(name); |
| 100 | Common::SetCurrentThreadPriority(Common::ThreadPriority::High); | 100 | Common::SetCurrentThreadPriority(Common::ThreadPriority::High); |
diff --git a/src/audio_core/renderer/voice/voice_info.cpp b/src/audio_core/renderer/voice/voice_info.cpp index 1849eeb57..2b3705647 100644 --- a/src/audio_core/renderer/voice/voice_info.cpp +++ b/src/audio_core/renderer/voice/voice_info.cpp | |||
| @@ -177,7 +177,7 @@ void VoiceInfo::UpdateWaveBuffer(std::span<BehaviorInfo::ErrorInfo> error_info, | |||
| 177 | 177 | ||
| 178 | switch (sample_format_) { | 178 | switch (sample_format_) { |
| 179 | case SampleFormat::PcmInt16: { | 179 | case SampleFormat::PcmInt16: { |
| 180 | constexpr auto byte_size{GetSampleFormatByteSize(SampleFormat::PcmInt16)}; | 180 | constexpr static auto byte_size{GetSampleFormatByteSize(SampleFormat::PcmInt16)}; |
| 181 | if (wave_buffer_internal.start_offset * byte_size > wave_buffer_internal.size || | 181 | if (wave_buffer_internal.start_offset * byte_size > wave_buffer_internal.size || |
| 182 | wave_buffer_internal.end_offset * byte_size > wave_buffer_internal.size) { | 182 | wave_buffer_internal.end_offset * byte_size > wave_buffer_internal.size) { |
| 183 | LOG_ERROR(Service_Audio, "Invalid PCM16 start/end wavebuffer sizes!"); | 183 | LOG_ERROR(Service_Audio, "Invalid PCM16 start/end wavebuffer sizes!"); |
| @@ -188,7 +188,7 @@ void VoiceInfo::UpdateWaveBuffer(std::span<BehaviorInfo::ErrorInfo> error_info, | |||
| 188 | } break; | 188 | } break; |
| 189 | 189 | ||
| 190 | case SampleFormat::PcmFloat: { | 190 | case SampleFormat::PcmFloat: { |
| 191 | constexpr auto byte_size{GetSampleFormatByteSize(SampleFormat::PcmFloat)}; | 191 | constexpr static auto byte_size{GetSampleFormatByteSize(SampleFormat::PcmFloat)}; |
| 192 | if (wave_buffer_internal.start_offset * byte_size > wave_buffer_internal.size || | 192 | if (wave_buffer_internal.start_offset * byte_size > wave_buffer_internal.size || |
| 193 | wave_buffer_internal.end_offset * byte_size > wave_buffer_internal.size) { | 193 | wave_buffer_internal.end_offset * byte_size > wave_buffer_internal.size) { |
| 194 | LOG_ERROR(Service_Audio, "Invalid PCMFloat start/end wavebuffer sizes!"); | 194 | LOG_ERROR(Service_Audio, "Invalid PCMFloat start/end wavebuffer sizes!"); |