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

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

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

Loading…
Cancel
Save