FastLED 3.9.15
Loading...
Searching...
No Matches

◆ test_avg_round_u8_16()

bool autoresearch::simd_check::test_avg_round_u8_16 ( )
inline

Definition at line 271 of file AutoResearchSimd.h.

271 {
272 uint8_t a[16] = {101,201,51,1, 255,0,3,253, 101,201,51,1, 255,0,3,253};
273 uint8_t b[16] = {200,100,150,0, 254,1,2,252, 200,100,150,0, 254,1,2,252};
274 uint8_t output[16] = {0};
275 store_u8_16(output, avg_round_u8_16(load_u8_16(a), load_u8_16(b)));
276 for (int i = 0; i < 16; i++) {
277 int expected = (a[i] + b[i] + 1) / 2;
278 int diff = (int)output[i] - expected;
279 if (diff < -1 || diff > 1) return false;
280 }
281 return true;
282}

Referenced by getTests().

+ Here is the caller graph for this function: