In the ECC build each line payload is split into Basic Blocks of 224 information bytes and a last
block with the remainder. ECC_BLOCK tells the core where the last block starts. Compute it
from the sensor mode:
PL = ceil16(Line Length x Pixel Bit / 8) payload length in bytes, rounded up to 16
n = floor(PL / 224)
r = PL mod 224
r != 0 : ECC_BLOCK = (r << 16) | n n Basic Blocks, then a last block of r bytes
r == 0 : ECC_BLOCK = (224 << 16) | (n - 1) the last Basic Block is the last block
Example: 5328 pixels at RAW12 is 7,992 bytes, rounded up to PL = 8,000. Then n = 35 and r = 160,
so ECC_BLOCK = 0x00A00023. When the sensor reports the line length in the packet header,
the core derives the same layout itself; keep ECC_BLOCK programmed for the line length the
sensor sends.
| Mode | Line Length | Pixel Bit | PL (bytes) | n | Last block | ECC_BLOCK |
|---|---|---|---|---|---|---|
| IMX530 full width | 5328 | RAW12 | 8000 | 35 | 160 B | 0x00A00023 |
| IMX547 full width | 2472 | RAW12 | 3712 | 16 | 128 B | 0x00800010 |
| 4K UHD | 3840 | RAW8 | 3840 | 17 | 32 B | 0x00200011 |
| Full HD | 1920 | RAW10 | 2400 | 10 | 160 B | 0x00A0000A |
| Exact blocks | 1792 | RAW8 | 1792 | 8 | 224 B (last Basic Block) | 0x00E00007 |