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

◆ test_avg_u8_16()

bool autoresearch::simd_check::test_avg_u8_16 ( )
inline

Definition at line 259 of file AutoResearchSimd.h.

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

Referenced by getTests().

+ Here is the caller graph for this function: