8. Compression. Video and Audio Compression . Video and Audio files are very large. Unless we develop and maintain very high bandwidth networks (Gigabytes per second or more) we have to compress the data.
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Video and Audio files are very large. Unless we develop and maintain very high bandwidth networks (Gigabytes per second or more) we have to compress the data.
Relying on higher bandwidths is not a good option - M25 Syndrome: Traffic needs ever increases and will adapt to swamp current limit whatever this is.
Compression becomes part of the representation or coding scheme which have become popular audio, image and video formats.
Compression basically employs redundancy in the data:
where data is compressed and can be reconstituted (uncompressed) without loss of detail or information. These are referred to as bit-preserving or reversible compression systems also.
where the aim is to obtain the best possible fidelity for a given bit-rate or minimizing the bit-rate to achieve a given fidelity measure. Video and audio compression techniques are most suited to this form of compression.
Simple Repetition Suppression
can be replaced with
where f is the flag for zero.
can be encoded as:
The savings are dependent on the data. In the worst case (Random Noise) encoding is more heavy than original file: 2*integer rather 1* integer if data is represented as integers.
This is a simple form of statistical encoding.
Here we substitute a frequently repeating pattern(s) with a code. The code is shorter than the pattern giving us compression.
A simple Pattern Substitution scheme could employ predefined code (for example replace all occurrences of `The' with the code '&').
A predefined symbol table may used i.e. assign code i to token i.
However, it is more usual to dynamically assign codes to tokens. The entropy encoding schemes below basically attempt to decide the optimum assignment of codes to achieve the best compression.
Lossless compression frequently involves some form of entropy encoding and are based in information theoretic techniques, Shannon is father of information theory.
Symbol A B C D E
Count 15 7 6 6 5
1. Sort symbols according to their frequencies/probabilities, e.g., ABCDE.
Huffman coding is based on the frequency of occurrence of a data item (pixel in images). The principle is to use a lower number of bits to encode the data that occurs more frequently. Codes are stored in a Code Book which may be constructed for each image or a set of images. In all cases the code book plus encoded data must be transmitted to enable decoding.
In order to encode images:
The basic Huffman algorithm has been extended, for the following reasons:
The solution is to use adaptive algorithms, e.g. Adaptive Huffman coding (applicable to other adaptive compression algorithms).
Huffman coding and the like use an integer number (k) of bits for each symbol, hence k is never less than 1. Sometimes, e.g., when sending a 1-bit image, compression becomes impossible.
Map all possible length 2, 3 … messages to intervals in the range [0..1] (in general, need – log p bits to represent interval of size p).
To encode message, just send enough bits of a binary fraction that uniquely specifies the interval.
The LZW algorithm is a very common compression technique.
Suppose we want to encode the Oxford Concise English dictionary which contains about 159,000 entries. Why not just transmit each word as an 18 bit number?
w = NIL;
while ( read a character k )
if wk exists in the dictionary
w = wk;
add wk to the dictionary;
output the code for w;
w = k;
read a character k;
w = k;
while ( read a character k )
/* k could be a character or a code. */
entry = dictionary entry for k;
add w + entry to dictionary;
w = entry;