Abdullah Aldahami (11074595) April 6, 2010 1. 2  Huffman Coding is a simple algorithm that generates a set of variable sized codes with the minimum average.

Slides:



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

Data Compression CS 147 Minh Nguyen.
Introduction to Computer Science 2 Lecture 7: Extended binary trees
Lecture 4 (week 2) Source Coding and Compression
Michael Alves, Patrick Dugan, Robert Daniels, Carlos Vicuna
Huffman code and ID3 Prof. Sin-Min Lee Department of Computer Science.
Greedy Algorithms Amihood Amir Bar-Ilan University.
Bounds on Code Length Theorem: Let l ∗ 1, l ∗ 2,..., l ∗ m be optimal codeword lengths for a source distribution p and a D-ary alphabet, and let L ∗ be.
SIMS-201 Compressing Information. 2  Overview Chapter 7: Compression Introduction Entropy Huffman coding Universal coding.
Huffman Encoding Dr. Bernard Chen Ph.D. University of Central Arkansas.
Data Compressor---Huffman Encoding and Decoding. Huffman Encoding Compression Typically, in files and messages, Each character requires 1 byte or 8 bits.
Lecture04 Data Compression.
Lecture 6: Huffman Code Thinh Nguyen Oregon State University.
2015/6/15VLC 2006 PART 1 Introduction on Video Coding StandardsVLC 2006 PART 1 Variable Length Coding  Information entropy  Huffman code vs. arithmetic.
Text Operations: Coding / Compression Methods. Text Compression Motivation –finding ways to represent the text in fewer bits –reducing costs associated.
A Data Compression Algorithm: Huffman Compression
DL Compression – Beeri/Feitelson1 Compression דחיסה Introduction Information theory Text compression IL compression.
Information Theory Eighteenth Meeting. A Communication Model Messages are produced by a source transmitted over a channel to the destination. encoded.
Chapter 9: Huffman Codes
Fundamentals of Multimedia Chapter 7 Lossless Compression Algorithms Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
2015/7/12VLC 2008 PART 1 Introduction on Video Coding StandardsVLC 2008 PART 1 Variable Length Coding  Information entropy  Huffman code vs. arithmetic.
CSI Uncertainty in A.I. Lecture 201 Basic Information Theory Review Measuring the uncertainty of an event Measuring the uncertainty in a probability.
Information Theory and Security
Data Compression Basics & Huffman Coding
Data Compression Gabriel Laden CS146 – Dr. Sin-Min Lee Spring 2004.
Huffman Codes Message consisting of five characters: a, b, c, d,e
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.
Information and Coding Theory
Algorithm Design & Analysis – CS632 Group Project Group Members Bijay Nepal James Hansen-Quartey Winter
Huffman Codes. Encoding messages  Encode a message composed of a string of characters  Codes used by computer systems  ASCII uses 8 bits per character.
Huffman Encoding Veronica Morales.
Lecture Objectives  To learn how to use a Huffman tree to encode characters using fewer bytes than ASCII or Unicode, resulting in smaller files and reduced.
Huffman Coding Dr. Ying Lu RAIK 283 Data Structures & Algorithms.
Compression.  Compression ratio: how much is the size reduced?  Symmetric/asymmetric: time difference to compress, decompress?  Lossless; lossy: any.
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:
Introduction to Algorithms Chapter 16: Greedy Algorithms.
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part 8. Greedy Algorithms.
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.
Outline Transmitters (Chapters 3 and 4, Source Coding and Modulation) (week 1 and 2) Receivers (Chapter 5) (week 3 and 4) Received Signal Synchronization.
Lecture 4: Lossless Compression(1) Hongli Luo Fall 2011.
CS654: Digital Image Analysis Lecture 34: Different Coding Techniques.
Huffman’s Algorithm 11/02/ Weighted 2-tree A weighted 2-tree T is an extended binary tree with n external nodes and each of the external nodes is.
Foundation of Computing Systems
Bahareh Sarrafzadeh 6111 Fall 2009
Lossless Decomposition and Huffman Codes Sophia Soohoo CS 157B.
1 Data Compression Hae-sun Jung CS146 Dr. Sin-Min Lee Spring 2004.
بسم الله الرحمن الرحيم My Project Huffman Code. Introduction Introduction Encoding And Decoding Encoding And Decoding Applications Applications Advantages.
Compression techniques Adaptive and non-adaptive.
ECE 101 An Introduction to Information Technology Information Coding.
Huffman Coding (2 nd Method). Huffman coding (2 nd Method)  The Huffman code is a source code. Here word length of the code word approaches the fundamental.
Lossless Compression-Statistical Model Lossless Compression One important to note about entropy is that, unlike the thermodynamic measure of entropy,
UNIT I. Entropy and Uncertainty Entropy is the irreducible complexity below which a signal cannot be compressed. Entropy is the irreducible complexity.
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.
Information theory Data compression perspective Pasi Fränti
Design & Analysis of Algorithm Huffman Coding
EE465: Introduction to Digital Image Processing
Assignment 6: Huffman Code Generation
Data Compression.
Chapter 5. Greedy Algorithms
Data Compression.
Data Compression CS 147 Minh Nguyen.
Context-based Data Compression
Chapter 8 – Binary Search Tree
Chapter 9: Huffman Codes
Chapter 11 Data Compression
Algorithms CSCI 235, Spring 2019 Lecture 31 Huffman Codes
Presentation transcript:

