File tree Expand file tree Collapse file tree
tests/ImageSharp.Tests/Formats/WebP Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,6 +132,30 @@ private static void RunTransformColorInverseTest()
132132 Assert . Equal ( expectedOutput , pixelData ) ;
133133 }
134134
135+ private static void RunPredictor11Test ( )
136+ {
137+ // arrange
138+ uint [ ] topData = { 4278258949 , 4278258949 } ;
139+ uint left = 4294839812 ;
140+ short [ ] scratch = new short [ 8 ] ;
141+ uint expectedResult = 4294839812 ;
142+
143+ // act
144+ unsafe
145+ {
146+ fixed ( uint * top = & topData [ 1 ] )
147+ {
148+ uint actual = LosslessUtils . Predictor11 ( left , top , scratch ) ;
149+
150+ // assert
151+ Assert . Equal ( expectedResult , actual ) ;
152+ }
153+ }
154+ }
155+
156+ [ Fact ]
157+ public void Predictor11_Works ( ) => RunPredictor11Test ( ) ;
158+
135159 [ Fact ]
136160 public void SubtractGreen_Works ( ) => RunSubtractGreenTest ( ) ;
137161
@@ -145,6 +169,12 @@ private static void RunTransformColorInverseTest()
145169 public void TransformColorInverse_Works ( ) => RunTransformColorInverseTest ( ) ;
146170
147171#if SUPPORTS_RUNTIME_INTRINSICS
172+ [ Fact ]
173+ public void Predictor11_WithHardwareIntrinsics_Works ( ) => FeatureTestRunner . RunWithHwIntrinsicsFeature ( RunPredictor11Test , HwIntrinsics . AllowAll ) ;
174+
175+ [ Fact ]
176+ public void Predictor11_WithoutSSE2_Works ( ) => FeatureTestRunner . RunWithHwIntrinsicsFeature ( RunPredictor11Test , HwIntrinsics . DisableSSE2 ) ;
177+
148178 [ Fact ]
149179 public void SubtractGreen_WithHardwareIntrinsics_Works ( ) => FeatureTestRunner . RunWithHwIntrinsicsFeature ( RunSubtractGreenTest , HwIntrinsics . AllowAll ) ;
150180
You can’t perform that action at this time.
0 commit comments