Code Monkey home page Code Monkey logo

huffman's Introduction

Huffman

This is a Haskell module to do Huffman coding. It is intended to be fairly generic and a good base for experimentation.

Included are file compression and decompression utilities that exercises the codebase. Performance is slower than but comparable to bzip2. On my home box (Intel Core 4) bzip2 takes 100ms to compress the text of Moby Dick, producing a 389KB file from a 1276KB original. My hencode utility takes 340ms to compress this file, producing a 740KB compressed file. Decompression with hdecode takes 190ms seconds, vs 40ms for bzip2.

The plan for this program was to enhance the Huffman code module such that it ccould be used as a basis for an implementation of inflate/deflate compression (RFC 1951), which is essentially Huffman coding plus LZ77 compression. This, in turn, can easily be wrapped into a ZLIB implementation (RFC1950), and will facilitate an implementation of the PNG image compression standard (RFC 2083 describes an earlier version).

However, it turned out that somebody had already implemented inflate/deflate in pure Haskell on hackage, which was cool. Work on the PNG implementation was abandoned long ago.

A good practical reference for Huffman coding tricks is Schindler's webpage. Adaptive Huffman coding also looks interesting.

License

This program is licensed under the "3-clause ('new') BSD License". Please see the file COPYING in this distribution for license terms.

huffman's People

Contributors

bartmassey avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.