Abdullah Aldahami ( ) April 6,

2  Huffman Coding is a simple algorithm that generates a set of variable sized codes with the minimum average size.  Huffman codes are part of several data formats as ZIP, MPEG and JPEG.  The code is generated based on the estimated probability of occurrence.  Huffman coding works by creating an optimal binary tree of nodes, that can be stored in a regular array.

3  The method starts by building a list of all the alphabet symbols in descending order of their probabilities (frequency of appearance).  It then construct a tree from bottom to top.  Step by step, the two symbols with the smallest probabilities are selected; added to the top.  When the tree is completed, the codes of the symbols are assigned.

4  Example: circuit elements in digital computations  Summation of frequencies (Number of events) is 40 CharacterFrequency i6 t5 space4 c3 e3 n3 u2 l2 CharacterFrequency m2 s2 a2 o2 r1 d1 g1 p1

5  Example: circuit elements in digital computations r1d1g1p1 2 u2l2m2 2 a2o2s c3e3n3‘ 4 7 t5 7 i

6  So, the code will be generated as follows: CharacterFrequencyCode Length Total Length i t space c e n u l CharacterFrequencyCode Length Total Length m s a o r d g p  Total is 154 bits with Huffman Coding compared to 240 bits with no compression

7 Input Symbol it‘ ’cenul Probability P(x) Output Code Code length (in bits) (L i ) Weighted path length L i ×P(x) Optimality Probability budget (2 -L i ) 1/8 1/16 1/81/32 Information of a Message I(x) = – log 2 P(x) Entropy H(x) =-P(x) log 2 P(x) Entropy is a measure defined in information theory that quantifies the information of an information source. The measure entropy gives an impression about the success of a data compression process.

8 Input Symbol msaordgp Sum Probability P(x) = 1 Output Code Code length (in bits) (L i ) Weighted path length L i ×P(x) Optimality Probability budget (2 -L i ) 1/321/16 1/64 1/32 = 1 Information of a Message I(x) = – log 2 P(x) Entropy H(x) =-P(x) log 2 P(x) Bit/sym The sum of the probability budgets across all symbols is always less than or equal to one. In this example, the sum is equal to one; as a result, the code is termed a complete code. Huffman coding approaches the optimum on 98.36% = (3.787 / 3.85) *100

9  Static probability distribution (Static Huffman Coding)  Coding procedures with static Huffman codes operate with a predefined code tree, previously defined for any type of data and is independent from the particular contents.  The primary problem of a static, predefined code tree arises, if the real probability distribution strongly differs from the assumptions. In this case the compression rate decreases drastically.

10  Adaptive probability distribution (Adaptive Huffman Coding)  The adaptive coding procedure uses a code tree that is permanently adapted to the previously encoded or decoded data.  Starting with an empty tree or a standard distribution.  This variant is characterized by its minimum requirements for header data, but the attainable compression rate is unfavourable at the beginning of the coding or for small files.

11