Quote:
Originally posted by john_tran
Oh, I knew how LZW does, but i dont know how to write it in C++, because of bits as i mentioned.
what techs i do when i break bits. Such as :
Put 12 bit of a 12bit-number (A) and concatenate 4bit of the next 12bit-number (B) into 2 bytes and write it to file, and then put 8bit remaining of 12bit-number (B) and concatenate 8bit of the next 12bit-number (C) into 2 bytes and write it to file. After then, i continue put 4bit remaining of 12bit-number (C) and concatenate 12bit of the next 12bit-number (E) into 2 bytes and write it to file. So on, just repeat the loop if i want to add more.
But How i can do that in C++, what functions or technologies i have to learn?
Thanks for reply.
|
You have to learn the ways of shifting like Joe mentioned:
>> , <<
And masking might come in handy: &
I am not so good with this myself. Sorry.