Huffman encoding and decoding
This presentation is the property of its rightful owner.
Sponsored Links
1 / 12

Huffman Encoding and Decoding PowerPoint PPT Presentation


  • 59 Views
  • Uploaded on
  • Presentation posted in: General

Huffman Encoding and Decoding. Sarker Tanveer Ahmed Rumee (1000672838) Md. Abdus Salam (1000667054). Outline. Problem definition The Huffman Algorithm Analysis of the Algorithm Implementation Results Conclusion. Problem Definition. Take a text file as input Encode it so that-

Download Presentation

Huffman Encoding and Decoding

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Huffman encoding and decoding

Huffman Encoding and Decoding

SarkerTanveer Ahmed Rumee (1000672838)

Md. Abdus Salam (1000667054)


Outline

Outline

  • Problem definition

  • The Huffman Algorithm

  • Analysis of the Algorithm

  • Implementation

  • Results

  • Conclusion


Problem definition

Problem Definition

  • Take a text file as input

  • Encode it so that-

    • Less space is used to store the characters of this text

    • No information is lost- we can reconstruct the original text


Huffman algorithm

Huffman Algorithm

  • Data Structure used: Priority queue = QHuffman (c)n = |c|Q = cfori =1  to   n-1do   z = Allocate-Node ()             x = left[z] = EXTRACT_MIN(Q)             y = right[z] = EXTRACT_MIN(Q)            f[z] = f[x] + f[y]            INSERT (Q, z)return EXTRACT_MIN(Q)


Analysis of the algorithm

Analysis of the Algorithm

  • Q implemented as a binary heap.

  • line 2 can be performed by using BUILD-HEAP in O(n) time.

  • FOR loop executed |n| - 1 times and since each heap operation requires O(lg n) time. => the FOR loop contributes (|n| - 1) O(lg n) => O(n lg n)

  • Thus the total running timeof Huffman on the set of n characters is O(nlg n).


Implementation

Implementation

  • PLATFORM : Microsoft windows 9x,NT,2000,XP

  • PROGAMMAING LANGUAGE : Java (J2SE)

  • PROGRAMMING TOOL : Eclipse and NetBeans IDE

  • Code implemented has two module:

    • Encode (Compress) the input text/file.

    • Decode (Decompress) the encoded file.


Results

Results

  • Performance criteria

    • Compression Ratio (CR)

      The ratio is calculated using the following formula:

      CR = (Input File Size - Compressed File Size/Input File Size) * 100.0

    • We also show the top 12 most frequent characters found in the original input file and then match with ETAOIN SHRDLU – which is the 12 most frequent characters (sorted from highest to lowest frequencies) in English language. (Most commonly in newspapers)


Performance of huffman algorithm over various inputs

Performance of Huffman Algorithm over various inputs


Comparison with other efficient compression softwares

Comparison with other efficient compression softwares

NB :Values in the table indicate compression Ratio


Conclusion

Conclusion

  • In the end, Huffman Algorithm is a good base to understand how the compression algorithm works.

  • For data compression more sophisticated techniques are available now.

  • Huffman algorithm can be modified to perform image compression.


Huffman encoding and decoding

Thank You


Huffman encoding and decoding

Questions ??


  • Login