Skip to content

Commit

Permalink
Rename Vp8Sse methods
Browse files Browse the repository at this point in the history
  • Loading branch information
brianpopow committed Nov 10, 2021
1 parent dcca236 commit 7e20c5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/ImageSharp/Formats/Webp/Lossy/LossyUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ internal static class LossyUtils
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)
Expand Down Expand Up @@ -67,12 +70,12 @@ public static int Vp8Sse4X4(Span<byte> a, Span<byte> b)
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;
Expand Down
2 changes: 1 addition & 1 deletion tests/ImageSharp.Tests/Formats/WebP/LossyUtilsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private static void RunVp8Sse4X4Test()

int expected = 27;

int actual = LossyUtils.Vp8Sse4X4(a, b);
int actual = LossyUtils.Vp8_Sse4X4(a, b);

Assert.Equal(expected, actual);
}
Expand Down

0 comments on commit 7e20c5d

Please sign in to comment.