|
|
|
@ -4,7 +4,6 @@ |
|
|
|
using System; |
|
|
|
using System.Buffers; |
|
|
|
using System.Linq; |
|
|
|
using System.Numerics; |
|
|
|
using System.Threading; |
|
|
|
using SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters; |
|
|
|
using SixLabors.ImageSharp.Memory; |
|
|
|
@ -23,7 +22,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder |
|
|
|
|
|
|
|
private JpegColorConverter colorConverter; |
|
|
|
|
|
|
|
// private IMemoryOwner<Vector4> rgbaBuffer;
|
|
|
|
private IMemoryOwner<byte> rgbBuffer; |
|
|
|
|
|
|
|
private IMemoryOwner<TPixel> paddedProxyPixelRow; |
|
|
|
@ -121,11 +119,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder |
|
|
|
{ |
|
|
|
int maxY = Math.Min(this.pixelBuffer.Height, this.pixelRowCounter + this.pixelRowsPerStep); |
|
|
|
|
|
|
|
var buffers = new Buffer2D<float>[this.componentProcessors.Length]; |
|
|
|
for (int i = 0; i < this.componentProcessors.Length; i++) |
|
|
|
{ |
|
|
|
this.componentProcessors[i].CopyBlocksToColorBuffer(spectralStep); |
|
|
|
buffers[i] = this.componentProcessors[i].ColorBuffer; |
|
|
|
} |
|
|
|
|
|
|
|
int width = this.pixelBuffer.Width; |
|
|
|
@ -134,7 +130,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder |
|
|
|
{ |
|
|
|
int y = yy - this.pixelRowCounter; |
|
|
|
|
|
|
|
var values = new JpegColorConverter.ComponentValues(buffers, y); |
|
|
|
var values = new JpegColorConverter.ComponentValues(this.componentProcessors, y); |
|
|
|
|
|
|
|
this.colorConverter.ConvertToRgbInplace(values); |
|
|
|
values = values.Slice(0, width); // slice away Jpeg padding
|
|
|
|
|