From f4dc0fc4f2d9db47c4100e1985dbdb98eee3b04e Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 29 Nov 2023 12:56:43 +1000 Subject: [PATCH] Disable Sse2 for now. --- src/ImageSharp/Formats/AnimationUtilities.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Formats/AnimationUtilities.cs b/src/ImageSharp/Formats/AnimationUtilities.cs index 727364227..5e576c983 100644 --- a/src/ImageSharp/Formats/AnimationUtilities.cs +++ b/src/ImageSharp/Formats/AnimationUtilities.cs @@ -128,7 +128,8 @@ internal static class AnimationUtilities } } - if (Sse2.IsSupported && remaining >= 4) + // TODO: There's a bug here. See WebpEncoderTests.Encode_AnimatedLossless + if (Sse2.IsSupported && remaining >= 4 && false) { Vector128 r128 = previousFrame != null ? Vector128.Create(bg.PackedValue) : Vector128.Zero; Vector128 vmb128 = Vector128.Zero; @@ -151,7 +152,7 @@ internal static class AnimationUtilities eq = Sse2.AndNot(Sse2.CompareGreaterThan(Sse2.ShiftRightLogical(c, 24).AsInt32(), n).AsUInt32(), eq); } - Unsafe.Add(ref Unsafe.As, Vector128>(ref resultBase), x) = r.AsByte(); + Unsafe.Add(ref Unsafe.As, Vector128>(ref resultBase), x) = r; ushort msk = (ushort)(uint)Sse2.MoveMask(eq.AsByte()); msk = (ushort)~msk;