diff --git a/src/ImageSharp/Formats/Jpeg/Components/Encoder/YCbCrForwardConverter420{TPixel}.cs b/src/ImageSharp/Formats/Jpeg/Components/Encoder/YCbCrForwardConverter420{TPixel}.cs index 987ca64632..a4abd532b3 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Encoder/YCbCrForwardConverter420{TPixel}.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Encoder/YCbCrForwardConverter420{TPixel}.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. using System; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; @@ -66,13 +65,16 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder /// private Span rgbSpan; - // TODO: docs + /// + /// Sampled pixel buffer size + /// private Size samplingAreaSize; - // TODO: docs + /// + /// for internal operations + /// private Configuration config; - public YCbCrForwardConverter420(ImageFrame frame) { // matrices would be filled during convert calls diff --git a/src/ImageSharp/Formats/Jpeg/Components/Encoder/YCbCrForwardConverter444{TPixel}.cs b/src/ImageSharp/Formats/Jpeg/Components/Encoder/YCbCrForwardConverter444{TPixel}.cs index 1ef8246ffc..ef589272bd 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Encoder/YCbCrForwardConverter444{TPixel}.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Encoder/YCbCrForwardConverter444{TPixel}.cs @@ -15,16 +15,21 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder internal ref struct YCbCrForwardConverter444 where TPixel : unmanaged, IPixel { - // TODO: docs + /// + /// Number of pixels processed per single call + /// private const int PixelsPerSample = 8 * 8; - // TODO: docs + /// + /// Total byte size of processed pixels converted from TPixel to + /// private const int RgbSpanByteSize = PixelsPerSample * 3; - // TODO: docs + /// + /// of sampling area from given frame pixel buffer + /// private static readonly Size SampleSize = new Size(8, 8); - /// /// The Y component /// @@ -55,11 +60,15 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder /// private Span rgbSpan; - // TODO: docs + /// + /// Sampled pixel buffer size + /// private Size samplingAreaSize; - // TODO: docs - private readonly Configuration config; + /// + /// for internal operations + /// + private Configuration config; public YCbCrForwardConverter444(ImageFrame frame) { diff --git a/src/ImageSharp/Formats/Jpeg/Components/FastFloatingPointDCT.cs b/src/ImageSharp/Formats/Jpeg/Components/FastFloatingPointDCT.cs index ad2e290f6f..f31d07efca 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/FastFloatingPointDCT.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/FastFloatingPointDCT.cs @@ -273,7 +273,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components /// /// Apply floating point FDCT from src into dest /// - /// /// Source /// Destination /// Temporary block provided by the caller for optimization @@ -467,7 +466,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components Vector256 mb1 = Avx.Add(SimdUtils.HwIntrinsics.MultiplyAdd(mz1, my3, C_V_3_0727), mz2); Vector256 mb0 = Avx.Add(SimdUtils.HwIntrinsics.MultiplyAdd(mz0, my1, C_V_1_5013), mz3); - Vector256 my2 = s.V2; Vector256 my6 = s.V6; mz4 = Avx.Multiply(Avx.Add(my2, my6), C_V_0_5411); diff --git a/src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs b/src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs index c68c0ffb03..6020e6196c 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs @@ -5,14 +5,11 @@ using System; using System.Buffers.Binary; using System.IO; using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using System.Threading; using SixLabors.ImageSharp.Common.Helpers; using SixLabors.ImageSharp.Formats.Jpeg.Components; using SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder; using SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder; -using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.Metadata; using SixLabors.ImageSharp.Metadata.Profiles.Exif; using SixLabors.ImageSharp.Metadata.Profiles.Icc; @@ -69,7 +66,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg 99, 99, 99, 99, 99, 99, 99, 99, }; - /// /// A scratch buffer to reduce allocations. /// @@ -625,7 +621,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg private void WriteStartOfScan(Image image, int componentCount, CancellationToken cancellationToken) where TPixel : unmanaged, IPixel { - // TODO: Need a JpegScanEncoder class or struct that encapsulates the scan-encoding implementation. (Similar to JpegScanDecoder.) Span componentId = stackalloc byte[] { 0x01, diff --git a/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs index fd5e5b0052..606a5678b2 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs @@ -63,7 +63,6 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg this.CompareBlocks(expected, actual, 1f); } - // Inverse transform [Theory] [InlineData(1)] @@ -182,7 +181,6 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg Assert.Equal(actualDest, expectedDest, new ApproximateFloatComparer(1f)); } - // Forward transform [Theory] [InlineData(1)]