Browse Source

Small fixes

pull/2120/head
Dmitry Pentin 4 years ago
parent
commit
0c766a64c4
  1. 4
      src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanScanEncoder.cs
  2. 2
      src/ImageSharp/Formats/Jpeg/Components/Encoder/JpegComponent.cs
  3. 2
      src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs

4
src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanScanEncoder.cs

@ -138,10 +138,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder
public void EncodeScanBaselineInterleaved<TPixel>(JpegFrame frame, SpectralConverter<TPixel> converter, CancellationToken cancellationToken)
where TPixel : unmanaged, IPixel<TPixel>
{
// DEBUG INITIALIZATION SETUP
frame.AllocateComponents(fullScan: false);
// DEBUG ENCODING SETUP
int mcu = 0;
int mcusPerColumn = frame.McusPerColumn;
int mcusPerLine = frame.McusPerLine;

2
src/ImageSharp/Formats/Jpeg/Components/Encoder/JpegComponent.cs

@ -107,7 +107,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder
int spectralAllocWidth = this.SizeInBlocks.Width;
int spectralAllocHeight = fullScan ? this.SizeInBlocks.Height : this.VerticalSamplingFactor;
this.SpectralBlocks = this.memoryAllocator.Allocate2D<Block8x8>(spectralAllocWidth, spectralAllocHeight, AllocationOptions.Clean);
this.SpectralBlocks = this.memoryAllocator.Allocate2D<Block8x8>(spectralAllocWidth, spectralAllocHeight);
}
}
}

2
src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs

@ -126,6 +126,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
var spectralConverter = new SpectralConverter<TPixel>(frame, image, this.QuantizationTables, Configuration.Default);
// TODO: change this for non-interleaved scans
frame.AllocateComponents(fullScan: false);
if (frame.ComponentCount > 1)
{
this.scanEncoder.EncodeScanBaselineInterleaved(frame, spectralConverter, cancellationToken);

Loading…
Cancel
Save