O'Reilly logo

Learning Computer Architecture with Raspberry Pi by Ben Everard, Tim Mamtora, Ralph Roberts, Jeffrey Duntemann, Eben Upton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9

Video Codecs and Video Compression

A VIDEO IS a sequence of images that are shown one after the other. In principle, you could store them as a digital flip-book, with a picture for each frame. Without compression, roughly 3 bytes per pixel (one to store each of the red, green and blue colour components) are required to avoid introducing perceptible quantisation artefacts (visible steps in brightness or colour). If you wanted to store video even at a relatively low resolution (640 × 480 pixels) at 25 frames a second, each second would then take up 3 * 640 * 480 * 25 bytes, which works out to just more than 23 megabytes (MB) per second. A two-hour film would take up more than 165 gigabytes (GB), which is equivalent to 10 double-sided, double-layer DVDs. Applying a generic lossless compression algorithm such as ZIP might make it a little smaller, but you’d still need several of these disks.

Storing footage as just described would basically make almost any form of digital video distribution completely impractical. Changing the side of a DVD every six minutes would be annoying, and downloading a TV show would take days. YouTube would only work for clips a few seconds long. Video chat would require either an image too small to be useful or the fastest Internet connection available.

In order to make digital video distribution possible, it’s essential to find ways to make the videos much smaller. This shrinking of files is known as compression. There are two basic types of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required