Browse Source

Use ReadOnlySpan

Co-authored-by: Günther Foidl <gue@korporal.at>
pull/1799/head
Brian Popow 4 years ago
committed by GitHub
parent
commit
67fd2d0427
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/ImageSharp/Formats/Webp/Lossless/PredictorEncoder.cs
  2. 3
      src/ImageSharp/Formats/Webp/Lossless/Vp8LEncoder.cs

3
src/ImageSharp/Formats/Webp/Lossless/PredictorEncoder.cs

@ -17,7 +17,8 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless
/// </summary>
internal static unsafe class PredictorEncoder
{
private static readonly sbyte[] DeltaLut = { 16, 16, 8, 4, 2, 2, 2 };
// This uses C#'s compiler optimization to refer to assembly's static data directly.
private static ReadOnlySpan<sbyte> DeltaLut => new sbyte[] { 16, 16, 8, 4, 2, 2, 2 };
private static readonly sbyte[][] Offset =
{

3
src/ImageSharp/Formats/Webp/Lossless/Vp8LEncoder.cs

@ -85,7 +85,8 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless
private const int PaletteInvSize = 1 << PaletteInvSizeBits;
private static readonly byte[] Order = { 1, 2, 0, 3 };
// This uses C#'s compiler optimization to refer to assembly's static data directly.
private static ReadOnlySpan<byte> Order => new byte[] { 1, 2, 0, 3 };
/// <summary>
/// Initializes a new instance of the <see cref="Vp8LEncoder"/> class.

Loading…
Cancel
Save