From 352b14df9a2d97ec5e077787de572a2f45e0c2fa Mon Sep 17 00:00:00 2001 From: winscripter <142818255+winscripter@users.noreply.github.com> Date: Mon, 24 Aug 2026 21:17:12 +0400 Subject: [PATCH] Reduce errors, remove unused constant --- .../Formats/Jxl/Processing/JxlLoopFilter.cs | 5 ----- .../Formats/Jxl/Processing/JxlQuantizer.cs | 18 +++++++++--------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/ImageSharp/Formats/Jxl/Processing/JxlLoopFilter.cs b/src/ImageSharp/Formats/Jxl/Processing/JxlLoopFilter.cs index 2df002fba..825c81cbb 100644 --- a/src/ImageSharp/Formats/Jxl/Processing/JxlLoopFilter.cs +++ b/src/ImageSharp/Formats/Jxl/Processing/JxlLoopFilter.cs @@ -21,11 +21,6 @@ internal sealed class JxlLoopFilter : IJxlFields /// private const float InverseSigmaNum = -1.1715728752538099024f; - /// - /// kInvSigmaNum / 0.3 - /// - private const float MinSigma = -3.90524291751269967465540850526868f; - /// /// Gets the number of EPF (Edge-preserving filter) sharp entries. /// diff --git a/src/ImageSharp/Formats/Jxl/Processing/JxlQuantizer.cs b/src/ImageSharp/Formats/Jxl/Processing/JxlQuantizer.cs index ef9e360bb..9551b97e0 100644 --- a/src/ImageSharp/Formats/Jxl/Processing/JxlQuantizer.cs +++ b/src/ImageSharp/Formats/Jxl/Processing/JxlQuantizer.cs @@ -52,12 +52,12 @@ internal sealed class JxlQuantizer /// /// Represents the multipliers for the DC coefficients. /// - private readonly InlineArray4 mulDc; + private InlineArray4 mulDc; /// /// Represents the inverse multipliers for the DC coefficients. /// - private readonly InlineArray4 inverseMulDc; + private InlineArray4 inverseMulDc; /// /// Global scale @@ -148,8 +148,8 @@ internal sealed class JxlQuantizer /// public void ClearDcMultipliers() { - Array.Fill(this.mulDc, 1f); - Array.Fill(this.inverseMulDc, 1f); + ((Span)this.mulDc).Fill(1f); + ((Span)this.inverseMulDc).Fill(1f); } /// @@ -303,8 +303,8 @@ internal sealed class JxlQuantizer { for (int y = 0; y < rect.Height; y++) { - ReadOnlySpan rowQf = qf.GetRow(in rect, y); - Span rowQi = rawQuantField.GetRow(in rect, y); + ReadOnlySpan rowQf = qf.GetRow(rect, y); + Span rowQi = rawQuantField.GetRow(rect, y); for (int x = 0; x < rect.Width; x++) { @@ -352,7 +352,7 @@ internal sealed class JxlQuantizer if (rawQuantField != null) { - if (rawQuantField.GetSize() != qf.GetSize()) + if (rawQuantField.GetRectangle() != qf.GetRectangle()) { data.Dispose(); deviations.Dispose(); @@ -360,7 +360,7 @@ internal sealed class JxlQuantizer return false; } - this.SetQuantField(qf, qf.GetRectangle(), rawQuantField); + this.SetQuantFieldRect(qf, qf.GetRectangle(), rawQuantField); } data.Dispose(); @@ -374,6 +374,6 @@ internal sealed class JxlQuantizer this.ComputeGlobalScaleAndQuant(quantDc, quantAc, 0); int value = Clamp((quantAc * this.InverseGlobalScale) + 0.5f); - rawQuantField.Fill(value); + JxlImageOperations.FillImage(value, rawQuantField); } }