-
Notifications
You must be signed in to change notification settings - Fork 9
Home
Yue Wang edited this page May 5, 2015
·
13 revisions
Welcome to the Compression wiki!
- Using
std::map<Char, Freq>
as frequency table. - Note : move to frequency map , huffman tree not tested yet.
- class
Encoder
: read a file and build a vector to hold content, for now just limited characters. - class
BitString
: a sequential container to store data in bits, push back only. - protocol :
FrequencyTable|CompressedPart|Remainder
-->
FrequencyTable|CompressedPart|Remainder|RemainderSize
So the last bits that less than 8 should be append to Remainder
part without compressing.
- 2 4 (8) 12 16
- Design for Version II
- Read file
char
bychar
and save all data as an largeBitString
. - Split the
BitString
object into anunsigned[]
, based on the size specified, like 1, 2, 3..16. - Construct a
FrqMap<unsigned int, FreqType>
using theunsigned[]
. - Construct a
HuffmanTree
using theFrqMap
. - Construct a
CodeMap
usingHuffmanTree
. - Traverse the
unsigned[]
with looking upCodeMap
and save the resulted into an outputBitString
. - Split the output
BitString
intochar[]
. - Output the
char[]
as the compressed file.