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

◆ test_u8_pipeline_scale_add_clamp()

bool autoresearch::simd_check::test_u8_pipeline_scale_add_clamp ( )
inline

Definition at line 1064 of file AutoResearchSimd.h.

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

Referenced by getTests().

+ Here is the caller graph for this function: