From 5cca3148dfea629aa9cb7aff8e8b1325b0f060f2 Mon Sep 17 00:00:00 2001 From: Dmitry Pentin Date: Tue, 22 Mar 2022 22:07:43 +0300 Subject: [PATCH] Added playground benchmarks --- .../SpectralConversion/JpegComponentPostProcessor8.cs | 6 ++++-- .../SpectralConversion/ResizingSpectralConverter{TPixel}.cs | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/JpegComponentPostProcessor8.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/JpegComponentPostProcessor8.cs index 1153dca985..cb082f6ccb 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/JpegComponentPostProcessor8.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/JpegComponentPostProcessor8.cs @@ -43,10 +43,12 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder this.frame = frame; - this.dcDequantizer = this.rawJpeg.QuantizationTables[this.component.QuantizationTableIndex][0]; - this.component = component; + this.rawJpeg = rawJpeg; + + this.dcDequantizer = rawJpeg.QuantizationTables[this.component.QuantizationTableIndex][0]; + this.blockAreaSize = this.component.SubSamplingDivisors * blockSize; this.ColorBuffer = memoryAllocator.Allocate2DOveraligned( postProcessorBufferSize.Width, diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/ResizingSpectralConverter{TPixel}.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/ResizingSpectralConverter{TPixel}.cs index 5089449ef1..ed191bc063 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/ResizingSpectralConverter{TPixel}.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/ResizingSpectralConverter{TPixel}.cs @@ -195,6 +195,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder cpp.Dispose(); } } + + this.rgbBuffer?.Dispose(); + this.paddedProxyPixelRow?.Dispose(); } // TODO: docs, code formatting