The camera states its pixel format in the image header; software selects the same format in
PIXEL_TYPE. The code is {layout, bit depth on the link}:
| Layout | 8-bit | 10-bit | 12-bit | 14-bit | 16-bit | Components, LSB first | Built by |
|---|---|---|---|---|---|---|---|
| Mono / Bayer / Raw | 0x08 | 0x09 | 0x0A | 0x0B | 0x0C | the sample | VID_EN_MONO |
| RGB | 0x18 | 0x19 | 0x1A | 0x1B | 0x1C | G, B, R | VID_EN_RGB |
| YCbCr 4:4:4 | 0x28 | 0x29 | 0x2A | 0x2B | 0x2C | Y, Cb, Cr | VID_EN_YCBCR444 |
| YCbCr 4:2:2 | 0x38 | 0x39 | 0x3A | 0x3B | 0x3C | Y, C (Cb even pixels, Cr odd) | VID_EN_YCBCR422 |
| YCbCr 4:2:0 | 0x48 | 0x49 | 0x4A | 0x4B | 0x4C | Y, C (C on even lines only) | VID_EN_YCBCR420 |
- Built by switch. Each layout has a switch in the IP GUI and Bit depths on the link picks the depths. Mono / Bayer at every depth is the default. With everything on, one build carries 25 formats.
VIDEO_CAPreports what was built, andPIXEL_TYPE.NOT_BUILTflags a code the bitstream has no path for. - Run-time selection. A write to
PIXEL_TYPErestarts the stream path with the new format. Write it with the acquisition stopped. - Format port. The same code leaves the core on
pixel_type_out, so a packer or ISP behindvideo_outfollows the one register write without a second register or a GPIO. It changes one AXI4-Lite clock after the write and at no other time. - YCbCr 4:2:0. CoaXPress has no packed 4:2:0 format, so the link carries YCbCr 4:2:2. With a 4:2:0 code the core delivers UG934 4:2:0 (chroma on even lines only); with the 4:2:2 code the same stream comes out as 4:2:2. Any 4:2:2 camera can feed a 4:2:0 consumer such as an encoder.
2.5.1Lines and frames
- A line is a multiple of 4 pixels. A YCbCr 4:2:2 line of 4n + 2 pixels is accepted at 4 pixels per beat; its last beat has pixels 2 and 3 zero, as UG934 asks.
- Every line starts in a new link word and the core drops the zero padding of the last word of a line.
- A line that breaks the width rule still ends with
tlast. It is flagged inPIXEL_TYPE.LINE_ERR, counted inPIX_LINE_ERRSand raises PIX_LINE_ERR. - Everything before the first start of frame is discarded, so the first thing out is a whole frame. A start of frame inside a line starts a new frame and is flagged the same way.
- Line and frame size are checked against the image header and counted in
FRAME_XSIZE_ERRSandFRAME_YSIZE_ERRS.
2.5.2Throughput
| Format | 2 pixels per beat | 4 pixels per beat | Mpx/s at CXP-12 |
|---|---|---|---|
| Mono / Bayer 8-bit | 50 % | 100 % | 1220 |
| Mono / Bayer 10-bit | 62 % | 100 % | 976 |
| Mono / Bayer 12-bit | 75 % | 100 % | 813 |
| Mono / Bayer 14-bit | 87 % | 100 % | 697 |
| Mono / Bayer 16-bit | 100 % | 100 % | 610 |
| YCbCr 4:2:2 8 / 10 / 12-bit | 100 % | 100 % | 610 / 488 / 407 |
| RGB or YCbCr 4:4:4 8 / 10 / 12-bit | 100 % | 100 % | 407 / 325 / 271 |
The video clock must carry the pixel rate: video_out_clk ≥ pixels per second /
VID_PPC. A colour pipeline loses nothing at 2 pixels per beat; Mono and Bayer formats below 16
bits need 4 pixels per beat to use a whole connection.