Branchless scale16by8: (i * (1 + scale)) >> 8. Eliminates the if(scale==0) branch from the standard scale16by8. The caller is responsible for skipping the call when scale==0.
| 28 | // Eliminates the if(scale==0) branch from the standard scale16by8. |
| 29 | // The caller is responsible for skipping the call when scale==0. |
| 30 | FL_ALWAYS_INLINE u16 scale16by8_nozero(u16 i, u16 scale_plus_one) { |
| 31 | return static_cast<u16>((static_cast<u32>(i) * scale_plus_one) >> 8); |
| 32 | } |
| 33 | |
| 34 | // Core per-pixel transform, fully inlined. All uniform values are |
| 35 | // precomputed by the caller and passed in to avoid per-pixel branches. |
no outgoing calls
no test coverage detected