|
|
|
@ -272,35 +272,33 @@ void CommandBuffer::GenerateBiquadFilterCommand(const s32 node_id, EffectInfoBas |
|
|
|
effect_info.GetStateBuffer() + channel * sizeof(VoiceState::BiquadFilterState))}; |
|
|
|
|
|
|
|
if (behavior->IsEffectInfoVersion2Supported()) { |
|
|
|
const auto& p{ |
|
|
|
const auto& parameter{ |
|
|
|
*reinterpret_cast<BiquadFilterInfo::ParameterVersion2*>(effect_info.GetParameter())}; |
|
|
|
|
|
|
|
if (!IsChannelCountValid(p.channel_count) || channel < 0 || channel >= p.channel_count) { |
|
|
|
return; |
|
|
|
} |
|
|
|
if (parameter.state <= EffectInfoBase::ParameterState::Updated && IsChannelCountValid(parameter.channel_count) && channel >= 0 && channel < parameter.channel_count) { |
|
|
|
cmd.input = buffer_offset + parameter.inputs[channel]; |
|
|
|
cmd.output = buffer_offset + parameter.outputs[channel]; |
|
|
|
|
|
|
|
cmd.input = buffer_offset + p.inputs[channel]; |
|
|
|
cmd.output = buffer_offset + p.outputs[channel]; |
|
|
|
|
|
|
|
// Convert float coefficients to Q2.14 fixed-point as expected by the legacy DSP path.
|
|
|
|
cmd.biquad.b[0] = ToQ14Clamped(p.b[0]); |
|
|
|
cmd.biquad.b[1] = ToQ14Clamped(p.b[1]); |
|
|
|
cmd.biquad.b[2] = ToQ14Clamped(p.b[2]); |
|
|
|
cmd.biquad.a[0] = ToQ14Clamped(p.a[0]); |
|
|
|
cmd.biquad.a[1] = ToQ14Clamped(p.a[1]); |
|
|
|
// Convert float coefficients to Q2.14 fixed-point as expected by the legacy DSP path.
|
|
|
|
cmd.biquad.b[0] = ToQ14Clamped(parameter.b[0]); |
|
|
|
cmd.biquad.b[1] = ToQ14Clamped(parameter.b[1]); |
|
|
|
cmd.biquad.b[2] = ToQ14Clamped(parameter.b[2]); |
|
|
|
cmd.biquad.a[0] = ToQ14Clamped(parameter.a[0]); |
|
|
|
cmd.biquad.a[1] = ToQ14Clamped(parameter.a[1]); |
|
|
|
} |
|
|
|
} else { |
|
|
|
const auto& p{ |
|
|
|
const auto& parameter{ |
|
|
|
*reinterpret_cast<BiquadFilterInfo::ParameterVersion1*>(effect_info.GetParameter())}; |
|
|
|
|
|
|
|
if (!IsChannelCountValid(p.channel_count) || channel < 0 || channel >= p.channel_count) { |
|
|
|
if (!IsChannelCountValid(parameter.channel_count) || channel < 0 || channel >= parameter.channel_count) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
cmd.input = buffer_offset + p.inputs[channel]; |
|
|
|
cmd.output = buffer_offset + p.outputs[channel]; |
|
|
|
cmd.input = buffer_offset + parameter.inputs[channel]; |
|
|
|
cmd.output = buffer_offset + parameter.outputs[channel]; |
|
|
|
|
|
|
|
cmd.biquad.b = p.b; |
|
|
|
cmd.biquad.a = p.a; |
|
|
|
cmd.biquad.b = parameter.b; |
|
|
|
cmd.biquad.a = parameter.a; |
|
|
|
} |
|
|
|
|
|
|
|
// Effects always use the fixed-point coefficient path on the DSP.
|
|
|
|
|