Computer Engineering is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Digital video and chroma subsampling

Notes on digital video representation and chroma subsampling: how colour is split into luma and chroma, why chroma is subsampled, how to count samples and data rate for 4:4:4, 4:2:2 and 4:2:0, and the practical effects on quality and codecs.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Digital video is used in cameras, displays, video codecs and streaming. An engineer uses chroma subsampling to reduce video data rate while keeping perceived image quality high, and must compute storage/bandwidth, design prefiltering and upsampling (reconstruction), and choose the correct subsampling for a use case (studio, broadcast, mobile).

Key ideas

  • Luma (Y): the component representing the image brightness as a weighted sum of R, G, B. It carries most of the detail that humans perceive.

  • Chroma (Cb and Cr): the two components carrying colour difference signals: Cb (blue-difference) and Cr (red-difference). Chroma has lower perceived spatial resolution in human vision, so subsampling it usually causes little visible loss.

  • YCbCr conversion (concept): a linear transform from RGB to YCbCr separates brightness from colour. Use a specific standard (BT.601 for SD/SDR, BT.709 for HD/HDTV) to get exact coefficients. Example luma coefficients (for gamma-corrected R', G', B' in [0,1]): BT.601 Y' = 0.299 R' + 0.587 G' + 0.114 B'; BT.709 Y' = 0.2126 R' + 0.7152 G' + 0.0722 B'. Practical Y'CbCr often uses limited range with offsets/scaling (8-bit studio swing: Y' in [16,235], Cb/Cr in [16,240]). For UHD/WCG systems use BT.2020 primaries (and for HDR transfer functions see BT.2100).

  • Chroma subsampling: reducing the number of chroma samples relative to luma samples to save data. Notation: J:a:b (commonly written 4:4:4, 4:2:2, 4:2:0). Exact meaning (standard exam interpretation): choose a reference block width J (usually 4). The three numbers mean: J = horizontal reference; a = number of chroma samples in the first row of J luma samples; b = number of chroma samples in the second row of J luma samples. From this you calculate chroma sample counts per image. Note: some standards and textbooks differ in vertical co-siting conventions; verify for your syllabus which convention (JPEG vs MPEG rules) they expect.

  • Common subsampling formats and what they mean (exam-style definitions):

    • 4:4:4: no subsampling. For every luma sample there is one Cb and one Cr sample. Full colour resolution.
    • 4:2:2: chroma sampled at half horizontal resolution but full vertical resolution. For each row of pixels, there are half as many Cb and Cr samples as Y.
    • 4:2:0: chroma sampled at half horizontal and half vertical resolution (effectively one quarter the chroma sample-count compared to luma). This is widely used in video compression (e.g., many consumer codecs).
  • Prefilter (anti-aliasing): before subsampling you must low-pass filter chroma to avoid aliasing. This follows the Nyquist–Shannon sampling theorem: to avoid aliasing, a continuous signal must be band-limited to less than half the sampling frequency before sampling. State it exactly: "If a band-limited signal contains no frequencies at or above half the sampling rate, it can be reconstructed exactly from its samples." Assumption: ideal band-limiting rarely achievable; practical filters trade steepness vs ringing.

  • Upsampling / reconstruction: to display or process subsampled chroma, you interpolate chroma back to full resolution. Simple methods: nearest-neighbour, bilinear, bicubic. Better methods use model-based filtering and consider chroma/luma alignment (co-siting).

  • Co-siting: the spatial alignment (position) of chroma samples relative to luma samples. Important for correct upsampling and for avoiding colour shifts at edges. When asked to draw, show a 2×2 luma pixel block and mark where a single Cb/Cr sample sits for 4:2:0, and two chroma samples in a row for 4:2:2.

Diagrams to draw for exams (describe exactly):

  • Draw a 4×2 grid of luma sample points (dots). Label horizontal indices 0 to 3, vertical 0 to 1. For 4:4:4, draw a Cb dot at each luma dot. For 4:2:2, draw Cb at horizontal positions 0 and 2 on both rows. For 4:2:0, draw a Cb at horizontal positions 0 and 2 on the first row only (no Cb on second row). Label axes "horizontal" and "vertical" and annotate that J=4 for notation. This 4:2:0 placement uses a top-row co-siting convention (e.g., JPEG-style); other standards (e.g., MPEG/H.264) center-sample chroma between rows—follow your syllabus’ convention.

Formulas

FramePixels = Width × Height — Width and Height in pixels; FramePixels is unitless (count).

Samples_Y = FramePixels — number of luma samples per frame.

If format is 4:4:4: Samples_Cb = Samples_Cr = FramePixels — each chroma equals luma.

If format is 4:2:2: Samples_Cb = Samples_Cr = FramePixels / 2 — chroma half horizontal resolution.

If format is 4:2:0: Samples_Cb = Samples_Cr = FramePixels / 4 — chroma quarter resolution (half horizontal and half vertical).

TotalSamples = Samples_Y + Samples_Cb + Samples_Cr — total component samples per frame.

BitsPerFrame = TotalSamples × BitsPerSample — BitsPerSample is bits per component (e.g., 8, 10, 12 bits).

DataRate (bits/s) = BitsPerFrame × FrameRate — FrameRate in frames per second (s^-1).

Where each symbol means is stated inline. These apply to uncompressed planar formats where each component has same bit depth and packing overhead is ignored. Assume even Width for 4:2:2 and even Width and Height for 4:2:0; otherwise chroma plane dimensions are ceil-divided and/or padded to even sizes by formats/codecs.

Worked examples

Example 1 — Data rate comparison (HD video) Given: Width = 1920 px, Height = 1080 px, FrameRate = 30 s^-1, BitsPerSample = 8 bits.

  1. Compute FramePixels = 1920 × 1080 = 2,073,600.

  2. For 4:4:4: Samples_Y = 2,073,600; Samples_Cb = 2,073,600; Samples_Cr = 2,073,600. TotalSamples = 6,220,800. BitsPerFrame = 6,220,800 × 8 = 49,766,400 bits. DataRate = 49,766,400 × 30 = 1,492,992,000 bits/s ≈ 1.492992 Gbit/s. In bytes/s: divide by 8 → 186,624,000 B/s ≈ 186.624 MB/s. Final: 4:4:4 requires ≈ 1.493 Gbit/s (≈186.6 MB/s).

  3. For 4:2:0: Samples_Y = 2,073,600; Samples_Cb = Samples_Cr = 2,073,600 / 4 = 518,400 each. TotalSamples = 3,110,400. BitsPerFrame = 3,110,400 × 8 = 24,883,200 bits. DataRate = 24,883,200 × 30 = 746,496,000 bits/s ≈ 0.746496 Gbit/s. Bytes/s: 93,312,000 B/s ≈ 93.312 MB/s. Final: 4:2:0 requires ≈ 0.7465 Gbit/s (≈93.31 MB/s).

  4. Conclusion: 4:2:0 halves the data rate compared to 4:4:4 in this example (exactly half because bits per pixel 12 vs 24).

Example 2 — 4:2:2 intermediate case (same inputs)

  1. For 4:2:2: Samples_Cb = Samples_Cr = FramePixels / 2 = 1,036,800 each. TotalSamples = 2,073,600 + 1,036,800 + 1,036,800 = 4,147,200. BitsPerFrame = 4,147,200 × 8 = 33,177,600 bits. DataRate = 33,177,600 × 30 = 995,328,000 bits/s ≈ 0.995328 Gbit/s. Bytes/s ≈ 124,416,000 B/s ≈ 124.416 MB/s. Final: 4:2:2 requires ≈ 0.9953 Gbit/s (≈124.4 MB/s).

Example 3 — small numeric trace of upsampling (algorithmic) Given a 1D line of luma at pixel positions 0..3 and corresponding 4:2:2 chroma samples at positions 0 and 2. Show bilinear upsampling for chroma at position 1:

  1. Chroma at pos0 = C0, pos2 = C2.
  2. Bilinear (linear in 1D) estimate at pos1 = (C0 + C2)/2.
  3. Use this method to estimate chroma at intermediate positions (e.g., pos1) between known samples. This shows interpolation arithmetic used in simple chroma upsampling.

Common mistakes

  • Forgetting to low-pass filter chroma before subsampling — leads to aliasing artefacts around high-frequency colour edges.
  • Confusing Y (luma) with luminance: Y in YCbCr is a weighted sum of R,G,B used for encoding; it approximates perceived brightness but is not exactly the photometric luminance unless using exact colorimetric transforms.
  • Using incorrect RGB→YCbCr coefficients without checking whether the standard is BT.601 or BT.709.

For your exam

Question types: definitions (explain luma, chroma, YCbCr, chroma subsampling notation), short notes (compare 4:4:4, 4:2:2, 4:2:0; explain co-siting), derivations (derive sample counts and data rates), numericals (compute bits/s for given resolution and frame rate), diagram tasks (draw luma grid and place chroma samples), algorithm traces (show upsampling steps for a small block).

What a full-marks answer includes:

  • Clear definitions of every term used (pixel, luma, chroma, co-siting), with bolded key terms in your answer if required by style.
  • Correct statement of the J:a:b notation and explicit calculation of sample counts.
  • Any assumptions stated (e.g., planar storage, equal bit depth per component, ignoring packing overhead).
  • For numericals: show FramePixels, Samples per component, BitsPerFrame, DataRate with units at every step and final numeric answer with units.
  • For diagrams: labeled axes, pixel coordinates, and clear marking of chroma locations.

Quick check

  1. For a 1280×720 image, how many luma samples are there per frame?
  2. In 4:2:2, what fraction of chroma samples does each chroma plane have compared to luma?
  3. True or False: 4:2:0 always halves the total data rate compared to 4:4:4.

Answers: 1) 1280×720 = 921,600 luma samples. 2) Each chroma plane has 1/2 the samples of luma. 3) True under our stated assumptions (equal bit depth per component, three components, no packing overhead): 4:2:0 has 1.5 samples/pixel vs 3 for 4:4:4, so exactly half the data rate. In real systems with different bit depths, alpha channels, or packing/padding, it may not be exactly half.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?