Browse Source

Remove more unnecessary Clear's

pull/1817/head
Brian Popow 5 years ago
parent
commit
5630b25733
  1. 4
      src/ImageSharp/Formats/Webp/Lossy/QuantEnc.cs
  2. 3
      src/ImageSharp/Formats/Webp/Lossy/Vp8Encoding.cs

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

@ -340,8 +340,6 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
Span<byte> reference = it.YuvP.AsSpan(Vp8Encoding.Vp8I4ModeOffsets[mode]); Span<byte> reference = it.YuvP.AsSpan(Vp8Encoding.Vp8I4ModeOffsets[mode]);
Span<short> tmp = it.Scratch2.AsSpan(0, 16); Span<short> tmp = it.Scratch2.AsSpan(0, 16);
Span<int> scratch = it.Scratch3.AsSpan(0, 16); Span<int> scratch = it.Scratch3.AsSpan(0, 16);
tmp.Clear();
scratch.Clear();
Vp8Encoding.FTransform(src, reference, tmp, scratch); Vp8Encoding.FTransform(src, reference, tmp, scratch);
int nz = QuantizeBlock(tmp, levels, ref dqm.Y1); int nz = QuantizeBlock(tmp, levels, ref dqm.Y1);
Vp8Encoding.ITransform(reference, tmp, yuvOut, false, scratch); Vp8Encoding.ITransform(reference, tmp, yuvOut, false, scratch);
@ -357,8 +355,6 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
int n; int n;
Span<short> tmp = it.Scratch2.AsSpan(0, 8 * 16); Span<short> tmp = it.Scratch2.AsSpan(0, 8 * 16);
Span<int> scratch = it.Scratch3.AsSpan(0, 16); Span<int> scratch = it.Scratch3.AsSpan(0, 16);
tmp.Clear();
scratch.Clear();
for (n = 0; n < 8; n += 2) for (n = 0; n < 8; n += 2)
{ {

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

@ -81,7 +81,6 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
{ {
int i; int i;
Span<int> tmp = scratch.Slice(0, 16); Span<int> tmp = scratch.Slice(0, 16);
tmp.Clear();
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
// vertical pass. // vertical pass.
@ -124,7 +123,6 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
{ {
int i; int i;
Span<int> tmp = scratch.Slice(0, 16); Span<int> tmp = scratch.Slice(0, 16);
tmp.Clear();
int srcIdx = 0; int srcIdx = 0;
int refIdx = 0; int refIdx = 0;
@ -163,7 +161,6 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
public static void FTransformWht(Span<short> input, Span<short> output, Span<int> scratch) public static void FTransformWht(Span<short> input, Span<short> output, Span<int> scratch)
{ {
Span<int> tmp = scratch.Slice(0, 16); Span<int> tmp = scratch.Slice(0, 16);
tmp.Clear();
int i; int i;
int inputIdx = 0; int inputIdx = 0;

Loading…
Cancel
Save