Huffman Compression and Decompression

Completed Posted Oct 20, 2014 Paid on delivery
Completed Paid on delivery

This case study is about Huffman code trees what the code will do is file compression and decompression.

>> FINAL Required files: [login to view URL], [login to view URL], [login to view URL], [login to view URL], [login to view URL], [login to view URL], [login to view URL],

[login to view URL], [login to view URL], [login to view URL]

> compress infile outfile

When run, this program will read the contents of the file named by its first command line argument (infile),

construct a Huffman code for the contents of that file, and use that code to construct a compressed version which is written to a file named by the second command line

argument (outfile). The input file can contain any data (not just ASCII characters) so it should be treated as a binary file.

Your compress program must work for input files up to 10 megabytes in size, so a particular byte value may occur up to 10 million times in the file.

The second part :

> uncompress infile outfile

When run, this program will read the contents of the file named by its first command line argument,

which should be a file that has been created by the compress program. It will use the contents of that file to reconstruct the original,

uncompressed version, which is written to a file named by the second command line argument. In particular, for anyfile F,

after running compress F G uncompress G H it must be the case that the contents of F and H are identical.

Break the problem down:

1- compress program basically needs to go through these steps:

Open the input file for reading.

Read bytes from the file, counting the number of occurrences of each byte value; then close the file.

Use these byte counts to construct a Huffman coding tree.

Open the output file for writing.

Write enough information (a "file header") to the output file to enable the coding tree to be reconstructed when the file is read by your uncompress program.

Open the input file for reading, again.

Using the Huffman coding tree, translate each byte from the input file into its code, and append these codes as a sequence of bits to the output file, after the header.

Close the input and output files.

2- uncompress program should go through these basic steps:

Open the input file for reading.

Read the file header at the beginning of the input file, and reconstruct the Huffman coding tree.

Open the output file for writing.

Using the Huffman coding tree, decode the bits from the input file into the appropriate sequence of bytes, writing them to the output file.

Close the input and output files.

our programs must deal with:

Input files that will be MUCH larger than 1KB

Input files that are not restricted to text files (may be binary files)

Writing compressed files that are actually smaller than the input file.

C++ Programming

Project ID: #6617754

About the project

5 proposals Remote project Active Oct 21, 2014

Awarded to:

vano101

Hello. I have experience with this assignment, as far as I remember, there is some starter files, isn't it?

$45 USD in 2 days
(890 Reviews)
7.2

5 freelancers are bidding on average $187 for this job

PerennialWillow

A proposal has not yet been provided

$263 USD in 3 days
(16 Reviews)
5.3
mingzixian523

Hello, sir. I have enough experience in Huffman coding with C++ programming. I can do your task. Thanks. Regards.

$252 USD in 3 days
(19 Reviews)
4.5
ramiropolla

Oh, please let me do this one. Huffman coding is super fun =). I've worked with data compression on a bunch of different algorithms (specially audio/video for the FFmpeg Open-Source project) for many years.

$100 USD in 1 day
(4 Reviews)
2.9
nmlemus

I am proffesor of programming at University, the Huffman algorithm is a clasic algorithm in this area, I have many different version of this algoritm, so if you are interesting I can adapt one of those versions for you More

$277 USD in 3 days
(0 Reviews)
0.0