Browse Source

Test qol fixes

pull/1847/head
Dmitry Pentin 5 years ago
parent
commit
50b0f0b07f
  1. 10
      tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs
  2. 2
      tests/ImageSharp.Tests/Formats/Jpg/Utils/JpegFixture.cs

10
tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs

@ -52,16 +52,15 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
// Part of the IDCT calculations is fused into the quantization step
// We must multiply input block with adjusted no-quantization matrix
// before applying IDCT
// Dequantization using unit matrix - no values are upscaled
Block8x8F dequantMatrix = CreateBlockFromScalar(1);
// Dequantization using unit matrix - no values are upscaled
// as quant matrix is all 1's
// This step is needed to apply adjusting multipliers to the input block
FastFloatingPointDCT.AdjustToIDCT(ref dequantMatrix);
srcBlock.MultiplyInPlace(ref dequantMatrix);
// IDCT implementation tranforms blocks after transposition
srcBlock.TransposeInplace();
srcBlock.MultiplyInPlace(ref dequantMatrix);
// IDCT calculation
FastFloatingPointDCT.TransformIDCT(ref srcBlock);
@ -86,16 +85,15 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
// Part of the IDCT calculations is fused into the quantization step
// We must multiply input block with adjusted no-quantization matrix
// before applying IDCT
// Dequantization using unit matrix - no values are upscaled
Block8x8F dequantMatrix = CreateBlockFromScalar(1);
// Dequantization using unit matrix - no values are upscaled
// as quant matrix is all 1's
// This step is needed to apply adjusting multipliers to the input block
FastFloatingPointDCT.AdjustToIDCT(ref dequantMatrix);
srcBlock.MultiplyInPlace(ref dequantMatrix);
// IDCT implementation tranforms blocks after transposition
srcBlock.TransposeInplace();
srcBlock.MultiplyInPlace(ref dequantMatrix);
// IDCT calculation
FastFloatingPointDCT.TransformIDCT(ref srcBlock);

2
tests/ImageSharp.Tests/Formats/Jpg/Utils/JpegFixture.cs

@ -172,7 +172,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg.Utils
bool failed = false;
for (int i = 0; i < 64; i++)
for (int i = 0; i < Block8x8F.Size; i++)
{
float expected = a[i];
float actual = b[i];

Loading…
Cancel
Save