Lecture 10: Dictionary Coding

Slides:



Advertisements
Similar presentations
2.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 2 - Images.
Advertisements

Lecture 4: Data Compression Techniques TSBK01 Image Coding and Data Compression Jörgen Ahlberg Div. of Sensor Technology Swedish Defence Research Agency.
Graphics on the Web. Common Image File Types As you may know, the most widely supported web image graphic formats are GIF and JPEG. So the question is.
15-583:Algorithms in the Real World
The Lossless JPEG standard y=(a+b)/2 = 145 r= =-35 Category (r) = 6, Magnitude (r) = ’s complement of cat (r) = Rep(35)={6,011100}
Image Data Representations and Standards
Raster graphics. Colour depth 01 1 bit pr pixel = 2 combinations (2 1 ): 2 bits pr pixel = 4 combinations (2 2 ): bits pr pixel = 16 combinations(2.
Source Coding Data Compression A.J. Han Vinck. DATA COMPRESSION NO LOSS of information and exact reproduction (low compression ratio 1:4) general problem.
Algorithms for Data Compression
Lecture 6 Source Coding and Compression Dr.-Ing. Khaled Shawky Hassan
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 15: Compression
Lossless Compression - II Hao Jiang Computer Science Department Sept. 18, 2007.
Compression & Huffman Codes
Algorithm Programming Some Topics in Compression Bar-Ilan University תשס"ח by Moshe Fresko.
Lempel-Ziv Compression Techniques Classification of Lossless Compression techniques Introduction to Lempel-Ziv Encoding: LZ77 & LZ78 LZ78 Encoding Algorithm.
Lecture 6: Huffman Code Thinh Nguyen Oregon State University.
Lempel-Ziv Compression Techniques
Compression & Huffman Codes Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Lempel-Ziv Compression Techniques
Images.
Graphics in the web Digital Media: Communication and Design
Source Coding Hafiz Malik Dept. of Electrical & Computer Engineering The University of Michigan-Dearborn
Lossless Compression in Multimedia Data Representation Hao Jiang Computer Science Department Sept. 20, 2007.
Chapter 7 Special Section Focus on Data Compression.
Lossless Compression Multimedia Systems (Module 2 Lesson 3)
Roger Cheng (JPEG slides courtesy of Brian Bailey) Spring 2007
Media File Formats Jon Ivins, DMU. Text Files n Two types n 1. Plain text (unformatted) u ASCII Character set is most common u 7 bits are used u This.
Lecture 10 Data Compression.
File Formats COM 366 Web Design & Layout. Native file format –Format native to software program –.psd > PhotoShop default Preserves layers –Use “Save.
Noiseless Coding. Introduction Noiseless Coding Compression without distortion Basic Concept Symbols with lower probabilities are represented by the binary.
Source Coding-Compression
Digital Image: Representation & Processing (2/2) Lecture-3
Multimedia Specification Design and Production 2012 / Semester 1 / L3 Lecturer: Dr. Nikos Gazepidis
Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This.
Images 01/29/04 Resources: Yale Web Style Guide The GIF Controversy Unisys - lzw.
The LZ family LZ77 LZ78 LZR LZSS LZB LZH – used by zip and unzip
Addressing Image Compression Techniques on current Internet Technologies By: Eduardo J. Moreira & Onyeka Ezenwoye CIS-6931 Term Paper.
Web Graphics. Colours and Display Graphics and Modems 28.8kbps = 3.6 KB per second 36 KB takes 10 seconds to load. Pixels and color.
Types of Graphics  Vector Individual scalable objects defined by mathematical equations  Bitmap Pixels (tiny, single-colored square) in a grid Most.
Data compression. lossless – looking for unicolor areas or repeating patterns –Run length encoding –Dictionary compressions Lossy – reduction of colors.
Multimedia – Data Compression
Lecture 7 Source Coding and Compression Dr.-Ing. Khaled Shawky Hassan
compress! From theoretical viewpoint...
Image File Formats By Dr. Rajeev Srivastava 1. Image File Formats Header and Image data. A typical image file format contains two fields namely Dr. Rajeev.
Image File Formats Which one is right for me?. The Only Three Image Formats Your Will Ever Need: Names Jpg “Joint Photographic Experts Group” Png “Portable.
Prof. Paolo Ferragina, Algoritmi per "Information Retrieval" Basics
LZW (Lempel-Ziv-welch) compression method The LZW method to compress data is an evolution of the method originally created by Abraham Lempel and Jacob.
Lecture 4: Data Compression Techniques TSBK01 Image Coding and Data Compression Jörgen Ahlberg Div. of Sensor Technology Swedish Defence Research Agency.
CSE 589 Applied Algorithms Spring 1999
Web Graphics & Optimization
Data Coding Run Length Coding
Compression & Huffman Codes
Data Compression.
Information and Coding Theory
Applied Algorithmics - week7
Lempel-Ziv Compression Techniques
JPG vs GIF vs PNG What is the difference?
Introduction to Computer Science - Lecture 4
2D Drawing Basics 1.
Lempel-Ziv-Welch (LZW) Compression Algorithm
Chapter 7 Special Section
MED 2001 Advanced Media Production
Lempel-Ziv Compression Techniques
Graphic File Format Skill Area
COMS 161 Introduction to Computing
COMS 161 Introduction to Computing
GRAPHICAL DATA EXCHANGE FORMATS .jpg .gif .tif.
Chapter 7 Special Section
Chapter 8 – Compression Aims: Outline the objectives of compression.
CPS 296.3:Algorithms in the Real World
Presentation transcript:

Lecture 10: Dictionary Coding Thinh Nguyen Oregon State University

Outline LZ77 LZ78 LZW Applications

Review of Entropy Coding a 0.5 0.3 b 0.2 c source Minimize the number of bits to code a, b, c based on the statistical properties of the source

Dictionary Coding index pattern 1 a 2 b 3 ab … n abc Indices Encoder Encoder codes the index Indices Encoder Decoder Both encoder and decoder are assumed to have the same dictionary (table)

Ziv-Lempel Coding (ZL or LZ) Named after J. Ziv and A. Lempel (1977). Adaptive dictionary technique. Store previously coded symbols in a buffer. Search for the current sequence of symbols to code. If found, transmit buffer offset and length.

LZ77 8 3 d e 1 2 f Search buffer Look-ahead buffer a b c d e f 3 2 6 5 4 3 2 1 3 2 Output triplet <offset, length, next> 8 3 d e 1 2 f Transmitted to decoder: If the size of the search buffer is N and the size of the alphabet is M we need bits to code a triplet. PKZip, Zip, Lharc, PNG, gzip, ARJ Variation: Use a VLC to code the triplets!

Drawback with LZ77 Repetetive patterns with a period longer than the search buffer size are not found. If the search buffer size is 4, the sequence a b c d e a b c d e a b c d e a b c d e … will be expanded, not compressed.

LZ78 Store patterns in a dictionary Transmit a tuple <dictionary index, next>

LZ78 a b c 1 b 4 c Strategy needed for limiting dictionary size! a b c Output tuple <dictionary index, next> Transmitted to decoder: a b c 1 b 4 c Decoded: a b c a b a b c Dictionary: 1 a 2 b Strategy needed for limiting dictionary size! 3 c 4 a b 5 a b c

LZW Modification to LZ78 by Terry Welch, 1984. Applications: GIF, v42bis Patented by UniSys Corp. Transmit only the dictionary index. The alphabet is stored in the dictionary in advance.

LZW 1 2 3 5 5 a b c a b a b Input sequence: a b c Output: dictionary index Transmitted: Decoded: 1 2 3 5 5 a b c a b a b Encoder dictionary: Decoder dictionary: 1 a 6 bc 1 a 6 bc 2 b 7 ca 2 b 7 ca 3 c 8 aba 3 c 8 aba 4 d 9 abc 4 d 5 a b 5 a b

And now for some applications: GIF & PNG

GIF CompuServe Graphics Interchange Format (1987, 89). Features: Designed for up/downloading images to/from BBSes via PSTN. 1-, 4-, or 8-bit colour palettes. Interlace for progressive decoding (four passes, starts with every 8th row). Transparent colour for non-rectangular images. Supports multiple images in one file (”animated GIFs”).

GIF: Method Compression by LZW. Dictionary size 2b+1 8-bit symbols b is the number of bits in the palette. Dictionary size doubled if filled (max 4096). Works well on computer generated images.

GIF: Problems Unsuitable for natural images (photos): Maximum 256 colors () bad quality). Repetetive patterns uncommon () bad compression). LZW patented by UniSys Corp. Alternative: PNG

PNG: Portable Network Graphics Designed to replace GIF. Some features: Indexed or true-colour images (· 16 bits per plane). Alpha channel. Gamma information. Error detection. No support for multiple images in one file. Use MNG for that. Method: Compression by LZ77 using a 32KB search buffer. The LZ77 triplets are Huffman coded. More information: www.w3.org/TR/REC-png.html