Chapter 5 - Dictionary Techniques
Chapter 5 - Dictionary Techniques
DICTIONARY
TECHNIQUES
Lecture By,
Prof.M.Dhanalakshmi,
Asst Prof.,
IT Dept,
SCET, Surat.
DICTIONARY TECHNIQUES - INTRODUCTION
Lossless Compression technique.
Static Dictionary:
The already existing knowledge of the source and using the
already built in dictionary the long phrases are encoded.
Dynamic (or) Adaptive Dictionary:
As we come across the phrases simultaneous dictionary
updating and encoding will be done in parallel.
A very reasonable approach to encoding long phrases
is to keep a list, or dictionary, of frequently occurring
patterns.
When these patterns appear in the source output,
they are encoded with a reference to the dictionary.
In effect we are splitting the input into two
classes, frequently occurring patterns and
infrequently occurring patterns.
Dictionary
Static Dynamic
LZ78 Approach
LZW Approach
ADAPTIVE DICTIONARY
LZ77/LZ1/Sliding Window Technique
Sliding window is divided into two parts:
1. Search Buffer
2. Look Ahead Buffer
c-> codeword.
ADAPTIVE DICTIONARY
LZ77 Approach:
In the LZ77 approach, the dictionary is simply a
portion of the previously encoded sequence.
The encoder examines the input sequence through a
sliding window.
The window consists of two parts,
1. A search buffer that contains a portion of the
recently encoded sequence
2. Look-ahead buffer that contains the next portion of
SB LAB
i) c-> <0,0,C(c)>
Search Pointer
c a b r a c a d a b r a r r a r r a d
SB LAB
ADAPTIVE DICTIONARY
ii) a-> <0,0,C(a)>
c a b r a c a d a b r a r r a r r a d
SB LAB
iii)b->(0,0,C(b))
c a b r a c a d a b r a r r a r r a d
SB LAB
ADAPTIVE DICTIONARY
iv) r-> (0,0,C(r))
Search Pointer
c a b r a c a d a b r a r r a r r a d
3
v) a-> (3,1,C(c))
c a b r a c a d a b r a r r a r r a d
2
ADAPTIVE DICTIONARY
vi) a-> (2,1,C(d))
c a b r a c a da b r a r r a r r a d
SB LAB
c a b r a c a da b r a r r a r r a d
SB LAB
vii) r-> (3,5,C(d)
c a b r a c a da b r a r r a r r a d
ADAPTIVE DICTIONARY
Final encoded triplet sequence:
<0,0,C(c)>
<0,0,C(a)>
<0,0,C(b)>
<0,0,C(r)>
<3,1,C(c)>
<2,1,C(d)>
<7,4,C(r)>
<3,5,C(d)>
LZ77 DECODING
LZ77 DECODING:
LZ78 ENCODING
Represent the encoder output in doublet form
<i,c>.
The inputs are coded as a double <i,c>, with i
being an index corresponding to the dictionary
entry that was the longest match to the input,
c being the code for the character in the input
following the matched portion of the input.
Whenever a newest entry happens then index
value will be “0”.
LZ78 ENCODING
Example:
Encode the sequence by using LZ78 Approach
ABCDABCABCDAABCABCE