Bandwidth of a MIPI CSI-2 camera interface

How to size the link between a camera sensor and a SoC: from pixel rate to data rate, D-PHY lane utilization, pixel formats and packetization overhead.

Published on Updated on MIPICSI-2D-PHYCameraImaging
Code on GitHub ↗

When you connect a camera sensor to a microcontroller or a SoC, before choosing how many lanes to use and how fast to run them you must establish how many bits per second the sensor produces and whether the interface can carry them. The comparison needs pixel rate, data format and the sensor’s transmission timing.

What MIPI CSI-2 is

CSI-2 (Camera Serial Interface 2) is the protocol by which, in most modern devices, an image sensor talks to the processor. It defines how pixels are packetized and marked (line start/end, frame start/end, virtual channels), but not how they physically travel on the wire: that is the job of the physical layer, usually D-PHY.

On D-PHY data flows over differential lanes in parallel — typically 1, 2 or 4 — alongside a clock lane. Each lane runs at a given lane rate (e.g. 800, 1500, 2500 Mbps). The overall bandwidth is the sum of the lanes.

How the bandwidth is computed

The raw video stream is a continuous sequence of pixels. The required bandwidth is the product of how many pixels per second and how much each pixel weighs:

pixelRate=width⋅height⋅fps[pixel/s]\text{pixelRate} = \text{width}\cdot\text{height}\cdot\text{fps} [\text{pixel/s}]dataRate=pixelRate⋅bits-per-pixel[bit/s]\text{dataRate} = \text{pixelRate}\cdot\text{bits-per-pixel} [\text{bit/s}]capacity=lane-count⋅lane-rate[Mbps]\text{capacity} = \text{lane-count}\cdot\text{lane-rate} [\text{Mbps}]util%=dataRatecapacity⋅100\text{util}\% = \dfrac{\text{dataRate}}{\text{capacity}}\cdot 100

An example: 1920×1080 at 30 fps in RAW10. The pixel rate is 1920 · 1080 · 30 ≈ 62.2 Mpixel/s; at 10 bits per pixel the data rate is ≈ 622 Mbps. On 2 lanes at 1500 Mbps the capacity is 3000 Mbps, so utilization is ≈ 21%: plenty of headroom.

How to read the utilization:

  • below ~80% — there is headroom;
  • 80–100% — it is tight (little room for blanking, overhead, tolerances);
  • above 100% — the lanes cannot carry the stream: you need more lanes, a higher lane rate or a lighter format.

The 80% threshold is the tool’s headroom convention, not a MIPI requirement. Required headroom depends on packet overhead, timing and sensor transmission mode.

The opposite case: 3840×2160 at 60 fps in RAW12. The pixel rate is 3840·2160·60 ≈ 498 Mpixel/s; at 12 bits/pixel the data rate is ≈ 6.0 Gbps. On the same 2 lanes at 1500 Mbps (3000 Mbps) utilization would be ~199% — impossible; you need 4 lanes at 1500 Mbps (6000 Mbps), and even then you are at ~99.5%, at the edge. This is the typical point where you raise the lane rate or move to a lighter format.

Pixel formats and bits/pixel

For a given resolution and frame rate, the format is what changes the bandwidth:

Format bits/pixel Notes
RAW8 / 10 / 12 / 14 8 / 10 / 12 / 14 sensor Bayer output, before the ISP
YUV422 16 luma + subsampled chroma
RGB888 24 full RGB, after the ISP

Going from RAW10 to RGB888 nearly triples the bandwidth (from 10 to 24 bits/pixel): this is why high-resolution pipelines prefer to transfer the RAW and process it downstream.

Overhead: two different mechanisms, often conflated

Two overheads of different nature are added to the pixel data rate, and they weigh very differently.

Packetization: it depends on payload

A CSI-2 long packet carries a 4-byte Packet Header (Data Identifier, a two-byte Word Count, ECC) and a 2-byte Packet Footer checksum; to those add the Frame Start and Frame End short packets (4 bytes each) and, if enabled, the Line Start and Line End ones. A line’s payload is width · bpp / 8 bytes, so:

overheadpkt=6+8 (LS+LE)width⋅bpp/8\text{overhead}_\text{pkt} = \dfrac{6 + 8_{\,(\mathrm{LS+LE})}}{\text{width}\cdot\text{bpp}/8}

The control bytes are a per-line constant while the payload grows with width: the overhead is therefore inversely proportional to horizontal resolution, and must be calculated for the actual format and packet count.

Resolution Format Line payload Overhead without LS/LE With LS/LE
160×120 RAW8 160 B 3.792 % 8.792 %
640×480 RAW8 640 B 0.940 % 2.190 %
1280×720 RAW10 1600 B 0.376 % 0.876 %
1920×1080 RAW10 2400 B 0.250 % 0.584 %
1920×1080 RGB888 5760 B 0.104 % 0.243 %
2592×1944 RAW10 3240 B 0.185 % 0.432 %
3840×2160 RAW12 5760 B 0.104 % 0.243 %

On 1080p RAW10 packetization is worth 0.25 % — or 0.58 % with line sync enabled. It only becomes significant where the payload is tiny: at 160×120 RAW8 it is 3.8 %, and 8.8 % with LS/LE. That is the case of low-resolution high-frame-rate vision sensors, where the bottleneck is usually the LP time between packets rather than the bytes.

