Browse Source

LosslessWebP: use logical connections between fields to make it less error prone

pull/1552/head
Peter Amrehn 6 years ago
parent
commit
2ec0fa7162
  1. 5
      src/ImageSharp/Formats/WebP/WebPLosslessDecoder.cs

5
src/ImageSharp/Formats/WebP/WebPLosslessDecoder.cs

@ -47,10 +47,9 @@ namespace SixLabors.ImageSharp.Formats.WebP
FixedTableSize + 2704
};
private static readonly int NumCodeLengthCodes = 19;
private static readonly byte[] KCodeLengthCodeOrder = { 17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
private static readonly int NumCodeLengthCodes = KCodeLengthCodeOrder.Length;
private static readonly int CodeToPlaneCodes = 120;
private static readonly int[] KCodeToPlane =
{
0x18, 0x07, 0x17, 0x19, 0x28, 0x06, 0x27, 0x29, 0x16, 0x1a,
@ -67,6 +66,8 @@ namespace SixLabors.ImageSharp.Formats.WebP
0x40, 0x72, 0x7e, 0x61, 0x6f, 0x50, 0x71, 0x7f, 0x60, 0x70
};
private static readonly int CodeToPlaneCodes = KCodeToPlane.Length;
private static readonly byte[] KLiteralMap =
{
0, 1, 1, 1, 0

Loading…
Cancel
Save