@ -74,9 +74,11 @@ namespace SixLabors.ImageSharp.Formats.Png.Zlib
this . pinnedLiteralBuffer = ( short * ) this . literalBufferHandle . Pointer ;
}
#pragma warning disable SA1201 // Elements should appear in the correct order
// See RFC 1951 3.2.6
// Literal codes
private static short [ ] StaticLCodes = > new short [ ]
private static readonly short [ ] StaticLCodes = new short [ ]
{
1 2 , 1 4 0 , 7 6 , 2 0 4 , 4 4 , 1 7 2 , 1 0 8 , 2 3 6 , 2 8 , 1 5 6 , 9 2 , 2 2 0 , 6 0 , 1 8 8 , 1 2 4 , 2 5 2 ,
2 , 1 3 0 , 6 6 , 1 9 4 , 3 4 , 1 6 2 , 9 8 , 2 2 6 , 1 8 , 1 4 6 , 8 2 , 2 1 0 , 5 0 , 1 7 8 , 1 1 4 , 2 4 2 ,
@ -121,7 +123,7 @@ namespace SixLabors.ImageSharp.Formats.Png.Zlib
} ;
// Distance codes and lengths.
private static short [ ] StaticDCodes = > new short [ ]
private static readonly short [ ] StaticDCodes = new short [ ]
{
0 , 1 6 , 8 , 2 4 , 4 , 2 0 , 1 2 , 2 8 , 2 , 1 8 , 1 0 , 2 6 , 6 , 2 2 , 1 4 ,
3 0 , 1 , 1 7 , 9 , 2 5 , 5 , 2 1 , 1 3 , 2 9 , 3 , 1 9 , 1 1 , 2 7 , 7 , 2 3
@ -132,6 +134,7 @@ namespace SixLabors.ImageSharp.Formats.Png.Zlib
5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 ,
5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5
} ;
#pragma warning restore SA1201 // Elements should appear in the correct order
/// <summary>
/// Gets the lengths of the bit length codes are sent in order of decreasing probability, to avoid transmitting the lengths for unused bit length codes.