Skip to main content

Module clcl

Module clcl 

Source
Expand description

CLCL decoder — Cb/Cr per-pixel nibble chroma in separate planes.

§Payload layout (planar)

[Y0, Y1, ..., Y(N-1), Cb0_Cb1, ..., Cb_{N-2}_Cb_{N-1}, Cr0_Cr1, ..., Cr_{N-2}_Cr_{N-1}]
  • Y — 1 byte per pixel (full 8-bit luma).
  • Cb — 1 nibble per pixel, packed 2 nibbles per byte (N/2 bytes total). Byte packing: byte[k] = (Cb_{2k+1} << 4) | Cb_{2k} (odd pixel in high nibble).
  • Cr — Same packing scheme as Cb (N/2 bytes).
  • Each nibble is upscaled to 8-bit by << 4.

In total: N (Y) + N/2 (Cb) + N/2 (Cr) = 2N bytes.

Example for 4 pixels:

Byte 0: Y0
Byte 1: Y1
Byte 2: Y2
Byte 3: Y3
Byte 4: (Cb1 << 4) | Cb0   // Cb nibbles for pixels 0,1
Byte 5: (Cb3 << 4) | Cb2   // Cb nibbles for pixels 2,3
Byte 6: (Cr1 << 4) | Cr0   // Cr nibbles for pixels 0,1
Byte 7: (Cr3 << 4) | Cr2   // Cr nibbles for pixels 2,3

Output is BGRA 8-bit per channel (via BT.601 YUV→RGB conversion).

Functions§

decode
Decode a CLCL (separate Cb/Cr nibble-plane) frame to BGRA8 output.