Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ImageSharp/Formats/Png/Filters/PaethFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public static void Decode(Span<byte> scanline, Span<byte> previousScanline, int
// row: a d
// The Paeth function predicts d to be whichever of a, b, or c is nearest to
// p = a + b - c.
if (Sse2.IsSupported && bytesPerPixel is 4)
if (Ssse3.IsSupported && bytesPerPixel is 4)
{
DecodeSse3(scanline, previousScanline);
DecodeSsse3(scanline, previousScanline);
}
else if (AdvSimd.Arm64.IsSupported && bytesPerPixel is 4)
{
Expand All @@ -50,7 +50,7 @@ public static void Decode(Span<byte> scanline, Span<byte> previousScanline, int
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static void DecodeSse3(Span<byte> scanline, Span<byte> previousScanline)
private static void DecodeSsse3(Span<byte> scanline, Span<byte> previousScanline)
{
ref byte scanBaseRef = ref MemoryMarshal.GetReference(scanline);
ref byte prevBaseRef = ref MemoryMarshal.GetReference(previousScanline);
Expand Down
3 changes: 3 additions & 0 deletions tests/ImageSharp.Tests/Formats/Png/PngDecoderFilterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ private static void RunPaethFilterTest()
[Fact]
public void PaethFilter_WithHardwareIntrinsics_Works() => FeatureTestRunner.RunWithHwIntrinsicsFeature(RunPaethFilterTest, HwIntrinsics.AllowAll);

[Fact]
public void PaethFilter_WithoutSsse3_Works() => FeatureTestRunner.RunWithHwIntrinsicsFeature(RunPaethFilterTest, HwIntrinsics.DisableSSSE3);

[Fact]
public void PaethFilter_WithoutHardwareIntrinsics_Works() => FeatureTestRunner.RunWithHwIntrinsicsFeature(RunPaethFilterTest, HwIntrinsics.DisableHWIntrinsic);
}