Multimedia Encoding — TPSIT Exercises
A support tool for multimedia encoding exercises: each tab shows the step-by-step solution so you understand the reasoning, not just the final result.
Reference formulas
Raster images
| Quantity | Formula |
|---|---|
| Pixels from cm and DPI | px = (cm ÷ 2.54) × DPI |
| Total bits | bits = width × height × depth |
| Bytes | bytes = bits ÷ 8 |
| Memory with palette | image_data + (N_colours × colour_bits ÷ 8) |
True Colour = 24 bits/pixel (8 each for R, G, B).
Uncompressed video
video_bit_rate = width × height × bits/pixel × fps
audio_bit_rate = channels × frequency_Hz × bits/sample
storage = (video_bit_rate + audio_bit_rate) × duration_seconds ÷ 8
LRE Compression (Run-Length Encoding)
With 4 bits of colour depth, each run is encoded as:
- 4 bits for the counter (max 15 consecutive pixels)
- 4 bits for the colour
→ 1 byte per run. If the image has many colour changes, LRE can make the file larger than the original.
EC