diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs index ae7e81254b..9576cbd3c8 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs @@ -220,7 +220,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg // Reference implementation quantizes given block via division Block8x8 expected = default; - ReferenceImplementations.Quantize(ref source, ref expected, ref quant, ZigZag.ZigZagOrder); + ReferenceImplementations.Quantize(ref source, ref expected, ref quant, ZigZag.TransposingOrder); // Actual current implementation quantizes given block via multiplication // With quantization table reciprocal diff --git a/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs index 36570ce55a..9c467a1cc9 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs @@ -135,10 +135,9 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg FastFloatingPointDCT.AdjustToIDCT(ref dequantMatrix); srcBlock.MultiplyInPlace(ref dequantMatrix); + // testee // IDCT implementation tranforms blocks after transposition srcBlock.TransposeInplace(); - - // IDCT calculation FastFloatingPointDCT.TransformIDCT(ref srcBlock); float[] actualDest = srcBlock.ToArray(); @@ -180,7 +179,10 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg ReferenceImplementations.LLM_FloatingPoint_DCT.FDCT2D_llm(src, expectedDest, temp1, downscaleBy8: true); // testee + // Second transpose call is done by Quantize step + // Do this manually here just to be complient to the reference implementation FastFloatingPointDCT.TransformFDCT(ref block); + block.TransposeInplace(); // Part of the IDCT calculations is fused into the quantization step // We must multiply input block with adjusted no-quantization matrix