mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-10 10:09:22 +00:00
cellAudio: fix template arg style
Add constexpr if
This commit is contained in:
parent
81c50bad69
commit
74d684b57e
2 changed files with 9 additions and 8 deletions
|
@ -734,12 +734,12 @@ void cell_audio_thread::operator()()
|
||||||
ringbuffer.reset();
|
ringbuffer.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<bool downmix_to_2ch>
|
template <bool DownmixToStereo>
|
||||||
void cell_audio_thread::mix(float *out_buffer, s32 offset)
|
void cell_audio_thread::mix(float *out_buffer, s32 offset)
|
||||||
{
|
{
|
||||||
AUDIT(out_buffer != nullptr);
|
AUDIT(out_buffer != nullptr);
|
||||||
|
|
||||||
constexpr u32 channels = downmix_to_2ch ? 2 : 8;
|
constexpr u32 channels = DownmixToStereo ? 2 : 8;
|
||||||
constexpr u32 out_buffer_sz = channels * AUDIO_BUFFER_SAMPLES;
|
constexpr u32 out_buffer_sz = channels * AUDIO_BUFFER_SAMPLES;
|
||||||
|
|
||||||
bool first_mix = true;
|
bool first_mix = true;
|
||||||
|
@ -786,7 +786,7 @@ void cell_audio_thread::mix(float *out_buffer, s32 offset)
|
||||||
out_buffer[out + 0] = left;
|
out_buffer[out + 0] = left;
|
||||||
out_buffer[out + 1] = right;
|
out_buffer[out + 1] = right;
|
||||||
|
|
||||||
if (!downmix_to_2ch)
|
if constexpr (!DownmixToStereo)
|
||||||
{
|
{
|
||||||
out_buffer[out + 2] = 0.0f;
|
out_buffer[out + 2] = 0.0f;
|
||||||
out_buffer[out + 3] = 0.0f;
|
out_buffer[out + 3] = 0.0f;
|
||||||
|
@ -829,7 +829,7 @@ void cell_audio_thread::mix(float *out_buffer, s32 offset)
|
||||||
const float side_left = buf[in + 6] * m;
|
const float side_left = buf[in + 6] * m;
|
||||||
const float side_right = buf[in + 7] * m;
|
const float side_right = buf[in + 7] * m;
|
||||||
|
|
||||||
if (downmix_to_2ch)
|
if constexpr (DownmixToStereo)
|
||||||
{
|
{
|
||||||
const float mid = (center + low_freq) * 0.708f;
|
const float mid = (center + low_freq) * 0.708f;
|
||||||
out_buffer[out + 0] = (left + rear_left + side_left + mid) * k;
|
out_buffer[out + 0] = (left + rear_left + side_left + mid) * k;
|
||||||
|
@ -864,7 +864,7 @@ void cell_audio_thread::mix(float *out_buffer, s32 offset)
|
||||||
const float side_left = buf[in + 6] * m;
|
const float side_left = buf[in + 6] * m;
|
||||||
const float side_right = buf[in + 7] * m;
|
const float side_right = buf[in + 7] * m;
|
||||||
|
|
||||||
if (downmix_to_2ch)
|
if constexpr (DownmixToStereo)
|
||||||
{
|
{
|
||||||
const float mid = (center + low_freq) * 0.708f;
|
const float mid = (center + low_freq) * 0.708f;
|
||||||
out_buffer[out + 0] += (left + rear_left + side_left + mid) * k;
|
out_buffer[out + 0] += (left + rear_left + side_left + mid) * k;
|
||||||
|
|
|
@ -328,7 +328,8 @@ class cell_audio_thread
|
||||||
void reset_ports(s32 offset = 0);
|
void reset_ports(s32 offset = 0);
|
||||||
void advance(u64 timestamp, bool reset = true);
|
void advance(u64 timestamp, bool reset = true);
|
||||||
std::tuple<u32, u32, u32, u32> count_port_buffer_tags();
|
std::tuple<u32, u32, u32, u32> count_port_buffer_tags();
|
||||||
template<bool downmix_to_2ch> void mix(float *out_buffer, s32 offset = 0);
|
template <bool DownmixToStereo>
|
||||||
|
void mix(float *out_buffer, s32 offset = 0);
|
||||||
void finish_port_volume_stepping();
|
void finish_port_volume_stepping();
|
||||||
|
|
||||||
constexpr static u64 get_thread_wait_delay(u64 time_left)
|
constexpr static u64 get_thread_wait_delay(u64 time_left)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue