Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

GROW MORE FACULTY

OF ENGINEERING
SUBJECT : DATA COMPRESSION AND DATA RETRIVAL
SEM : 6TH IT
TOPIC : DATA DICTIONARY – LZ77 EXAMPLE
LZ77 APPROACH

 In lZ77 approach, the encoder examines the input sequence through a Sliding
Window.
 The window consist of two parts:
1. Search Buffer
2. Look – Ahead Buffer.
 A Search Buffer that contains a portion of the recently encoded sequence.
 A Look – Ahead Buffer that contains the next portion of the sequence.
 To encode the sequence in look-ahead buffer, the encoder moves a search
pointer back through the search buffer until it encounters a match to the first
symbol in the look-ahead buffer.
LZ77 APROACH
 Here, find below process

Window Size - 13

c a b r a c a d a b r a
rra
Search Buffer Look – Ahead Buffer

 Triples : <o ,l , c>

Offset
Codeword
Length of match
LZ77 APROACH

 Offset : The distance of the pointer from the Look – Ahead Buffer is called
Offset.
 Length of match : The number of consecutive symbol in search buffer
that match consecutive symbol in Look – Ahead Buffer , starting with the first
symbol, is called Length of the Match.
 Codeword : c is the codeword corresponding to the symbol in the look –
ahead buffer that follows the match.
LZ77 EXAMPLE.

cabracadabrarrarrad
Here window size is 13.
Look – Ahead Buffer size is 6
Search Buffer Look – Ahead Buffer
c a b r a c ada

c - <0, 0 , c(c)>
Search Buffer Look – Ahead Buffer
c a b r a c a dad

a - <0, 0, c(a)>
LZ77 EXAMPLE.

cabracadabrarrarrad
Search Buffer Look – Ahead Buffer
c a b r a c a d abr

b - <0, 0 , c(b)>
Search Buffer Look – Ahead Buffer
c a b r a c a d a bra

r - <0, 0, c(r)>
LZ77 EXAMPLE.

cabracadabrarrarrad
Search Buffer Look – Ahead Buffer
c a b r a c a d a b rar

a - <3, 1 , c(c)>
Search Buffer Look – Ahead Buffer
c a b r a c a d a b r a rra

a - <2, 1, c(d)>
LZ77 EXAMPLE.

c a b r a c a d a b r a r r a r r a d
Search Buffer Look – Ahead Buffer

c a b r a c a d a b r a r r arr

r - <7, 4, c(r)>
Search Buffer Look – Ahead Buffer

cabrac a d a b r a r r a r r a d

d - <3, 5, c(d)>
LZ77 APROACH
 Output (Decoded String)

<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)>

You might also like