compress3_CMU_Lempel_Ziv

compress3_CMU_Lempel_Ziv - Source Carnegie Mellon...

This preview shows pages 1–8. Sign up to view the full content.

Source Carnegie Mellon University, USA Course: Algorithms in Real-Word, 15853, Fall, 2000 http://www.cs.cmu.edu/afs/cs/academic/class/15853-f00/slides/compress3.ppt Posted by: Saad Qaisar, NUST, Pakistan. 15-853 Page1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
15-853 Page2 15-583:Algorithms in the Real World Data Compression III Lempel-Ziv algorithms Burrows-Wheeler Introduction to Lossy Compression
15-853 Page3 Lempel-Ziv Algorithms LZ77 (Sliding Window) Variants: LZSS (Lempel-Ziv-Storer-Szymanski) Applications: gzip , Squeeze, LHA, PKZIP, ZOO LZ78 (Dictionary Based) Variants: LZW (Lempel-Ziv-Welch), LZC (Lempel-Ziv-Compress) Applications: compress , GIF, CCITT (modems), ARC, PAK Traditionally LZ77 was better but slower, but the gzip version is almost as fast as any LZ78.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
15-853 Page4 LZ77: Sliding Window Lempel-Ziv Dictionary and buffer “windows” are fixed length and slide with the cursor On each step: Output (p,l,c) p = relative position of the longest match in the dictionary l = length of longest match c = next char in buffer beyond longest match Advance window by l + 1 a a c a a c a b c a b a b a c Dictionary (previously coded) Lookahead Buffer Cursor
15-853 Page5 LZ77: Example a a c a a c a b c a b a a a c (0,0,a) a a c a a c a b c a b a a a c (1,1,c) a a c a a c a b c a b a a a c (3,4,b) a a c a a c a b c a b a a a c (3,3,a) a a c a a c a b c a b a a a c (1,2,c) Dictionary (size = 6) Longest match Next character

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
15-853 Page6 LZ77 Decoding Decoder keeps same dictionary window as encoder. For each message it looks it up in the dictionary and inserts a copy What if l > p? (only part of the message is in the dictionary.) E.g. dict = abcd , codeword = (2,9,e) Simply copy starting at the cursor for (i = 0; i < length; i++) out[cursor+i] = out[cursor-offset+i] Out = abcdcdcdcdcdc
15-853 Page7 LZ77 Optimizations used by gzip LZSS: Output one of the following formats

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 26

compress3_CMU_Lempel_Ziv - Source Carnegie Mellon...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online