diff --git a/src/ImageSharp/Formats/Jpeg/Components/ZigZag.Intrinsic.cs b/src/ImageSharp/Formats/Jpeg/Components/ZigZag.Intrinsic.cs
index eb15c8b55..01a00180a 100644
--- a/src/ImageSharp/Formats/Jpeg/Components/ZigZag.Intrinsic.cs
+++ b/src/ImageSharp/Formats/Jpeg/Components/ZigZag.Intrinsic.cs
@@ -21,107 +21,43 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components
/// Gets shuffle vectors for
/// zig zag implementation.
///
- private static ReadOnlySpan SseShuffleMasks1 => new byte[]
- {
- // row0
- 0, 1, 2, 3, _, _, _, _, _, _, 4, 5, 6, 7, _, _,
- _, _, _, _, 0, 1, _, _, 2, 3, _, _, _, _, 4, 5,
- _, _, _, _, _, _, 0, 1, _, _, _, _, _, _, _, _,
-
- // row1
- _, _, _, _, _, _, _, _, _, _, _, _, 8, 9, 10, 11,
- 2, 3, _, _, _, _, _, _, 4, 5, _, _, _, _, _, _,
- _, _, 0, 1, _, _, 2, 3, _, _, _, _, _, _, _, _,
-
- // row2
- _, _, _, _, _, _, 2, 3, _, _, _, _, _, _, 4, 5,
- _, _, _, _, _, _, _, _, 0, 1, _, _, 2, 3, _, _,
-
- // row3
- _, _, _, _, _, _, 12, 13, 14, 15, _, _, _, _, _, _,
- _, _, _, _, 10, 11, _, _, _, _, 12, 13, _, _, _, _,
- _, _, 8, 9, _, _, _, _, _, _, _, _, 10, 11, _, _,
- 6, 7, _, _, _, _, _, _, _, _, _, _, _, _, 8, 9,
-
- // row4
- _, _, 4, 5, _, _, _, _, _, _, _, _, 6, 7, _, _,
- _, _, _, _, 2, 3, _, _, _, _, 4, 5, _, _, _, _,
- _, _, _, _, _, _, 0, 1, 2, 3, _, _, _, _, _, _,
-
- // row5
- _, _, 12, 13, _, _, 14, 15, _, _, _, _, _, _, _, _,
- 10, 11, _, _, _, _, _, _, 12, 13, _, _, _, _, _, _,
-
- // row6
- _, _, _, _, _, _, _, _, 12, 13, _, _, 14, 15, _, _,
- _, _, _, _, _, _, 10, 11, _, _, _, _, _, _, 12, 13,
- 4, 5, 6, 7, _, _, _, _, _, _, _, _, _, _, _, _,
-
- // row7
- 10, 11, _, _, _, _, 12, 13, _, _, 14, 15, _, _, _, _,
- _, _, 8, 9, 10, 11, _, _, _, _, _, _, 12, 13, 14, 15
- };
-
private static ReadOnlySpan SseShuffleMasks => new byte[]
{
// row0
- // A B C
0, 1, 2, 3, _, _, _, _, _, _, 4, 5, 6, 7, _, _,
_, _, _, _, 0, 1, _, _, 2, 3, _, _, _, _, 4, 5,
_, _, _, _, _, _, 0, 1, _, _, _, _, _, _, _, _,
// row1
- // A B C D E
_, _, _, _, _, _, _, _, _, _, _, _, 8, 9, 10, 11,
- _, _, _, _, _, _, _, _, _, _, 6, 7, _, _, _, _,
2, 3, _, _, _, _, _, _, 4, 5, _, _, _, _, _, _,
_, _, 0, 1, _, _, 2, 3, _, _, _, _, _, _, _, _,
- _, _, _, _, 0, 1, _, _, _, _, _, _, _, _, _, _,
// row2
- // B C D E F G
- 8, 9, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
- _, _, 6, 7, _, _, _, _, _, _, _, _, _, _, _, _,
- _, _, _, _, 4, 5, _, _, _, _, _, _, _, _, _, _,
_, _, _, _, _, _, 2, 3, _, _, _, _, _, _, 4, 5,
_, _, _, _, _, _, _, _, 0, 1, _, _, 2, 3, _, _,
- _, _, _, _, _, _, _, _, _, _, 0, 1, _, _, _, _,
// row3
- // A B C D
- // D shuffle mask is the for row4 E row shuffle mask
_, _, _, _, _, _, 12, 13, 14, 15, _, _, _, _, _, _,
_, _, _, _, 10, 11, _, _, _, _, 12, 13, _, _, _, _,
_, _, 8, 9, _, _, _, _, _, _, _, _, 10, 11, _, _,
6, 7, _, _, _, _, _, _, _, _, _, _, _, _, 8, 9,
// row4
- // E F G H
- 6, 7, _, _, _, _, _, _, _, _, _, _, _, _, 8, 9,
_, _, 4, 5, _, _, _, _, _, _, _, _, 6, 7, _, _,
_, _, _, _, 2, 3, _, _, _, _, 4, 5, _, _, _, _,
_, _, _, _, _, _, 0, 1, 2, 3, _, _, _, _, _, _,
// row5
- // B C D E F G
- _, _, _, _, 14, 15, _, _, _, _, _, _, _, _, _, _,
_, _, 12, 13, _, _, 14, 15, _, _, _, _, _, _, _, _,
10, 11, _, _, _, _, _, _, 12, 13, _, _, _, _, _, _,
- _, _, _, _, _, _, _, _, _, _, 10, 11, _, _, _, _,
- _, _, _, _, _, _, _, _, _, _, _, _, 8, 9, _, _,
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, 6, 7,
// row6
- // D E F G H
- _, _, _, _, _, _, _, _, _, _, 14, 15, _, _, _, _,
_, _, _, _, _, _, _, _, 12, 13, _, _, 14, 15, _, _,
_, _, _, _, _, _, 10, 11, _, _, _, _, _, _, 12, 13,
- _, _, _, _, 8, 9, _, _, _, _, _, _, _, _, _, _,
4, 5, 6, 7, _, _, _, _, _, _, _, _, _, _, _, _,
// row7
- // F G H
- _, _, _, _, _, _, _, _, 14, 15, _, _, _, _, _, _,
10, 11, _, _, _, _, 12, 13, _, _, 14, 15, _, _, _, _,
_, _, 8, 9, 10, 11, _, _, _, _, _, _, 12, 13, 14, 15
};
@@ -199,7 +135,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components
{
DebugGuard.IsTrue(Ssse3.IsSupported, "Ssse3 support is required to run this operation!");
- fixed (byte* maskPtr = SseShuffleMasks1)
+ fixed (byte* maskPtr = SseShuffleMasks)
{
Vector128 rowA = block.V0.AsByte();
Vector128 rowB = block.V1.AsByte();