Address gdkchan's comments

This commit is contained in:
Mary 2022-03-20 18:14:52 +01:00
parent 168c1753de
commit 419fd76f9c
4 changed files with 27 additions and 37 deletions

View file

@ -136,12 +136,10 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
float dryGain = FixedPointHelper.ToFloat(Parameter.DryGain, FixedPointPrecision); float dryGain = FixedPointHelper.ToFloat(Parameter.DryGain, FixedPointPrecision);
float outGain = FixedPointHelper.ToFloat(Parameter.OutGain, FixedPointPrecision); float outGain = FixedPointHelper.ToFloat(Parameter.OutGain, FixedPointPrecision);
Matrix4x4 delayFeedback = new Matrix4x4( Matrix4x4 delayFeedback = new Matrix4x4(delayFeedbackBaseGain , delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f,
delayFeedbackBaseGain , delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f,
delayFeedbackCrossGain, delayFeedbackBaseGain , 0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain, delayFeedbackBaseGain , 0.0f , delayFeedbackCrossGain,
delayFeedbackCrossGain, 0.0f , delayFeedbackBaseGain , delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f , delayFeedbackBaseGain , delayFeedbackCrossGain,
0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain, delayFeedbackBaseGain 0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain, delayFeedbackBaseGain);
);
for (int i = 0; i < sampleCount; i++) for (int i = 0; i < sampleCount; i++)
@ -185,14 +183,12 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
float dryGain = FixedPointHelper.ToFloat(Parameter.DryGain, FixedPointPrecision); float dryGain = FixedPointHelper.ToFloat(Parameter.DryGain, FixedPointPrecision);
float outGain = FixedPointHelper.ToFloat(Parameter.OutGain, FixedPointPrecision); float outGain = FixedPointHelper.ToFloat(Parameter.OutGain, FixedPointPrecision);
Matrix6x6 delayFeedback = new Matrix6x6( Matrix6x6 delayFeedback = new Matrix6x6(delayFeedbackBaseGain , 0.0f , 0.0f , 0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain,
delayFeedbackBaseGain , 0.0f , 0.0f , 0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain,
0.0f , delayFeedbackBaseGain , 0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f , 0.0f , delayFeedbackBaseGain , 0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f ,
delayFeedbackCrossGain, 0.0f , delayFeedbackBaseGain , delayFeedbackCrossGain, 0.0f , 0.0f , delayFeedbackCrossGain, 0.0f , delayFeedbackBaseGain , delayFeedbackCrossGain, 0.0f , 0.0f ,
0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain, delayFeedbackBaseGain , 0.0f , 0.0f , 0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain, delayFeedbackBaseGain , 0.0f , 0.0f ,
delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f , 0.0f , delayFeedbackBaseGain , 0.0f , delayFeedbackCrossGain, delayFeedbackCrossGain, 0.0f , 0.0f , delayFeedbackBaseGain , 0.0f ,
0.0f , 0.0f , 0.0f , 0.0f , 0.0f , feedbackGain 0.0f , 0.0f , 0.0f , 0.0f , 0.0f , feedbackGain);
);
for (int i = 0; i < sampleCount; i++) for (int i = 0; i < sampleCount; i++)
{ {

View file

@ -1,8 +1,6 @@
using System; namespace Ryujinx.Audio.Renderer.Utils.Math
namespace Ryujinx.Audio.Renderer.Utils.Math
{ {
public record struct Matrix2x2 record struct Matrix2x2
{ {
public float M11; public float M11;
public float M12; public float M12;
@ -55,7 +53,7 @@ namespace Ryujinx.Audio.Renderer.Utils.Math
return m; return m;
} }
public static unsafe Matrix2x2 operator *(Matrix2x2 value1, Matrix2x2 value2) public static Matrix2x2 operator *(Matrix2x2 value1, Matrix2x2 value2)
{ {
Matrix2x2 m; Matrix2x2 m;

View file

@ -1,6 +1,6 @@
namespace Ryujinx.Audio.Renderer.Utils.Math namespace Ryujinx.Audio.Renderer.Utils.Math
{ {
public record struct Matrix6x6 record struct Matrix6x6
{ {
public float M11; public float M11;
public float M12; public float M12;

View file

@ -2,7 +2,7 @@
namespace Ryujinx.Audio.Renderer.Utils.Math namespace Ryujinx.Audio.Renderer.Utils.Math
{ {
public struct Vector6 record struct Vector6
{ {
public float X; public float X;
public float Y; public float Y;
@ -28,27 +28,23 @@ namespace Ryujinx.Audio.Renderer.Utils.Math
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector6 operator +(Vector6 left, Vector6 right) public static Vector6 operator +(Vector6 left, Vector6 right)
{ {
return new Vector6( return new Vector6(left.X + right.X,
left.X + right.X,
left.Y + right.Y, left.Y + right.Y,
left.Z + right.Z, left.Z + right.Z,
left.W + right.W, left.W + right.W,
left.V + right.V, left.V + right.V,
left.U + right.U left.U + right.U);
);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector6 operator *(Vector6 left, Vector6 right) public static Vector6 operator *(Vector6 left, Vector6 right)
{ {
return new Vector6( return new Vector6(left.X * right.X,
left.X * right.X,
left.Y * right.Y, left.Y * right.Y,
left.Z * right.Z, left.Z * right.Z,
left.W * right.W, left.W * right.W,
left.V * right.V, left.V * right.V,
left.U * right.U left.U * right.U);
);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]