File tree Expand file tree Collapse file tree 5 files changed +20
-12
lines changed
tests/ImageSharp.Tests/Formats Expand file tree Collapse file tree 5 files changed +20
-12
lines changed Original file line number Diff line number Diff line change 1
1
// Copyright (c) Six Labors.
2
2
// Licensed under the Six Labors Split License.
3
3
4
- using System . Runtime . InteropServices ;
4
+ using System . Runtime . Intrinsics . X86 ;
5
5
using Microsoft . DotNet . RemoteExecutor ;
6
6
using SixLabors . ImageSharp . Formats ;
7
7
using SixLabors . ImageSharp . Formats . Gif ;
@@ -51,10 +51,11 @@ public void GifDecoder_Decode_Resize<TPixel>(TestImageProvider<TPixel> provider)
51
51
52
52
image . DebugSave ( provider , testOutputDetails : details , appendPixelTypeToFileName : false ) ;
53
53
54
- // Floating point differences result in minor pixel differences.
54
+ // Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
55
55
// Output have been manually verified.
56
+ // For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
56
57
image . CompareToReferenceOutput (
57
- ImageComparer . TolerantPercentage ( TestEnvironment . OSArchitecture == Architecture . Arm64 ? 0.0002F : 0.0001F ) ,
58
+ ImageComparer . TolerantPercentage ( Fma . IsSupported ? 0.0001F : 0.0002F ) ,
58
59
provider ,
59
60
testOutputDetails : details ,
60
61
appendPixelTypeToFileName : false ) ;
Original file line number Diff line number Diff line change 1
1
// Copyright (c) Six Labors.
2
2
// Licensed under the Six Labors Split License.
3
3
4
- using System . Runtime . InteropServices ;
4
+ using System . Runtime . Intrinsics . X86 ;
5
5
using Microsoft . DotNet . RemoteExecutor ;
6
6
using SixLabors . ImageSharp . Formats ;
7
7
using SixLabors . ImageSharp . Formats . Png ;
@@ -122,10 +122,11 @@ public void PngDecoder_Decode_Resize<TPixel>(TestImageProvider<TPixel> provider)
122
122
123
123
image . DebugSave ( provider , testOutputDetails : details , appendPixelTypeToFileName : false ) ;
124
124
125
- // Floating point differences result in minor pixel differences.
125
+ // Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
126
126
// Output have been manually verified.
127
+ // For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
127
128
image . CompareToReferenceOutput (
128
- ImageComparer . TolerantPercentage ( TestEnvironment . OSArchitecture == Architecture . Arm64 ? 0.0005F : 0.0003F ) ,
129
+ ImageComparer . TolerantPercentage ( Fma . IsSupported ? 0.0003F : 0.0005F ) ,
129
130
provider ,
130
131
testOutputDetails : details ,
131
132
appendPixelTypeToFileName : false ) ;
Original file line number Diff line number Diff line change 2
2
// Licensed under the Six Labors Split License.
3
3
4
4
using System . Runtime . InteropServices ;
5
+ using System . Runtime . Intrinsics . X86 ;
5
6
using Microsoft . DotNet . RemoteExecutor ;
6
7
using SixLabors . ImageSharp . Formats ;
7
8
using SixLabors . ImageSharp . Formats . Tga ;
@@ -760,10 +761,11 @@ public void TgaDecoder_Decode_Resize<TPixel>(TestImageProvider<TPixel> provider)
760
761
761
762
image . DebugSave ( provider , testOutputDetails : details , appendPixelTypeToFileName : false ) ;
762
763
763
- // Floating point differences result in minor pixel differences.
764
+ // Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
764
765
// Output have been manually verified.
766
+ // For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
765
767
image . CompareToReferenceOutput (
766
- ImageComparer . TolerantPercentage ( TestEnvironment . OSArchitecture == Architecture . Arm64 ? 0.0016F : 0.0001F ) ,
768
+ ImageComparer . TolerantPercentage ( Fma . IsSupported ? 0.0001F : 0.0016F ) ,
767
769
provider ,
768
770
testOutputDetails : details ,
769
771
appendPixelTypeToFileName : false ) ;
Original file line number Diff line number Diff line change 3
3
4
4
// ReSharper disable InconsistentNaming
5
5
using System . Runtime . InteropServices ;
6
+ using System . Runtime . Intrinsics . X86 ;
6
7
using SixLabors . ImageSharp . Formats ;
7
8
using SixLabors . ImageSharp . Formats . Tiff ;
8
9
using SixLabors . ImageSharp . Metadata ;
@@ -695,10 +696,11 @@ public void TiffDecoder_Decode_Resize<TPixel>(TestImageProvider<TPixel> provider
695
696
696
697
image . DebugSave ( provider , testOutputDetails : details , appendPixelTypeToFileName : false ) ;
697
698
698
- // Floating point differences result in minor pixel differences.
699
+ // Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
699
700
// Output have been manually verified.
701
+ // For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
700
702
image . CompareToReferenceOutput (
701
- TestEnvironment . OSArchitecture == Architecture . Arm64 ? ImageComparer . TolerantPercentage ( 0.0006F ) : ImageComparer . Exact ,
703
+ Fma . IsSupported ? ImageComparer . Exact : ImageComparer . TolerantPercentage ( 0.0006F ) ,
702
704
provider ,
703
705
testOutputDetails : details ,
704
706
appendPixelTypeToFileName : false ) ;
Original file line number Diff line number Diff line change 2
2
// Licensed under the Six Labors Split License.
3
3
4
4
using System . Runtime . InteropServices ;
5
+ using System . Runtime . Intrinsics . X86 ;
5
6
using SixLabors . ImageSharp . Formats ;
6
7
using SixLabors . ImageSharp . Formats . Webp ;
7
8
using SixLabors . ImageSharp . PixelFormats ;
@@ -367,10 +368,11 @@ public void WebpDecoder_Decode_Resize<TPixel>(TestImageProvider<TPixel> provider
367
368
368
369
image . DebugSave ( provider , testOutputDetails : details , appendPixelTypeToFileName : false ) ;
369
370
370
- // Floating point differences result in minor pixel differences.
371
+ // Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
371
372
// Output have been manually verified.
373
+ // For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
372
374
image . CompareToReferenceOutput (
373
- ImageComparer . TolerantPercentage ( TestEnvironment . OSArchitecture == Architecture . Arm64 ? 0.0156F : 0.0007F ) ,
375
+ ImageComparer . TolerantPercentage ( Fma . IsSupported ? 0.0007F : 0.0156F ) ,
374
376
provider ,
375
377
testOutputDetails : details ,
376
378
appendPixelTypeToFileName : false ) ;
You can’t perform that action at this time.
0 commit comments