From b7d54b10c825659b3d2cb4ef027c3aba185d82d0 Mon Sep 17 00:00:00 2001 From: Dmitry Pentin Date: Thu, 8 Jul 2021 00:36:01 +0300 Subject: [PATCH] Added comments for future refactoring --- src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs index a52ce3f9c4..54c3d0a5b5 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs @@ -1053,11 +1053,20 @@ namespace SixLabors.ImageSharp.Formats.Jpeg int spectralEnd = this.temp[1]; int successiveApproximation = this.temp[2]; + // This can be injected in SOF marker callback this.scanDecoder.Frame = this.Frame; + + // Huffman tables can be calculated directly in the scan decoder class this.scanDecoder.dcHuffmanTables = this.dcHuffmanTables; this.scanDecoder.acHuffmanTables = this.acHuffmanTables; + + // This can be injectd in DRI marker callback this.scanDecoder.ResetInterval = this.resetInterval; + + // This can be passed as ParseEntropyCodedData() parameter as it is used only there this.scanDecoder.componentsLength = selectorsCount; + + // This is okay to inject here, might be good to wrap it in a separate struct but not really necessary this.scanDecoder.spectralStart = spectralStart; this.scanDecoder.spectralEnd = spectralEnd; this.scanDecoder.successiveHigh = successiveApproximation >> 4;