Browse Source

Rename Vp8Sse methods

pull/1817/head
Brian Popow 4 years ago
parent
commit
7e20c5daaa
  1. 13
      src/ImageSharp/Formats/Webp/Lossy/LossyUtils.cs
  2. 2
      tests/ImageSharp.Tests/Formats/WebP/LossyUtilsTests.cs

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

@ -19,14 +19,17 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
private static readonly Vector128<byte> Mean16x4Mask = Vector128.Create((short)0x00ff).AsByte();
#endif
// Note: method name in libwebp reference implementation is called VP8SSE16x16.
[MethodImpl(InliningOptions.ShortMethod)]
public static int Vp8Sse16X16(Span<byte> a, Span<byte> b) => GetSse(a, b, 16, 16);
public static int Vp8_Sse16X16(Span<byte> a, Span<byte> b) => Vp8_SseNxN(a, b, 16, 16);
// Note: method name in libwebp reference implementation is called VP8SSE16x8.
[MethodImpl(InliningOptions.ShortMethod)]
public static int Vp8Sse16X8(Span<byte> a, Span<byte> b) => GetSse(a, b, 16, 8);
public static int Vp8_Sse16X8(Span<byte> a, Span<byte> b) => Vp8_SseNxN(a, b, 16, 8);
// Note: method name in libwebp reference implementation is called VP8SSE4x4.
[MethodImpl(InliningOptions.ShortMethod)]
public static int Vp8Sse4X4(Span<byte> a, Span<byte> b)
public static int Vp8_Sse4X4(Span<byte> a, Span<byte> b)
{
#if SUPPORTS_RUNTIME_INTRINSICS
if (Sse2.IsSupported)
@ -67,12 +70,12 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
else
#endif
{
return GetSse(a, b, 4, 4);
return Vp8_SseNxN(a, b, 4, 4);
}
}
[MethodImpl(InliningOptions.ShortMethod)]
public static int GetSse(Span<byte> a, Span<byte> b, int w, int h)
public static int Vp8_SseNxN(Span<byte> a, Span<byte> b, int w, int h)
{
int count = 0;
int aOffset = 0;

2
tests/ImageSharp.Tests/Formats/WebP/LossyUtilsTests.cs

@ -35,7 +35,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.WebP
int expected = 27;
int actual = LossyUtils.Vp8Sse4X4(a, b);
int actual = LossyUtils.Vp8_Sse4X4(a, b);
Assert.Equal(expected, actual);
}

Loading…
Cancel
Save