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

◆ test_u8_pipeline_scale_add_clamp()

bool autoresearch::simd_check::test_u8_pipeline_scale_add_clamp ( )
inline

Definition at line 1065 of file AutoResearchSimd.h.

1065 {
1066 // Simulate a brightness pipeline: scale by 128 then add bias, verify saturation
1067 uint8_t input[16] = {200,200,200,200, 200,200,200,200, 200,200,200,200, 200,200,200,200};
1068 uint8_t bias[16] = {200,200,200,200, 200,200,200,200, 200,200,200,200, 200,200,200,200};
1069 uint8_t output[16] = {0};
1070 simd_u8x16 v = load_u8_16(input);
1071 v = scale_u8_16(v, 128); // ~100
1072 v = add_sat_u8_16(v, load_u8_16(bias)); // ~300 -> saturated to 255
1073 store_u8_16(output, v);
1074 for (int i = 0; i < 16; i++) {
1075 if (output[i] < 250) return false; // Should be 255 (saturated)
1076 }
1077 return true;
1078}
platforms::simd_u8x16 simd_u8x16
Definition types.h:24

Referenced by getTests().

+ Here is the caller graph for this function: