FastLED 3.10.8
Loading...
Searching...
No Matches

◆ wave8Untranspose_16()

void fl::wave8Untranspose_16 ( const u8(&) transposed[16 *sizeof(Wave8Byte)],
u8(&) output[16 *sizeof(Wave8Byte)] )

Definition at line 471 of file wave8.cpp.hpp.

472 {
473 // Reverse the 16-lane transposition
474 // Input: 128 bytes of interleaved data (16 bytes per symbol, 8 symbols)
475 // Output: 16 Wave8Byte structures (128 bytes total, de-interleaved)
476
477 Wave8Byte lane_waves[16];
478
479 // Process each of the 8 symbols
480 for (int symbol_idx = 0; symbol_idx < 8; symbol_idx++) {
481 u8 lane_bytes[16] = {0};
482
483 // Process 8 pulses (16 bytes total: 2 bytes per pulse)
484 for (int pulse_idx = 0; pulse_idx < 8; pulse_idx++) {
485 int pulse_bit = 7 - pulse_idx;
486
487 // Read 16-bit word for this pulse
488 int input_offset = symbol_idx * 16 + pulse_idx * 2;
489 u16 input_word = (u16)transposed[input_offset] |
490 ((u16)transposed[input_offset + 1] << 8);
491
492 // De-interleave 16 lanes from this word
493 // Bit layout: [L15, L14, L13, ..., L1, L0]
494 for (int lane = 0; lane < 16; lane++) {
495 // Extract bit for this lane (lane 0 = LSB, lane 15 = MSB)
496 u8 pulse = (input_word >> lane) & 1;
497
498 // Reconstruct lane byte
499 lane_bytes[lane] |= (pulse << pulse_bit);
500 }
501 }
502
503 // Store de-interleaved bytes
504 for (int lane = 0; lane < 16; lane++) {
505 lane_waves[lane].symbols[symbol_idx].data = lane_bytes[lane];
506 }
507 }
508
509 // Copy de-interleaved data to output
510 for (int lane = 0; lane < 16; lane++) {
511 fl::isr::memcopy(output + lane * sizeof(Wave8Byte), &lane_waves[lane], sizeof(Wave8Byte));
512 }
513}
unsigned char u8
Definition stdint.h:131
FL_OPTIMIZE_FUNCTION FL_IRAM FASTLED_FORCE_INLINE void memcopy(void *FL_RESTRICT_PARAM dst, const void *FL_RESTRICT_PARAM src, size_t num_bytes)
ISR-optimized memcpy with alignment detection and switch dispatch.
Definition memcpy.h:75
unsigned char u8
Definition stdint.h:131

References FL_NO_EXCEPT, FL_RESTRICT_PARAM, and fl::isr::memcopy().

+ Here is the call graph for this function: