Browse Source

Merge pull request #2905 from paulomorgado/patch-1

Refactor buffer allocation in Vp8BitWriter.cs to use Span<byte> instead of byte[] in WriteFrameHeader
pull/2912/head
James Jackson-South 1 year ago
committed by GitHub
parent
commit
bfa664d74d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      src/ImageSharp/Formats/Webp/BitWriter/Vp8BitWriter.cs

2
src/ImageSharp/Formats/Webp/BitWriter/Vp8BitWriter.cs

@ -604,7 +604,7 @@ internal class Vp8BitWriter : BitWriterBase
uint profile = 0;
int width = this.enc.Width;
int height = this.enc.Height;
byte[] vp8FrameHeader = new byte[WebpConstants.Vp8FrameHeaderSize];
Span<byte> vp8FrameHeader = stackalloc byte[WebpConstants.Vp8FrameHeaderSize];
// Paragraph 9.1.
uint bits = 0 // keyframe (1b)

Loading…
Cancel
Save