CSc 461/561 CSc 461/561 Multimedia Systems Part B: 1. Lossless Compression.

Slides:



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

Huffman code and ID3 Prof. Sin-Min Lee Department of Computer Science.
Source Coding Data Compression A.J. Han Vinck. DATA COMPRESSION NO LOSS of information and exact reproduction (low compression ratio 1:4) general problem.
Problem: Huffman Coding Def: binary character code = assignment of binary strings to characters e.g. ASCII code A = B = C =
Image Compression, Transform Coding & the Haar Transform 4c8 – Dr. David Corrigan.
Lecture04 Data Compression.
Compression & Huffman Codes
School of Computing Science Simon Fraser University
SWE 423: Multimedia Systems
Optimal Merging Of Runs
Department of Computer Engineering University of California at Santa Cruz Data Compression (1) Hai Tao.
SWE 423: Multimedia Systems Chapter 7: Data Compression (2)
A Data Compression Algorithm: Huffman Compression
Compression & Huffman Codes Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Data Compression Basics
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 Compression - I Hao Jiang Computer Science Department Sept. 13, 2007.
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.
1 Lossless Compression Multimedia Systems (Module 2) r Lesson 1: m Minimum Redundancy Coding based on Information Theory: Shannon-Fano Coding Huffman Coding.
Basics of Compression Goals: to understand how image/audio/video signals are compressed to save storage and increase transmission efficiency to understand.
Huffman Coding Vida Movahedi October Contents A simple example Definitions Huffman Coding Algorithm Image Compression.
8. Compression. 2 Video and Audio Compression Video and Audio files are very large. Unless we develop and maintain very high bandwidth networks (Gigabytes.
Chapter 2 Source Coding (part 2)
15-853Page :Algorithms in the Real World Data Compression II Arithmetic Coding – Integer implementation Applications of Probability Coding – Run.
Source Coding-Compression
296.3Page 1 CPS 296.3:Algorithms in the Real World Data Compression: Lecture 2.5.
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.
1 Analysis of Algorithms Chapter - 08 Data Compression.
CMPT 365 Multimedia Systems
Prof. Amr Goneid Department of Computer Science & Engineering
Multimedia Specification Design and Production 2012 / Semester 1 / L3 Lecturer: Dr. Nikos Gazepidis
Image Compression (Chapter 8) CSC 446 Lecturer: Nada ALZaben.
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.
File Compression Techniques Alex Robertson. Outline History Lossless vs Lossy Basics Huffman Coding Getting Advanced Lossy Explained Limitations Future.
Lossless Compression CIS 465 Multimedia. Compression Compression: the process of coding that will effectively reduce the total number of bits needed to.
Image Compression – Fundamentals and Lossless Compression Techniques
Huffman coding Content 1 Encoding and decoding messages Fixed-length coding Variable-length coding 2 Huffman coding.
Huffman Code and Data Decomposition Pranav Shah CS157B.
Lecture 4: Lossless Compression(1) Hongli Luo Fall 2011.
CS654: Digital Image Analysis Lecture 34: Different Coding Techniques.
Digital Image Processing Lecture 22: Image Compression
Lossless Compression(2)
Multi-media Data compression
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.
Index construction: Compression of documents Paolo Ferragina Dipartimento di Informatica Università di Pisa Reading Managing-Gigabytes: pg 21-36, 52-56,
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 7 – Basics of Compression (Part 2) Klara Nahrstedt Spring 2012.
Images. Audio. Cryptography - Steganography MultiMedia Compression } Movies.
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.
Prof. Paolo Ferragina, Algoritmi per "Information Retrieval" Basics
Huffman code and Lossless Decomposition Prof. Sin-Min Lee Department of Computer Science.
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.
IS502:M ULTIMEDIA D ESIGN FOR I NFORMATION S YSTEM M ULTIMEDIA OF D ATA C OMPRESSION Presenter Name: Mahmood A.Moneim Supervised By: Prof. Hesham A.Hefny.
Lossless Compression-Statistical Model Lossless Compression One important to note about entropy is that, unlike the thermodynamic measure of entropy,
Chapter 7 Lossless Compression Algorithms
Information Theory Information Suppose that we have the source alphabet of q symbols s 1, s 2,.., s q, each with its probability p(s i )=p i. How much.
Data Compression: Huffman Coding in Weiss (p.389)
Compression & Huffman Codes
Digital Image Processing Lecture 20: Image Compression May 16, 2005
CSI-447: Multimedia Systems
Increasing Information per Bit
Algorithms in the Real World
Huffman Coding, Arithmetic Coding, and JBIG2
Optimal Merging Of Runs
Why Compress? To reduce the volume of data to be transmitted (text, fax, images) To reduce the bandwidth required for transmission and to reduce storage.
Optimal Merging Of Runs
Chapter 11 Data Compression
Data Compression.
Presentation transcript:

