mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-14 04:48:59 +02:00
[common] replace Common::BitCast with libc++ provided one (#2774)
Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2774 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
6ff043c4fb
commit
992bae4e2a
25 changed files with 152 additions and 151 deletions
|
|
@ -7,7 +7,8 @@
|
|||
#include "audio_core/adsp/apps/audio_renderer/command_list_processor.h"
|
||||
#include "audio_core/renderer/command/effect/biquad_filter.h"
|
||||
#include "audio_core/renderer/voice/voice_state.h"
|
||||
#include "common/bit_cast.h"
|
||||
#include <numeric>
|
||||
#include <bit>
|
||||
|
||||
namespace AudioCore::Renderer {
|
||||
/**
|
||||
|
|
@ -30,8 +31,8 @@ void ApplyBiquadFilterFloat(std::span<s32> output, std::span<const s32> input,
|
|||
Common::FixedPoint<50, 14>::from_base(b_[2]).to_double()};
|
||||
std::array<f64, 2> a{Common::FixedPoint<50, 14>::from_base(a_[0]).to_double(),
|
||||
Common::FixedPoint<50, 14>::from_base(a_[1]).to_double()};
|
||||
std::array<f64, 4> s{Common::BitCast<f64>(state.s0), Common::BitCast<f64>(state.s1),
|
||||
Common::BitCast<f64>(state.s2), Common::BitCast<f64>(state.s3)};
|
||||
std::array<f64, 4> s{std::bit_cast<f64>(state.s0), std::bit_cast<f64>(state.s1),
|
||||
std::bit_cast<f64>(state.s2), std::bit_cast<f64>(state.s3)};
|
||||
|
||||
for (u32 i = 0; i < sample_count; i++) {
|
||||
f64 in_sample{static_cast<f64>(input[i])};
|
||||
|
|
@ -45,10 +46,10 @@ void ApplyBiquadFilterFloat(std::span<s32> output, std::span<const s32> input,
|
|||
s[2] = sample;
|
||||
}
|
||||
|
||||
state.s0 = Common::BitCast<s64>(s[0]);
|
||||
state.s1 = Common::BitCast<s64>(s[1]);
|
||||
state.s2 = Common::BitCast<s64>(s[2]);
|
||||
state.s3 = Common::BitCast<s64>(s[3]);
|
||||
state.s0 = std::bit_cast<s64>(s[0]);
|
||||
state.s1 = std::bit_cast<s64>(s[1]);
|
||||
state.s2 = std::bit_cast<s64>(s[2]);
|
||||
state.s3 = std::bit_cast<s64>(s[3]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -63,8 +64,8 @@ void ApplyBiquadFilterFloat2(std::span<s32> output, std::span<const s32> input,
|
|||
std::array<f64, 3> b_double{static_cast<f64>(b[0]), static_cast<f64>(b[1]),
|
||||
static_cast<f64>(b[2])};
|
||||
std::array<f64, 2> a_double{static_cast<f64>(a[0]), static_cast<f64>(a[1])};
|
||||
std::array<f64, 4> s{Common::BitCast<f64>(state.s0), Common::BitCast<f64>(state.s1),
|
||||
Common::BitCast<f64>(state.s2), Common::BitCast<f64>(state.s3)};
|
||||
std::array<f64, 4> s{std::bit_cast<f64>(state.s0), std::bit_cast<f64>(state.s1),
|
||||
std::bit_cast<f64>(state.s2), std::bit_cast<f64>(state.s3)};
|
||||
|
||||
for (u32 i = 0; i < sample_count; i++) {
|
||||
f64 in_sample{static_cast<f64>(input[i])};
|
||||
|
|
@ -79,10 +80,10 @@ void ApplyBiquadFilterFloat2(std::span<s32> output, std::span<const s32> input,
|
|||
s[2] = sample;
|
||||
}
|
||||
|
||||
state.s0 = Common::BitCast<s64>(s[0]);
|
||||
state.s1 = Common::BitCast<s64>(s[1]);
|
||||
state.s2 = Common::BitCast<s64>(s[2]);
|
||||
state.s3 = Common::BitCast<s64>(s[3]);
|
||||
state.s0 = std::bit_cast<s64>(s[0]);
|
||||
state.s1 = std::bit_cast<s64>(s[1]);
|
||||
state.s2 = std::bit_cast<s64>(s[2]);
|
||||
state.s3 = std::bit_cast<s64>(s[3]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue