Git Product home page Git Product logo

huffman-compression's Introduction

Huffman-Compression

Author: Wilson Giese - [email protected]

###About A compression program that uses Huffman Coding to compress a given file. It will also decompress the files that were compressed with this algorithm. However, this program will not compress a file if the result is larger than the original, unless forced otherwise. Very small files, or files with well distributed characters will usually be smaller than the compressed file.

Usage info

-c  Compress
-u  Uncompress
-v* Verbose; Prints a table with frequency and codes for each ascii in the 
    file(-c only), and a visual representation of the Huffman Tree. 
-f* Force; Forces compression even if the encoded file will be larger than 
    the non-encoded file. 

* optional flag

Usage examples

java -cp HCompress.jar Huffman -c -v -f path/To/InputFile   path/To/EncodedFile
java -cp HCompress.jar Huffman -u -v    path/To/EncodedFile path/To/DecodedFile

Unbuffered/Buffered time comparisons

Test System: 2.66 GHz Intel Core i7 with 8GB 1067 MHz DDR3

Unbuffered Test on 4940645B file: 
COMPRESS:           DECOMPRESS:  
[1] 5008ms          [1] 2693ms
[2] 5133ms          [2] 2694ms
[3] 5536ms          [3] 2787ms
[4] 5168ms          [4] 2719ms
[5] 5335ms          [5] 2777ms

Buffered Test on 4940645B file: BUFFER_SIZE = 4096B
[1] 472ms           [1] 332ms
[2] 462ms           [2] 293ms
[3] 459ms           [3] 304ms
[4] 462ms           [4] 327ms	
[5] 457ms           [5] 302ms

Buffered Test on 4940645B file: BUFFER_SIZE = 2048B
[1] 466ms           [1] 315ms
[2] 463ms           [2] 364ms
[3] 465ms           [3] 355ms	
[4] 470ms           [4] 351ms
[5] 466ms           [5] 332ms

huffman-compression's People

Contributors

wilsongiese avatar

Watchers

James Cloos avatar  avatar

Forkers

mhe10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.