Browse Source

Injected progressive scan parameters

pull/1694/head
Dmitry Pentin 5 years ago
parent
commit
2f8d3c933b
  1. 16
      src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanScanDecoder.cs
  2. 12
      src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

16
src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanScanDecoder.cs

@ -29,16 +29,16 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
private readonly int componentsLength;
// The spectral selection start.
private readonly int spectralStart;
public int spectralStart;
// The spectral selection end.
private readonly int spectralEnd;
public int spectralEnd;
// The successive approximation high bit end.
private readonly int successiveHigh;
public int successiveHigh;
// The successive approximation low bit end.
private readonly int successiveLow;
public int successiveLow;
// How many mcu's are left to do.
private int todo;
@ -74,10 +74,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
HuffmanTable[] acHuffmanTables,
int componentsLength,
int restartInterval,
int spectralStart,
int spectralEnd,
int successiveHigh,
int successiveLow,
CancellationToken cancellationToken)
{
this.dctZigZag = ZigZag.CreateUnzigTable();
@ -90,10 +86,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
this.componentsLength = componentsLength;
this.restartInterval = restartInterval;
this.todo = restartInterval;
this.spectralStart = spectralStart;
this.spectralEnd = spectralEnd;
this.successiveHigh = successiveHigh;
this.successiveLow = successiveLow;
this.cancellationToken = cancellationToken;
}

12
src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs

@ -1056,11 +1056,13 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
this.acHuffmanTables,
selectorsCount,
this.resetInterval,
spectralStart,
spectralEnd,
successiveApproximation >> 4,
successiveApproximation & 15,
cancellationToken);
cancellationToken)
{
spectralStart = spectralStart,
spectralEnd = spectralEnd,
successiveHigh = successiveApproximation >> 4,
successiveLow = successiveApproximation & 15
};
sd.ParseEntropyCodedData();
}

Loading…
Cancel
Save