Skip to content

Commit 7e20c5d

Browse files
committed
Rename Vp8Sse methods
1 parent dcca236 commit 7e20c5d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ internal static class LossyUtils
1919
private static readonly Vector128<byte> Mean16x4Mask = Vector128.Create((short)0x00ff).AsByte();
2020
#endif
2121

22+
// Note: method name in libwebp reference implementation is called VP8SSE16x16.
2223
[MethodImpl(InliningOptions.ShortMethod)]
23-
public static int Vp8Sse16X16(Span<byte> a, Span<byte> b) => GetSse(a, b, 16, 16);
24+
public static int Vp8_Sse16X16(Span<byte> a, Span<byte> b) => Vp8_SseNxN(a, b, 16, 16);
2425

26+
// Note: method name in libwebp reference implementation is called VP8SSE16x8.
2527
[MethodImpl(InliningOptions.ShortMethod)]
26-
public static int Vp8Sse16X8(Span<byte> a, Span<byte> b) => GetSse(a, b, 16, 8);
28+
public static int Vp8_Sse16X8(Span<byte> a, Span<byte> b) => Vp8_SseNxN(a, b, 16, 8);
2729

30+
// Note: method name in libwebp reference implementation is called VP8SSE4x4.
2831
[MethodImpl(InliningOptions.ShortMethod)]
29-
public static int Vp8Sse4X4(Span<byte> a, Span<byte> b)
32+
public static int Vp8_Sse4X4(Span<byte> a, Span<byte> b)
3033
{
3134
#if SUPPORTS_RUNTIME_INTRINSICS
3235
if (Sse2.IsSupported)
@@ -67,12 +70,12 @@ public static int Vp8Sse4X4(Span<byte> a, Span<byte> b)
6770
else
6871
#endif
6972
{
70-
return GetSse(a, b, 4, 4);
73+
return Vp8_SseNxN(a, b, 4, 4);
7174
}
7275
}
7376

7477
[MethodImpl(InliningOptions.ShortMethod)]
75-
public static int GetSse(Span<byte> a, Span<byte> b, int w, int h)
78+
public static int Vp8_SseNxN(Span<byte> a, Span<byte> b, int w, int h)
7679
{
7780
int count = 0;
7881
int aOffset = 0;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private static void RunVp8Sse4X4Test()
3535

3636
int expected = 27;
3737

38-
int actual = LossyUtils.Vp8Sse4X4(a, b);
38+
int actual = LossyUtils.Vp8_Sse4X4(a, b);
3939

4040
Assert.Equal(expected, actual);
4141
}

0 commit comments

Comments
 (0)