19 constexpr auto lut(Generator&& f){
20 using content_type =
decltype(f(std::size_t{0}));
21 std::array<content_type, Length> arr;
22 using namespace std::ranges;
23 auto rangy = views::iota(std::size_t{0}, Length)
24 | views::transform(std::forward<Generator>(f));
25 copy(rangy, arr.begin());
54 constexpr encode(uint32_t decoded, uint32_t &encoded) {
58 uint32_t
S1 = (
one_bit(b[0] | b[1] | b[2] | b[3]) << 1) |
one_bit(b[4] | b[5] | b[6] | b[7]);
69 auto writeTwo = [&](uint32_t src) {
71 encoded |= (0b0) << (28 - pos);
74 encoded |= (src & 0x3) << (28 - pos);
79 S1, S2t, S3tl, S3tr, b[0], b[1],b[2], b[3],
80 S2b, S3bl, S3br,b[4], b[5], b[6], b[7]
81 })
if(val) writeTwo(val);