Packet overhead is below 1% in the higher-resolution examples, but that is not a universal percentage, as the smaller payloads show.

Blanking and rate during transmission

Sensor blanking does not necessarily correspond to bytes sent over the link. If data is sent only during the active window, its transmission rate exceeds the frame average. Buffering, clocking and sensor mode can change this relationship: check the datasheet timing.

For the illustrative case without redistribution through buffering, let b_h = line_length_pck / width − 1 and b_v = frame_length_lines / height − 1, with registers in compatible time domains. Then:

RpeakRavg=(1+bh)(1+bv)\dfrac{R_\text{peak}}{R_\text{avg}} = (1 + b_h)(1 + b_v)⟹  utilmax=1(1+bh)(1+bv)\Longrightarrow\; \text{util}_\text{max} = \dfrac{1}{(1+b_h)(1+b_v)}

Numerical examples under this transmission assumption:

Horizontal blanking Vertical blanking Peak / average Maximum average utilization
5 % 3 % 1.082 92.5 %
10 % 5 % 1.155 86.6 %
12 % 10 % 1.232 81.2 %
15 % 8 % 1.242 80.5 %
14 % 13 % 1.288 77.6 %
20 % 15 % 1.380 72.5 %
30 % 20 % 1.560 64.1 %

A peak/average ratio of 1.25 allows at most 80% average utilization under this assumption, before other overheads. This does not establish a general threshold: the different examples require different margins.

What to put in the overhead field

The tool shows the net pixel rate and applies the entered overhead factor. Use a factor consistent with actual packet overhead and sensor timing, without counting the same headroom twice. Under the preceding assumption, the timing factor alone for the 14%/13% case is (1+b_h)(1+b_v) − 1 = 28.8%; it does not describe every CSI-2 mode.

When you need more lanes

If utilization exceeds the threshold, you have three levers:

  1. More lanes — doubling from 2 to 4 lanes doubles the capacity. It is the most direct lever, if the sensor and SoC expose them.
  2. Higher lane rate — newer D-PHY reach higher lane rates; often, though, it is the sensor or the PCB that sets the limit. And the lane rate is not continuous: it comes from a PLL with integer dividers, so the values actually selectable are a grid. Asking for “1500 Mbps” may mean getting 1440 or 1584, which is one more reason not to design at the edge of capacity.
  3. A lighter format — dropping bit depth or subsampling reduces the data rate at the source.

The tool also computes the minimum number of lanes to stay below the threshold at that lane rate, so you immediately see how much interface you need.

Examples: net data rate and data rate with blanking

The same links as above, computed by the engine, with and without the 28.8 % blanking of the 14 %/13 % case:

Case Net With 14/13 % blanking Capacity Utilization Verdict
1920×1080 30 fps RAW10, 2 lane @ 1500 622 Mbps 801 Mbps 3000 Mbps 26.7 % ok
1920×1080 60 fps RAW10, 2 lane @ 1500 1244 Mbps 1603 Mbps 3000 Mbps 53.4 % ok
1280×720 100 fps RAW10, 2 lane @ 1500 922 Mbps 1187 Mbps 3000 Mbps 39.6 % ok
2592×1944 30 fps RAW10, 2 lane @ 1500 1512 Mbps 1947 Mbps 3000 Mbps 64.9 % ok
3840×2160 30 fps RAW12, 4 lane @ 2500 2986 Mbps 3847 Mbps 10000 Mbps 38.5 % ok
3840×2160 60 fps RAW12, 4 lane @ 2500 5972 Mbps 7693 Mbps 10000 Mbps 76.9 % tight

In the last row, utilization rises from 59.7% to 76.9% when applying the example’s timing factor. Both remain below the tool’s threshold: deciding whether the link operates also requires packet overhead, timing and sensor/receiver constraints.

The limits of the calculation

It is a bandwidth calculation, not a timing one. It tells whether the stream fits in the lanes; it does not validate timing, clock training, lane skew, equalization, nor the distinction between continuous and discontinuous clock. It does not model the ISP nor compression, and it uses only the active area: blanking is not inferred from the sensor registers but has to be entered by hand in the overhead field, using a value checked for that configuration. For real camera-link sizing the sensor and SoC datasheets and the MIPI specification remain indispensable.

And if the PHY is C-PHY

The calculation assumes D-PHY, where each lane carries one bit per bit time and the capacity is the sum of the lane capacities. C-PHY works differently: it operates on trios rather than differential pairs and encodes more than one bit per symbol — 16 bits every 7 symbols, that is 2.286 bits/symbol. A trio at a given symbol rate therefore carries more than the number suggests:

C-PHY trios Symbol rate Equivalent bit rate
1 2500 Msps 5714 Mbps
2 2500 Msps 11 429 Mbps
3 2500 Msps 17 143 Mbps
2 5700 Msps 26 057 Mbps

To use this tool with a C-PHY link, just convert: number of trios × symbol rate × 16/7 gives the equivalent capacity in Mbps, to be compared against the data rate. Multi-virtual-channel cases stay out of scope, where several streams share the same lanes and the rates have to be summed before the comparison.

References

Last updated: · Found an error or outdated information? Let us know

A similar project?