CSc 461/561 CSc 461/561 Multimedia Systems Part B: 1. Lossless Compression

CSc 461/561 Summary (1) Information (2) Types of compression (3) Lossless compression algorithms (a)Shannon-Fano Algorithm (b)Huffman coding (c)Run-length coding (d)LZW compression (e)Arithmetic Coding (4) Example: Lossless image compression

CSc 461/ Information (1) Information is decided by three parts: The source The receiver The delivery channel We need a way to measure information: Entropy: a measure of uncertainty; min bits –alphabet set {s 1, s 2, …, s n } –probability {p 1, p 2, …, p n } –entropy: - p 1 log 2 p 1 - p 2 log 2 p 2 - … - p n log 2 p n

CSc 461/ Entropy examples (2) Alphabet set {0, 1} Probability: {p, 1-p} Entropy: H = - p log 2 p - (1-p) log 2 (1-p) –when p=0, H=0 –when p=1, H=0 –when p=1/2, H max =1 1 bit is enough!

CSc 461/ Types of compression (1) Lossless compression: no information loss Lossy compression: otherwise

CSc 461/ Compression Ratio (2) Compression ratio –B 0 : # of bits to represent before compression –B 1 : # of bits to represent after compression –compression ratio = B 0 /B 1

CSc 461/ Shannon-Fano algorithm (1) Fewer bits for symbols appear more often “divide-and-conquer” –also known as “top-down” approach –split alphabet set into subsets of (roughly) equal probabilities; do it recursively –similar to building a binary tree

CSc 461/ Shannon-Fano: examples (2)

CSc 461/ Shannon-Fano: results (3) Prefix-free code –no code is a prefix of other codes –easy to decode

CSc 461/ Shannon-Fano: more results (4) Encoding is not unique –roughly equal Encoding 2 Encoding 1

CSc 461/ Huffman coding (1) “Bottom-up” approach –also build a binary tree and know alphabet probability! –start with two symbols of the least probability s 1 : p 1 s 2 : p 2 s 1 or s 2 : p 1 +p 2 –do it recursively

CSc 461/ Huffman coding: examples (2) Encoding not unique; prefix-free code Optimality: H(S) <= L < H(S)+1 a2 (0.4) a1(0.2) a3(0.2) a4(0.1) a5(0.1) Sort 0.2 combineSort combine Sort combine Sort 1 combine Assign code

CSc 461/ Run-length coding Run: a string of the same symbol Example –input: AAABBCCCCCCCCCAA –output: A3B2C9A2 –compression ratio = 16/8 = 2 Good for some inputs (with long runs) –bad for others: ABCABC –how about to treat ABC as an alphabet?

CSc 461/ LZW compression (1) Lempel-Ziv-Welch (LZ77, W84) –Dictionary-based compression –no a priori knowledge on alphabet probability –build the dictionary on-the-fly –used widely: e.g., Unix compress LZW coding –if a word does not appear in the dictionary, add it –refer to the dictionary when the word appears again

CSc 461/ LZW examples (2) Input –ABABBABCABABBA Output –

CSc 461/ Arithmetic Coding (1) Arithmetic coding determines a model of the data -- basically a prediction of what patterns will be found in the symbols of the message. The more accurate this prediction is, the closer to optimality the output will be. Arithmetic coding treats the whole message as one unit.

CSc 461/ Arithmetic Coding (2)

CSc 461/ Arithmetic Coding (3)

CSc 461/ Arithmetic Coding (4)

CSc 461/ Arithmetic Coding (5)

CSc 461/ Lossless Image Compression (1)

CSc 461/ Lossless Image Compression (2)

CSc 461/ Lossless JPEG NNeighboring Pixels for Predictors in Lossless JPEG NeighPredictors for Lossless JPEG