Multimedia Data Introduction to Lossless Data Compression Dr Sandra I. Woolley Electronic, Electrical.

Slides:



Advertisements
Similar presentations
15-583:Algorithms in the Real World
Advertisements

Data Compression CS 147 Minh Nguyen.
Lecture 4 (week 2) Source Coding and Compression
Multimedia Data Introduction to Lossless Data Compression Dr Mike Spann Electronic, Electrical and.
Michael Alves, Patrick Dugan, Robert Daniels, Carlos Vicuna
SIMS-201 Compressing Information. 2  Overview Chapter 7: Compression Introduction Entropy Huffman coding Universal coding.
CPSC 335 Compression and Huffman Coding Dr. Marina Gavrilova Computer Science University of Calgary Canada.
Algorithms for Data Compression
Image Compression, Transform Coding & the Haar Transform 4c8 – Dr. David Corrigan.
Data Compression Michael J. Watts
Lecture04 Data Compression.
Compression & Huffman Codes
1 Huffman Codes. 2 Introduction Huffman codes are a very effective technique for compressing data; savings of 20% to 90% are typical, depending on the.
Lecture 6: Huffman Code Thinh Nguyen Oregon State University.
SWE 423: Multimedia Systems
A Data Compression Algorithm: Huffman Compression
Lempel-Ziv-Welch (LZW) Compression Algorithm
Document and Query Forms Chapter 2. 2 Document & Query Forms Q 1. What is a document? A document is a stored data record in any form A document is a stored.
Chapter 9: Huffman Codes
Lecture 4 Source Coding and Compression Dr.-Ing. Khaled Shawky Hassan
Fundamentals of Multimedia Chapter 7 Lossless Compression Algorithms Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
Lossless Data Compression Using run-length and Huffman Compression pages
Source Coding Hafiz Malik Dept. of Electrical & Computer Engineering The University of Michigan-Dearborn
Data Compression Basics & Huffman Coding
1 Lossless Compression Multimedia Systems (Module 2) r Lesson 1: m Minimum Redundancy Coding based on Information Theory: Shannon-Fano Coding Huffman Coding.
Data dan Teknologi Multimedia Sesi 08 Nofriyadi Nurdam.
Lossless Compression Multimedia Systems (Module 2 Lesson 3)
Spring 2015 Mathematics in Management Science Binary Linear Codes Two Examples.
Management Information Systems Lection 06 Archiving information CLARK UNIVERSITY College of Professional and Continuing Education (COPACE)
Lecture 10 Data Compression.
Algorithm Design & Analysis – CS632 Group Project Group Members Bijay Nepal James Hansen-Quartey Winter
1 Lossless Compression Multimedia Systems (Module 2 Lesson 2) Summary:  Adaptive Coding  Adaptive Huffman Coding Sibling Property Update Algorithm 
Information and Coding Theory Heuristic data compression codes. Lempel- Ziv encoding. Burrows-Wheeler transform. Juris Viksna, 2015.
Page 110/6/2015 CSE 40373/60373: Multimedia Systems So far  Audio (scalar values with time), image (2-D data) and video (2-D with time)  Higher fidelity.
Compression.  Compression ratio: how much is the size reduced?  Symmetric/asymmetric: time difference to compress, decompress?  Lossless; lossy: any.
1 Source Coding and Compression Dr.-Ing. Khaled Shawky Hassan Room: C3-222, ext: 1204, Lecture 5.
1 Classification of Compression Methods. 2 Data Compression  A means of reducing the size of blocks of data by removing  Unused material: e.g.) silence.
Addressing Image Compression Techniques on current Internet Technologies By: Eduardo J. Moreira & Onyeka Ezenwoye CIS-6931 Term Paper.
Lossless Compression CIS 465 Multimedia. Compression Compression: the process of coding that will effectively reduce the total number of bits needed to.
COMPRESSION. Compression in General: Why Compress? So Many Bits, So Little Time (Space) CD audio rate: 2 * 2 * 8 * = 1,411,200 bps CD audio storage:
Huffman Codes Juan A. Rodriguez CS 326 5/13/2003.
CS654: Digital Image Analysis Lecture 34: Different Coding Techniques.
Bahareh Sarrafzadeh 6111 Fall 2009
Lossless Compression(2)
Lossless Decomposition and Huffman Codes Sophia Soohoo CS 157B.
Lempel-Ziv-Welch Compression
1 Data Compression Hae-sun Jung CS146 Dr. Sin-Min Lee Spring 2004.
Chapter 7 Lossless Compression Algorithms 7.1 Introduction 7.2 Basics of Information Theory 7.3 Run-Length Coding 7.4 Variable-Length Coding (VLC) 7.5.
Lecture 12 Huffman Algorithm. In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly.
بسم الله الرحمن الرحيم My Project Huffman Code. Introduction Introduction Encoding And Decoding Encoding And Decoding Applications Applications Advantages.
Compression techniques Adaptive and non-adaptive.
Page 1KUT Graduate Course Data Compression Jun-Ki Min.
Prof. Paolo Ferragina, Algoritmi per "Information Retrieval" Basics
Lampel ZIV (LZ) code The Lempel-Ziv algorithm is a variable-to-fixed length code Basically, there are two versions of the algorithm LZ77 and LZ78 are the.
Compression and Huffman Coding. Compression Reducing the memory required to store some information. Lossless compression vs lossy compression Lossless.
Lossless Compression-Statistical Model Lossless Compression One important to note about entropy is that, unlike the thermodynamic measure of entropy,
Submitted To-: Submitted By-: Mrs.Sushma Rani (HOD) Aashish Kr. Goyal (IT-7th) Deepak Soni (IT-8 th )
Data Compression Michael J. Watts
Design & Analysis of Algorithm Huffman Coding
HUFFMAN CODES.
Data Coding Run Length Coding
Compression & Huffman Codes
Data Compression.
Data Compression.
Applied Algorithmics - week7
Lempel-Ziv-Welch (LZW) Compression Algorithm
Chapter 9: Huffman Codes
Chapter 11 Data Compression
Huffman Coding CSE 373 Data Structures.
Presentation transcript:

Multimedia Data Introduction to Lossless Data Compression Dr Sandra I. Woolley Electronic, Electrical and Computer Engineering

Lossless Compression An introduction to lossless compression methods including:-  Run-length coding  Huffman coding  Lempel-Ziv

Run-Length Coding (Reminder) Run-length coding is a very simple example of lossless data compression. Consider the repeated pixels values in an image … compresses to (12,0)(4,5)(8,0) 24 bytes reduced to 6 gives a compression ratio of 24/6 = 4:1  As we noted earlier, there must be an agreement between sending compressor and receiving decompressor on the format of the compressed stream which could be (count, value) or (value, count).  We also noted that a source without runs of repeated symbols would expand using this method.

Patent Issues There is a long history of patent issues in the field of data compression. Even run length coding is patented. From the comp.compression faq : Tsukiyama has two patents on run length encoding: 4,586,027 and 4,872,009 granted in 1986 and 1989 respectively. The first one covers run length encoding in its most primitive form: a length byte followed by the repeated byte. The second patent covers the 'invention' of limiting the run length to 16 bytes and thus the encoding of the length on 4 bits. Here is the start of claim 1 of patent 4,872,009, just for interest: “A method of transforming an input data string comprising a plurality of data bytes, said plurality including portions of a plurality of consecutive data bytes identical to one another, wherein said data bytes may be of a plurality of types, each type representing different information, said method comprising the steps of: [...]”

Huffman Compression  Source character frequency statistics are used to allocate codewords for output.  Compression can be achieved by allocating shorter codewords to the more frequently occurring characters. For example, in Morse code E= Y= - - -).

Huffman Compression  By arranging the source alphabet in descending order of probability, then repeatedly adding the two lowest probabilities and resorting, a Huffman tree can be generated.  The resultant codewords are formed by tracing the tree path from the root node to the codeword leaf.  Rewriting the table as a tree, 0s and 1s are assigned to the branches. The codewords for each symbols are simply constructed by following the path to their nodes.

Huffman Compression

Is That All There is to it?  David Huffman invented this method in 1951 while a graduate student of Robert Fano. He did not invent the idea of a coding tree. His insight was that by assigning the probabilities of the longest codes first and then proceeding along the branches of the tree toward the root, he could arrive at an optimal solution every time.  Fano and Shannon had tried to work the problem in the opposite direction, from the root to the leaves, a less efficient solution.  When presented with his student's discovery, Huffman recalls, Fano is said to have exclaimed: "Is that all there is to it!" From the September 1991 issue of Scientific American, pp. 54, 58. Top right – Original figures from IRE Proc. Sept 1952

Huffman Compression Questions:  What is meant by the ‘prefix property’ of Huffman?  What types of sources would Huffman compress well and what types would it compress inefficiently?  How would it perform on images or graphics?

Static and Adaptive Compression  Compression algorithms remove source redundancy by using some definition (model) of the source characteristics.  Compression algorithms which use a pre-defined source model are static.  Algorithms which use the data itself to fully or partially define this model are referred to as adaptive.  Static implementations can achieve very good compression ratios for well defined sources.  Adaptive algorithms are more versatile, and update their source models according to current characteristics. However, they have lower compression performance, at least until a suitable model is properly generated.

Lempel-Ziv Compression  Lempel-Ziv published mathematical journal papers in 1977 and 1978 on two compression algorithms (these are often abbreviated as LZ’77 and LZ’78)  Welch popularised them in1984  LZW was implemented in many popular compression methods including.GIF image compression.  It is lossless and universal (adaptive)  It exploits string-based redundancy  It is not good for image compression (why?)

Lempel-Ziv Dictionaries How they work :-  Parse data character by character generating a dictionary of previously seen strings  LZ’77 uses a sliding window dictionary  LZ’78 uses a full dictionary history LZ’78 Description  With a source of 8-bits/character (i.e., source values of ) Extra characters will be needed to describe strings for in our dictionary. So we will need more than 8 bits.  Start with output using 9-bits. So now we can use values from  We will need to reserve some characters for ‘special codewords’ say, , so dictionary entries would begin at 263.  We can refer to dictionary entries as D1, D2, D3 etc. (equivalent to 263, 264, 265 etc.)  Dictionaries typically grow to 12- and 15-bit lengths.

Lempel-Ziv … continued So the compressed output is “THE RE ES”.  Each of these 10 output codewords is represented using 9 bits.  So the compressed output uses 90 bits. Calculating the compression ratio The original source contains 13x8-bit characters (=104 bits) and the compressed output contains 10x9-bit codewords (=90 bits).  So the compression ratio = (old size/new size):1 = 1.156:1  So some compression was achieved. Despite the fact that this simple implementation of Lempel-Ziv would normally start by expanding the data, this example has achieved compression. This was because the compressed string was particularly high in repeating strings, which is exactly the type of redundancy the method exploits.

Lempel-Ziv Exercises  How is decompression performed? Does the dictionary need to be sent?  Using the source output from our example, build a dictionary and decompress the source.  Compress the strings “rintintin” and “less  loss  less  lossless” (using “  ” to represent the space character).  Decompress the string “WHERE  T Y  N” (“  ” represents the space character).  Now compress the string “WHERE  THEY  HERE  THEN” (using “  ” to represent the space character).  Only for the very keen …. What is the “LZ exception”? (an example can be found at

 This concludes our introduction to selected lossless compression.  You can find course information, including slides and supporting resources, on-line on the course web page at Thank You