FastLED 3.10.6
Loading...
Searching...
No Matches

◆ FL_WAVE8_SPREAD_TO_16

#define FL_WAVE8_SPREAD_TO_16 ( lane_u8_0,
lane_u8_1,
out_16 )
Value:
do { \
const ::fl::u8 _a = (::fl::u8)(lane_u8_0); \
const ::fl::u8 _b = (::fl::u8)(lane_u8_1); \
const ::fl::u16 _even = \
(::fl::u16)((::fl::u16)::fl::detail::kTranspose4_16_LUT[_b & 0x0Fu] | \
((::fl::u16)::fl::detail::kTranspose4_16_LUT[_b >> 4] << 8)); \
const ::fl::u16 _odd = \
(::fl::u16)(((::fl::u16)::fl::detail::kTranspose4_16_LUT[_a & 0x0Fu] | \
((::fl::u16)::fl::detail::kTranspose4_16_LUT[_a >> 4] << 8)) \
<< 1); \
(out_16) |= (::fl::u16)(_even | _odd); \
} while (0)
constexpr u8 kTranspose4_16_LUT[16]
2-lane LUT: Spreads 4 bits into 2-lane interleaved positions (nibble → byte).
Definition wave8.h:26
unsigned char u8
Definition stdint.h:131

Definition at line 45 of file wave8.h.

45#define FL_WAVE8_SPREAD_TO_16(lane_u8_0, lane_u8_1, out_16) \
46 do { \
47 const ::fl::u8 _a = (::fl::u8)(lane_u8_0); \
48 const ::fl::u8 _b = (::fl::u8)(lane_u8_1); \
49 const ::fl::u16 _even = \
50 (::fl::u16)((::fl::u16)::fl::detail::kTranspose4_16_LUT[_b & 0x0Fu] | \
51 ((::fl::u16)::fl::detail::kTranspose4_16_LUT[_b >> 4] << 8)); \
52 const ::fl::u16 _odd = \
53 (::fl::u16)(((::fl::u16)::fl::detail::kTranspose4_16_LUT[_a & 0x0Fu] | \
54 ((::fl::u16)::fl::detail::kTranspose4_16_LUT[_a >> 4] << 8)) \
55 << 1); \
56 (out_16) |= (::fl::u16)(_even | _odd); \
57 } while (0)

Referenced by fl::detail::wave8_transpose_2().