Skip to content

codejet9/Huffman-File-Compressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Huffman-File-Compressor

  • C++ programs which can compress and extract the file using Huffman Coding - A lossless data compression using variable length codes. It is the most efficient algorithm for data compression.
  • The program encode.cpp needs the name of file as an argument. It will the compress the file using Huffman encoding algorithm and generate a new compressed file with .huf extension.
  • The program decode.cpp needs the name of compressed file with extension .huf. Optionally you can also give a second argument specifying the name of the decoded output file.
  • The compression ratios depend on the type of the input file.
  • For small files(order of bytes) it is not recommended to compress, because of fractional compression ratio. The compressed file occupies more space than input file.
  • In general, larger the input file sizes, better is the compression ratios. The compression ratios depend on the probabilities of source's data.

Executing the program on a sample text file

filecomp We can see that original file and file generated after decoding are same.

Here are the file sizes of all the three files(input file, compressed file, output file).

imput file properties compressed file properties output file properties

About

File compressor using huffman encoding

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages