A raw video stream tends to be quite demanding when it comes to storage requirements, and demand for network capacity when being transferred between computers. Before being stored or transferred, the raw stream is usually transformed to a representation using compression. When compressing an image sequence, one may consider the sequence a series of independent images, and compress each frame using single image compression methods, or one may use specialized video sequence compression schemes, taking advantage of similarities in nearby frames. The latter will generally compress better, but may complicate handling of variations in network transfer speed.
Compression algorithms may be classified into two main groups, reversible and irreversible. If the result of compression followed by decompression gives a bitwise exact copy of the original for every compressed image, the method is reversible. This implies that no quantizing is done, and that the transform is accurately invertible, i.e. it does not introduce round-off errors.
When compressing general data, like an executable program file or an accounting database, it is extremely important that the data can be reconstructed exactly. For images and sound, it is often convenient, or even necessary to allow a certain degradation, as long as it is not too noticeable by an observer.
The reason to introduce loss of quality, is to reduce the bitrate. In general, a higher allowable distortion gives lower bitrate. Often it may be interesting to have some kind of measure for the degradation of the decompressed image compared to the original. There are two classes of comparison measures, subjective and objective.
Subjective measures are performed by letting a group of people do a side by side comparison of the decompressed and the original image. The comparison is done using predefined quality classes, such as ``excellent'', ``fine'', ``passable'', ``marginal'', ``inferior'' and ``unusable'' [11].
Objective measures are mathematically or algorithmically oriented. One
well known measure, is Root Mean Squared Error (RMSE). Given an
original image f, and a compressed and decompressed
image
, RMSE is calculated according to the following formula
[11, section 6.1.4,]:
RMSE is 0 for identical images. Higher values denote higher deviation between the images. Note that low RMSE not necessarily indicates high subjective quality.
Closely related to RMSE, is Peak Signal to Noise Ratio (PSNR), measured in dB. For an eight bit image, with intensity values between 0 and 255, the PSNR is given by [12, page 77,]
The above objective measures build on differences between single pixels in the two images. This gives results not always comparable to subjective measures. Subjectively, we appreciate removal of noise pixels, while smoothing of edges makes the image look like it is out of focus. In the above functions, noise pixel removal and edge smoothing is treated equally.