File tree Expand file tree Collapse file tree
tests/ImageSharp.Tests/Formats Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Copyright (c) Six Labors.
22// Licensed under the Six Labors Split License.
33
4- using System . Runtime . InteropServices ;
4+ using System . Runtime . Intrinsics . X86 ;
55using Microsoft . DotNet . RemoteExecutor ;
66using SixLabors . ImageSharp . Formats ;
77using SixLabors . ImageSharp . Formats . Gif ;
@@ -51,10 +51,11 @@ public void GifDecoder_Decode_Resize<TPixel>(TestImageProvider<TPixel> provider)
5151
5252 image . DebugSave ( provider , testOutputDetails : details , appendPixelTypeToFileName : false ) ;
5353
54- // Floating point differences result in minor pixel differences.
54+ // Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
5555 // Output have been manually verified.
56+ // For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
5657 image . CompareToReferenceOutput (
57- ImageComparer . TolerantPercentage ( TestEnvironment . OSArchitecture == Architecture . Arm64 ? 0.0002F : 0.0001F ) ,
58+ ImageComparer . TolerantPercentage ( Fma . IsSupported ? 0.0001F : 0.0002F ) ,
5859 provider ,
5960 testOutputDetails : details ,
6061 appendPixelTypeToFileName : false ) ;
Original file line number Diff line number Diff line change 11// Copyright (c) Six Labors.
22// Licensed under the Six Labors Split License.
33
4- using System . Runtime . InteropServices ;
4+ using System . Runtime . Intrinsics . X86 ;
55using Microsoft . DotNet . RemoteExecutor ;
66using SixLabors . ImageSharp . Formats ;
77using SixLabors . ImageSharp . Formats . Png ;
@@ -122,10 +122,11 @@ public void PngDecoder_Decode_Resize<TPixel>(TestImageProvider<TPixel> provider)
122122
123123 image . DebugSave ( provider , testOutputDetails : details , appendPixelTypeToFileName : false ) ;
124124
125- // Floating point differences result in minor pixel differences.
125+ // Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
126126 // Output have been manually verified.
127+ // For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
127128 image . CompareToReferenceOutput (
128- ImageComparer . TolerantPercentage ( TestEnvironment . OSArchitecture == Architecture . Arm64 ? 0.0005F : 0.0003F ) ,
129+ ImageComparer . TolerantPercentage ( Fma . IsSupported ? 0.0003F : 0.0005F ) ,
129130 provider ,
130131 testOutputDetails : details ,
131132 appendPixelTypeToFileName : false ) ;
Original file line number Diff line number Diff line change 22// Licensed under the Six Labors Split License.
33
44using System . Runtime . InteropServices ;
5+ using System . Runtime . Intrinsics . X86 ;
56using Microsoft . DotNet . RemoteExecutor ;
67using SixLabors . ImageSharp . Formats ;
78using SixLabors . ImageSharp . Formats . Tga ;
@@ -760,10 +761,11 @@ public void TgaDecoder_Decode_Resize<TPixel>(TestImageProvider<TPixel> provider)
760761
761762 image . DebugSave ( provider , testOutputDetails : details , appendPixelTypeToFileName : false ) ;
762763
763- // Floating point differences result in minor pixel differences.
764+ // Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
764765 // Output have been manually verified.
766+ // For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
765767 image . CompareToReferenceOutput (
766- ImageComparer . TolerantPercentage ( TestEnvironment . OSArchitecture == Architecture . Arm64 ? 0.0016F : 0.0001F ) ,
768+ ImageComparer . TolerantPercentage ( Fma . IsSupported ? 0.0001F : 0.0016F ) ,
767769 provider ,
768770 testOutputDetails : details ,
769771 appendPixelTypeToFileName : false ) ;
Original file line number Diff line number Diff line change 33
44// ReSharper disable InconsistentNaming
55using System . Runtime . InteropServices ;
6+ using System . Runtime . Intrinsics . X86 ;
67using SixLabors . ImageSharp . Formats ;
78using SixLabors . ImageSharp . Formats . Tiff ;
89using SixLabors . ImageSharp . Metadata ;
@@ -695,10 +696,11 @@ public void TiffDecoder_Decode_Resize<TPixel>(TestImageProvider<TPixel> provider
695696
696697 image . DebugSave ( provider , testOutputDetails : details , appendPixelTypeToFileName : false ) ;
697698
698- // Floating point differences result in minor pixel differences.
699+ // Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
699700 // Output have been manually verified.
701+ // For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
700702 image . CompareToReferenceOutput (
701- TestEnvironment . OSArchitecture == Architecture . Arm64 ? ImageComparer . TolerantPercentage ( 0.0006F ) : ImageComparer . Exact ,
703+ Fma . IsSupported ? ImageComparer . Exact : ImageComparer . TolerantPercentage ( 0.0006F ) ,
702704 provider ,
703705 testOutputDetails : details ,
704706 appendPixelTypeToFileName : false ) ;
Original file line number Diff line number Diff line change 22// Licensed under the Six Labors Split License.
33
44using System . Runtime . InteropServices ;
5+ using System . Runtime . Intrinsics . X86 ;
56using SixLabors . ImageSharp . Formats ;
67using SixLabors . ImageSharp . Formats . Webp ;
78using SixLabors . ImageSharp . PixelFormats ;
@@ -367,10 +368,11 @@ public void WebpDecoder_Decode_Resize<TPixel>(TestImageProvider<TPixel> provider
367368
368369 image . DebugSave ( provider , testOutputDetails : details , appendPixelTypeToFileName : false ) ;
369370
370- // Floating point differences result in minor pixel differences.
371+ // Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
371372 // Output have been manually verified.
373+ // For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
372374 image . CompareToReferenceOutput (
373- ImageComparer . TolerantPercentage ( TestEnvironment . OSArchitecture == Architecture . Arm64 ? 0.0156F : 0.0007F ) ,
375+ ImageComparer . TolerantPercentage ( Fma . IsSupported ? 0.0007F : 0.0156F ) ,
374376 provider ,
375377 testOutputDetails : details ,
376378 appendPixelTypeToFileName : false ) ;
You can’t perform that action at this time.
0 commit comments