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

◆ test_avg_u8_16()

bool autoresearch::simd_check::test_avg_u8_16 ( )
inline

Definition at line 258 of file AutoResearchSimd.h.

258 {
259 uint8_t a[16] = {100,200,50,0, 255,0,1,254, 100,200,50,0, 255,0,1,254};
260 uint8_t b[16] = {200,100,150,0, 255,0,1,254, 200,100,150,0, 255,0,1,254};
261 uint8_t output[16] = {0};
262 store_u8_16(output, avg_u8_16(load_u8_16(a), load_u8_16(b)));
263 for (int i = 0; i < 16; i++) {
264 int expected = (a[i] + b[i]) / 2;
265 int diff = (int)output[i] - expected;
266 if (diff < -1 || diff > 1) return false;
267 }
268 return true;
269}

Referenced by getTests().

+ Here is the caller graph for this function: