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

◆ test_scale_u8_16_full()

bool autoresearch::simd_check::test_scale_u8_16_full ( )
inline

Definition at line 196 of file AutoResearchSimd.h.

196 {
197 // scale by 255 should give approximately the original value
198 uint8_t a[16] = {255,128,64,32, 10,200,100,50, 255,128,64,32, 10,200,100,50};
199 uint8_t output[16] = {0};
200 store_u8_16(output, scale_u8_16(load_u8_16(a), 255));
201 for (int i = 0; i < 16; i++) {
202 int expected = (a[i] * 255) / 256;
203 int diff = (int)output[i] - expected;
204 if (diff < -1 || diff > 1) return false;
205 }
206 return true;
207}

Referenced by getTests().

+ Here is the caller graph for this function: