25.02.2013 Views

Compression Outline Lempel-Ziv Algorithms LZ77: Sliding Window ...

Compression Outline Lempel-Ziv Algorithms LZ77: Sliding Window ...

Compression Outline Lempel-Ziv Algorithms LZ77: Sliding Window ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Burrows-Wheeler Decode<br />

Function BW_Decode(In, Start, n)<br />

S = MoveToFrontDecode(In,n)<br />

R = Rank(S)<br />

j = Start<br />

for i=1 to n do<br />

Out[i] = S[j]<br />

j = R[j]<br />

Rank gives position of each char in sorted order.<br />

296.3 Page 21<br />

Overview of Text <strong>Compression</strong><br />

PPM and Burrows-Wheeler both encode a single<br />

character based on the immediately preceding<br />

context.<br />

<strong>LZ77</strong> and LZ78 encode multiple characters based on<br />

matches found in a block of preceding text<br />

Can you mix these ideas, i.e., code multiple<br />

characters based on immediately preceding<br />

context?<br />

– BZ does this, but they don’t give details on how<br />

it works – current best compressor<br />

– ACB also does this – close to best<br />

296.3 Page 23<br />

S<br />

o 4<br />

e 2<br />

e 6<br />

c 3<br />

d 1<br />

d 5<br />

Decode Example<br />

Rank(S)<br />

6<br />

4<br />

5<br />

1<br />

2<br />

3<br />

⇐<br />

Out<br />

d1 ⇐<br />

e2<br />

c3<br />

o4<br />

d5<br />

e6<br />

296.3 Page 22<br />

ACB (Associate Coder of Buyanovsky)<br />

Keep dictionary sorted by context<br />

(the last character is the most<br />

significant)<br />

• Find longest match for context<br />

• Find longest match for contents<br />

• Code<br />

• Distance between matches in<br />

the sorted order<br />

• Length of contents match<br />

Has aspects of Burrows-Wheeler,<br />

and <strong>LZ77</strong><br />

Context Contents<br />

decode<br />

dec ode<br />

d ecode<br />

decod e<br />

de code<br />

deco de<br />

296.3 Page 24<br />

6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!