0% found this document useful (0 votes)
125 views10 pages

Grow More Faculty of Engineering

The document discusses the LZ77 data compression algorithm. It explains that LZ77 uses a sliding window approach with a search buffer and look-ahead buffer. To encode the next symbol, it finds the longest matching prefix between the look-ahead buffer and search buffer and outputs the offset and length of the match along with the next symbol. An example demonstrates encoding the string "cabracadabrarrarrad" using LZ77 by finding matches within a window size of 13 and outputting triplets of <offset, length, next symbol>.

Uploaded by

Meghal Prajapati
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views10 pages

Grow More Faculty of Engineering

The document discusses the LZ77 data compression algorithm. It explains that LZ77 uses a sliding window approach with a search buffer and look-ahead buffer. To encode the next symbol, it finds the longest matching prefix between the look-ahead buffer and search buffer and outputs the offset and length of the match along with the next symbol. An example demonstrates encoding the string "cabracadabrarrarrad" using LZ77 by finding matches within a window size of 13 and outputting triplets of <offset, length, next symbol>.

Uploaded by

Meghal Prajapati
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 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