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

◆ test_scale_u8_16_full()

bool autoresearch::simd_check::test_scale_u8_16_full ( )
inline

Definition at line 195 of file AutoResearchSimd.h.

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

Referenced by getTests().

+ Here is the caller graph for this function: