Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 4 - Huffman Trees (Part 1)
Date: Sun Oct 7 2001 9:55 pm
Author: Liu, Limin Angela <laliu@andrew.cmu.edu>
Subject: Re: remaining bits

I used a counter and kept it under or equal to 8. At the end of my reading of the text file, I looked at my counter, and added zero bits into the rest bits that are not filling my byte. At the end, I wrote my counter into the bitstream as the last byte.

When I read my compressed file for decompressing, I saved the last two bytes, and used my last byte, which is just my counter, to tell me how to interpret the second last byte, which has zero's that should be thrown away. The only caution is that you have to keep the bits that are not found in the tree yet at the third last byte. Then you can combine those bits and finish searching.

There might be more intelligent ways of doing this. I am intersted in knowing other people's methods.
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
remaining bits      Douglas, Keith      Sun Oct 7 2001 8:48 pm       
Re: remaining bits      Liu, Limin Angela      Sun Oct 7 2001 9:55 pm       
Re: remaining bits      Bortz, Andrew S.      Sun Oct 7 2001 10:12 pm       
Re: remaining bits      Lee, Charles C.      Sun Oct 7 2001 11:44 pm       
Re: remaining bits      Cipriani, Jason A.      Mon Oct 8 2001 3:44 pm       
Re: remaining bits      Jen, Cindy Dar-Shuan      Tue Oct 9 2001 2:30 am       
Re: remaining bits      Bortz, Andrew S.      Tue Oct 9 2001 12:26 pm       
Re: remaining bits      Cipriani, Jason A.      Wed Oct 10 2001 12:51 am       
Re: remaining bits      Abeles, Peter J.      Wed Oct 10 2001 12:26 am       
Re: remaining bits      Ghosh, Debmallo S.      Thu Oct 11 2001 1:45 pm       
Re: remaining bits      Cipriani, Jason A.      Mon Oct 8 2001 3:46 pm       
Re: remaining bits      Lee, Charles C.      Wed Oct 10 2001 12:46 am       
Re: remaining bits      Cipriani, Jason A.      Wed Oct 10 2001 12:56 am       
Re: remaining bits      Lee, Charles C.      Wed Oct 10 2001 5:04 pm       

Back to previous screen