|
Flattening What is flattening? What is data flattening has to do with data compression? Flattening is used to eliminate one or more ASCII values in the file, so the file will become more compress-able. This method is similar to shuffling; the only different is this one adds one or more bytes to the file while shuffling is not using any additional byte. These additional bytes make the result file bigger than the original size but with less ASCII values. So, if the result file is bigger then what is this good for? Good question, that's why I keep searching for a way that can reduce the total ASCII used with less or no addition byte. So far the additional bytes required for this method is little big too much, we can't compress the result with other compression methods to get smaller size than the original file size. Which ASCII we should eliminate? So far, I found there is no specific ASCII need to be eliminated to get a better compression ratio. At the moment I just eliminate the higher ASCII value, so hopefully each ASCII only requires 7 bits instead of 8 bits. Maybe with more research we can determine which ASCII should be eliminated. There are many ways to eliminate ASCII, one of the examples is to divide ASCII into two sides, small (0-127) and big (128-255) then we eliminate the big side so the result only has small ASCII (0-127), we have to reduce the big by 128 so then they will become small (0-127). Every byte requires one bit for Flag and we need one byte (8 bits) for every 7 bytes for Flag (needed for decoding later). Why one byte (8 bits) for every 7 bytes? Because we want the Flag Value to be small (0-127) as well. If big then Flag is 1 and Flag Value is (2 ^ (Location - 1)), if small Flag is 0 and Flag Value is 0. Encoding:
In this example the resulted Flag Value is 86, we put this value in front
of every 7 bytes. Decoding:
I tried to explain this in stupid-proof way, but still if there is confusion
just contact me, like always, |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author
Site Map Disclaimer
HMaxF Ultimate Recursive Lossless Compression Research 2001 - 2002 (c) All Rights Reserved. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||