mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1000 B
36 lines
1000 B
// Copyright (c) Six Labors.
|
|
// Licensed under the Six Labors Split License.
|
|
|
|
using SixLabors.ImageSharp.Formats.Jpeg.Components;
|
|
using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;
|
|
|
|
[Trait("Format", "Jpg")]
|
|
public partial class ReferenceImplementationsTests
|
|
{
|
|
public class AccurateDCT : JpegFixture
|
|
{
|
|
public AccurateDCT(ITestOutputHelper output)
|
|
: base(output)
|
|
{
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData(42)]
|
|
[InlineData(1)]
|
|
[InlineData(2)]
|
|
public void ForwardThenInverse(int seed)
|
|
{
|
|
float[] data = Create8x8RandomFloatData(-1000, 1000, seed);
|
|
|
|
Block8x8F b0 = Block8x8F.Load(data);
|
|
|
|
Block8x8F b1 = ReferenceImplementations.AccurateDCT.TransformFDCT(ref b0);
|
|
Block8x8F b2 = ReferenceImplementations.AccurateDCT.TransformIDCT(ref b1);
|
|
|
|
this.CompareBlocks(b0, b2, 1e-4f);
|
|
}
|
|
}
|
|
}
|
|
|