|
|
@ -10,10 +10,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.WebP |
|
|
[Trait("Format", "Webp")] |
|
|
[Trait("Format", "Webp")] |
|
|
public class LosslessUtilsTests |
|
|
public class LosslessUtilsTests |
|
|
{ |
|
|
{ |
|
|
[Fact] |
|
|
private static void RunSubstractGreenTest() |
|
|
public void SubtractGreen_Works() |
|
|
|
|
|
{ |
|
|
|
|
|
static void RunTest() |
|
|
|
|
|
{ |
|
|
{ |
|
|
uint[] pixelData = |
|
|
uint[] pixelData = |
|
|
{ |
|
|
{ |
|
|
@ -42,16 +39,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.WebP |
|
|
Assert.Equal(expectedOutput, pixelData); |
|
|
Assert.Equal(expectedOutput, pixelData); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunTest, HwIntrinsics.AllowAll); |
|
|
private static void RunAddGreenToBlueAndRedTest() |
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunTest, HwIntrinsics.DisableAVX); |
|
|
|
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunTest, HwIntrinsics.DisableAVX | HwIntrinsics.DisableSSE2); |
|
|
|
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunTest, HwIntrinsics.DisableAVX | HwIntrinsics.DisableSSE2 | HwIntrinsics.DisableSSSE3); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void AddGreenToBlueAndRed_Works() |
|
|
|
|
|
{ |
|
|
|
|
|
static void RunTest() |
|
|
|
|
|
{ |
|
|
{ |
|
|
uint[] pixelData = |
|
|
uint[] pixelData = |
|
|
{ |
|
|
{ |
|
|
@ -80,10 +68,54 @@ namespace SixLabors.ImageSharp.Tests.Formats.WebP |
|
|
Assert.Equal(expectedOutput, pixelData); |
|
|
Assert.Equal(expectedOutput, pixelData); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunTest, HwIntrinsics.AllowAll); |
|
|
[Fact] |
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunTest, HwIntrinsics.DisableAVX); |
|
|
public void SubtractGreen_Works() |
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunTest, HwIntrinsics.DisableAVX | HwIntrinsics.DisableSSE2); |
|
|
{ |
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunTest, HwIntrinsics.DisableAVX | HwIntrinsics.DisableSSE2 | HwIntrinsics.DisableSSSE3); |
|
|
RunSubstractGreenTest(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void AddGreenToBlueAndRed_Works() |
|
|
|
|
|
{ |
|
|
|
|
|
RunAddGreenToBlueAndRedTest(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if SUPPORTS_RUNTIME_INTRINSICS
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void SubtractGreen_WithHardwareIntrinsics_Works() |
|
|
|
|
|
{ |
|
|
|
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunSubstractGreenTest, HwIntrinsics.AllowAll); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void SubtractGreen_WithoutAvx_Works() |
|
|
|
|
|
{ |
|
|
|
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunSubstractGreenTest, HwIntrinsics.DisableAVX); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void SubtractGreen_WithoutAvxOrSSSE3_Works() |
|
|
|
|
|
{ |
|
|
|
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunSubstractGreenTest, HwIntrinsics.DisableAVX | HwIntrinsics.DisableSSSE3); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void AddGreenToBlueAndRed_WithHardwareIntrinsics_Works() |
|
|
|
|
|
{ |
|
|
|
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunAddGreenToBlueAndRedTest, HwIntrinsics.AllowAll); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void AddGreenToBlueAndRed_WithoutAvx_Works() |
|
|
|
|
|
{ |
|
|
|
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunAddGreenToBlueAndRedTest, HwIntrinsics.DisableAVX); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public void AddGreenToBlueAndRed_WithoutAvxOrSSSE3_Works() |
|
|
|
|
|
{ |
|
|
|
|
|
FeatureTestRunner.RunWithHwIntrinsicsFeature(RunAddGreenToBlueAndRedTest, HwIntrinsics.DisableAVX | HwIntrinsics.DisableSSE2 | HwIntrinsics.DisableSSSE3); |
|
|
} |
|
|
} |
|
|
|
|
|
#endif
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|