FastLED 3.10.9
Loading...
Searching...
No Matches

◆ test_avg_round_u8_16()

bool autoresearch::simd_check::test_avg_round_u8_16 ( )
inline

Definition at line 272 of file AutoResearchSimd.h.

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

Referenced by getTests().

+ Here is the caller graph for this function: