Lec0 Source Coding & Compression

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 38

Source Coding & Data Compression

References ….. One, Three, Four


Useful Compression Terms
- Adaptive / Non-adaptive Compression
- Lossy/Lossless Compression
- Perceptive Compression
- Symmetric/ Asymmetric Compression
- Universal Compression
Compression Performance
Basic Terms & Definitions
Definitions
The Implication of Kraft Inequality
Kraft Inequality and Compression
With source Extension to order n it becomes;
 Example (D=2);
Example#1 (D=3);

Example#2 (D=3);
The Compression
flowchart
The Decompression
flowchart
Applications of RLE to Image
Compression
 One Dimensional
Conditional Image RLE
Microcom Networking Protocol
(MNP5)
The Compression here is Performed in Two Stages
1- RLE
Whenever there is a run of 3 or more the RLE emits
3 copies followed by repetition count.

2- Frequency Encoding (Lookup-Table)


See Next table
Arithmetic Coding
The Huffman method is simple, efficient, and produces the best codes for the
individual data symbols. It is optimum when the symbols have probabilities of
occurrence that are negative powers of 2 (i.e., numbers such as 1 /2, 1/4, or 1/8).
This is because the Huffman method assigns a code with an integral number of
bits to each symbol in the alphabet. Information theory shows that a symbol with
probability 0.4 should ideally be assigned a 1.32-bit code, since −log20.4 ≈ 1.32.
The Huffman method, however, normally assigns such a symbol a code of 2 bits !
Arithmetic coding overcomes the problem of assigning integer codes to the
individual symbols by assigning one (normally long) code to the entire input file.
The method starts with a certain interval, it reads the input file symbol by symbol,
and uses the probability of each symbol to narrow the interval. Specifying a
narrower interval requires more bits, so the number constructed by the algorithm
grows continuously. To achieve compression, the algorithm is designed such that a
high-probability symbol narrows the interval less than a low-probability symbol,
with the result that high-probability symbols contribute fewer bits to the output .
Encoding
Decoding: The decoder use last low (the encoder o/p)
as its input code , then
The code>> Then;
AC Notes for Discussion and self Study;

1- The coding/decoding process for symbols with large


margins in their Prob.
2- Implementation in limited arithmetic precision.
3- The compression achieved as compared to Compact
Code.
4- Adaptive AC
5- The QM coder…
Dictionary Compression Methods
1- LZ77 or Sliding Window;
Self Study (LZ77);
1- The buffer size (look-a-head and search
buffers).
2-Decoding Process..
2- LZW Method
The LZW method starts by initializing the dictionary to all the
symbols in the alphabet. In the common case of 8-bit symbols,
the first 256 entries of the dictionary (entries 0 through 255) are
occupied before any data is input. Because the dictionary is
initialized, the next input character will always be found in the
dictionary. This is why an LZW token can consist of just a pointer
and does not have to contain a character code. The principle of
LZW is that the encoder inputs symbols one by one and
accumulates them in a string I. After each symbol is input and is
concatenated to I, the dictionary is searched for string I. As long
as I is found in the dictionary, the process continues. At a certain
point, adding the next symbol x causes the search to fail; string I
is in the dictionary but string Ix (symbol x concatenated to I) is
not.
The stored Dictionary for the Example
Self Study :
1- The decoding process

2-Buffer size

3- Adaptive Version

You might also like