Browse Source

Rename ITransform to ITransformTwo to better reflect that actually two transforms take place

pull/1862/head
Brian Popow 5 years ago
parent
commit
8e515c1423
  1. 4
      src/ImageSharp/Formats/Webp/Lossy/QuantEnc.cs
  2. 2
      src/ImageSharp/Formats/Webp/Lossy/Vp8Encoding.cs
  3. 2
      tests/ImageSharp.Tests/Formats/WebP/Vp8EncodingTests.cs

4
src/ImageSharp/Formats/Webp/Lossy/QuantEnc.cs

@ -329,7 +329,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
LossyUtils.TransformWht(dcTmp, tmp, scratch);
for (n = 0; n < 16; n += 2)
{
Vp8Encoding.ITransform(reference.Slice(WebpLookupTables.Vp8Scan[n]), tmp.Slice(n * 16, 32), yuvOut.Slice(WebpLookupTables.Vp8Scan[n]), scratch);
Vp8Encoding.ITransformTwo(reference.Slice(WebpLookupTables.Vp8Scan[n]), tmp.Slice(n * 16, 32), yuvOut.Slice(WebpLookupTables.Vp8Scan[n]), scratch);
}
return nz;
@ -375,7 +375,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
for (n = 0; n < 8; n += 2)
{
Vp8Encoding.ITransform(reference.Slice(WebpLookupTables.Vp8ScanUv[n]), tmp.Slice(n * 16, 32), yuvOut.Slice(WebpLookupTables.Vp8ScanUv[n]), scratch);
Vp8Encoding.ITransformTwo(reference.Slice(WebpLookupTables.Vp8ScanUv[n]), tmp.Slice(n * 16, 32), yuvOut.Slice(WebpLookupTables.Vp8ScanUv[n]), scratch);
}
return nz << 16;

2
src/ImageSharp/Formats/Webp/Lossy/Vp8Encoding.cs

@ -111,7 +111,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
// Transforms (Paragraph 14.4)
// Does two inverse transforms.
public static void ITransform(Span<byte> reference, Span<short> input, Span<byte> dst, Span<int> scratch)
public static void ITransformTwo(Span<byte> reference, Span<short> input, Span<byte> dst, Span<int> scratch)
{
#if SUPPORTS_RUNTIME_INTRINSICS
if (Sse2.IsSupported)

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

@ -120,7 +120,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Webp
int[] scratch = new int[16];
// act
Vp8Encoding.ITransform(reference, input, dst, scratch);
Vp8Encoding.ITransformTwo(reference, input, dst, scratch);
// assert
Assert.True(dst.SequenceEqual(expected));

Loading…
Cancel
Save