Skip to content

Commit 9672d48

Browse files
Fix Ssse3 Path decode
1 parent ad1b0e6 commit 9672d48

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/ImageSharp/Formats/Png/Filters/PaethFilter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public static void Decode(Span<byte> scanline, Span<byte> previousScanline, int
3535
// row: a d
3636
// The Paeth function predicts d to be whichever of a, b, or c is nearest to
3737
// p = a + b - c.
38-
if (Sse2.IsSupported && bytesPerPixel is 4)
38+
if (Ssse3.IsSupported && bytesPerPixel is 4)
3939
{
40-
DecodeSse3(scanline, previousScanline);
40+
DecodeSsse3(scanline, previousScanline);
4141
}
4242
else if (AdvSimd.Arm64.IsSupported && bytesPerPixel is 4)
4343
{
@@ -50,7 +50,7 @@ public static void Decode(Span<byte> scanline, Span<byte> previousScanline, int
5050
}
5151

5252
[MethodImpl(MethodImplOptions.AggressiveInlining)]
53-
private static void DecodeSse3(Span<byte> scanline, Span<byte> previousScanline)
53+
private static void DecodeSsse3(Span<byte> scanline, Span<byte> previousScanline)
5454
{
5555
ref byte scanBaseRef = ref MemoryMarshal.GetReference(scanline);
5656
ref byte prevBaseRef = ref MemoryMarshal.GetReference(previousScanline);

tests/ImageSharp.Tests/Formats/Png/PngDecoderFilterTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ private static void RunPaethFilterTest()
170170
[Fact]
171171
public void PaethFilter_WithHardwareIntrinsics_Works() => FeatureTestRunner.RunWithHwIntrinsicsFeature(RunPaethFilterTest, HwIntrinsics.AllowAll);
172172

173+
[Fact]
174+
public void PaethFilter_WithoutSsse3_Works() => FeatureTestRunner.RunWithHwIntrinsicsFeature(RunPaethFilterTest, HwIntrinsics.DisableSSSE3);
175+
173176
[Fact]
174177
public void PaethFilter_WithoutHardwareIntrinsics_Works() => FeatureTestRunner.RunWithHwIntrinsicsFeature(RunPaethFilterTest, HwIntrinsics.DisableHWIntrinsic);
175178
}

0 commit comments

Comments
 (0)