Browse Source

Add SSE2 version of SimpleHFilter16i

pull/1871/head
Brian Popow 5 years ago
parent
commit
c8d182bad6
  1. 19
      src/ImageSharp/Formats/Webp/Lossy/LossyUtils.cs

19
src/ImageSharp/Formats/Webp/Lossy/LossyUtils.cs

@ -1303,10 +1303,23 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
public static void SimpleHFilter16i(Span<byte> p, int offset, int stride, int thresh) public static void SimpleHFilter16i(Span<byte> p, int offset, int stride, int thresh)
{ {
for (int k = 3; k > 0; k--) #if SUPPORTS_RUNTIME_INTRINSICS
if (Sse2.IsSupported)
{ {
offset += 4; for (int k = 3; k > 0; k--)
SimpleHFilter16(p, offset, stride, thresh); {
offset += 4;
SimpleHFilter16(p, offset, stride, thresh);
}
}
else
#endif
{
for (int k = 3; k > 0; k--)
{
offset += 4;
SimpleHFilter16(p, offset, stride, thresh);
}
} }
} }

Loading…
Cancel
Save