Browse Source

Enable PickBestIntra4

pull/1552/head
Brian Popow 5 years ago
parent
commit
422337ccf5
  1. 6
      src/ImageSharp/Formats/WebP/Lossy/LossyUtils.cs
  2. 2
      src/ImageSharp/Formats/WebP/Lossy/QuantEnc.cs
  3. 3
      src/ImageSharp/Formats/WebP/Lossy/Vp8Encoder.cs

6
src/ImageSharp/Formats/WebP/Lossy/LossyUtils.cs

@ -49,11 +49,11 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
[MethodImpl(InliningOptions.ShortMethod)]
public static void Copy(Span<byte> src, Span<byte> dst, int w, int h)
{
int offset = 0;
for (int y = 0; y < h; ++y)
{
src.Slice(0, w).CopyTo(dst);
src = src.Slice(WebpConstants.Bps);
dst = dst.Slice(WebpConstants.Bps);
src.Slice(offset, w).CopyTo(dst.Slice(offset, w));
offset += WebpConstants.Bps;
}
}

2
src/ImageSharp/Formats/WebP/Lossy/QuantEnc.cs

@ -168,7 +168,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
Span<byte> tmp = tmpDst;
tmpDst = bestBlock;
bestBlock = tmp;
tmpLevels.AsSpan().CopyTo(rdBest.YAcLevels);
tmpLevels.CopyTo(rdBest.YAcLevels.AsSpan(it.I4 * 16, 16));
}
}

3
src/ImageSharp/Formats/WebP/Lossy/Vp8Encoder.cs

@ -893,8 +893,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
QuantEnc.PickBestIntra16(it, ref rd, this.SegmentInfos, this.Proba);
if (this.method >= 2)
{
// TODO: there is still a bug in PickBestIntra4, therefore disabled.
// QuantEnc.PickBestIntra4(it, ref rd, this.SegmentInfos, this.Proba, this.maxI4HeaderBits);
QuantEnc.PickBestIntra4(it, ref rd, this.SegmentInfos, this.Proba, this.maxI4HeaderBits);
}
QuantEnc.PickBestUv(it, ref rd, this.SegmentInfos, this.Proba);

Loading…
Cancel
Save