sistemi-e-reti tpsit multimedia

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.

⚡ Esercizio interattivo apri in finestra →

Reference formulas

Raster images

QuantityFormula
Pixels from cm and DPIpx = (cm ÷ 2.54) × DPI
Total bitsbits = width × height × depth
Bytesbytes = bits ÷ 8
Memory with paletteimage_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.