Browse Source

Fixed comments, removed todo, updated benchmark results

pull/1632/head
Dmitry Pentin 5 years ago
parent
commit
28ea2adb08
  1. 1
      src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanScanEncoder.cs
  2. 7
      tests/ImageSharp.Benchmarks/Codecs/Jpeg/EncodeJpeg.cs

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

@ -125,7 +125,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder
public void Encode420<TPixel>(Image<TPixel> pixels, ref Block8x8F luminanceQuantTable, ref Block8x8F chrominanceQuantTable, CancellationToken cancellationToken)
where TPixel : unmanaged, IPixel<TPixel>
{
// TODO: Need a JpegScanEncoder<TPixel> class or struct that encapsulates the scan-encoding implementation. (Similar to JpegScanDecoder.)
Block8x8F b = default;
Span<Block8x8F> cb = stackalloc Block8x8F[4];
Span<Block8x8F> cr = stackalloc Block8x8F[4];

7
tests/ImageSharp.Benchmarks/Codecs/Jpeg/EncodeJpeg.cs

@ -16,8 +16,7 @@ namespace SixLabors.ImageSharp.Benchmarks.Codecs.Jpeg
private const string TestImage = TestImages.Jpeg.BenchmarkSuite.Jpeg420Exif_MidSizeYCbCr;
private const int EncodingQuality = 100;
// GDI+ uses 4:1:1 subsampling - https://stackoverflow.com/questions/745610/how-to-disable-subsampling-with-net-gdi
// ImageSharp lowest subsampling is 4:2:0 which is an okay approximation
// GDI+ uses 4:2:0 subsampling
private const JpegSubsample EncodingSubsampling = JpegSubsample.Ratio420;
// System.Drawing
@ -103,6 +102,6 @@ Intel Core i7-6700K CPU 4.00GHz (Skylake), 1 CPU, 8 logical and 4 physical cores
| Method | Mean | Error | StdDev | Ratio | RatioSD |
|---------------------- |---------:|---------:|---------:|------:|--------:|
| 'System.Drawing Jpeg' | 39.54 ms | 0.269 ms | 0.225 ms | 1.00 | 0.00 |
| 'ImageSharp Jpeg' | 47.25 ms | 0.937 ms | 1.219 ms | 1.20 | 0.02 |
| 'System.Drawing Jpeg' | 39.67 ms | 0.774 ms | 0.828 ms | 1.00 | 0.00 |
| 'ImageSharp Jpeg' | 45.39 ms | 0.415 ms | 0.346 ms | 1.14 | 0.03 |
*/

Loading…
Cancel
Save