Shuffling

This is one of my first attempt to manipulate the data content in hope the result will be more compressible. What I hope is unfulfilled with this method, instead this makes data more balance (about equal the total of each ASCII, less compressible). I have put this shuffling method into 2 (two) category, they are:

Math shuffling.
This technic use math operation such as addition or subtraction calculation to determine the value of the ASCII bytes in the content. Below is an example.

Source: (ASCII Value) 20-50-40-200-150

Encoding Algorithm:
X = current - previous
If X > 0 (zero) then
Result = (256 - X)
Else
Result = (X * -1)
Endif

Input Previous X Result (output)
20 0 (none) -236 236
50 20 -206 226
40 50 40 10
200 40 -56 96
150 200 150 50

Decoding Algorithm:
X = previous (last output) - current
If X < 0 then
Result = X + 256
Else
Result = X
Endif

Input Previous X Result (output)
236 0 (none) -236 20
226 20 -206 50
10 50 40 40
96 40 -56 200
50 200 150 150

This is a very simple math calculation; maybe there is other calculation, which resulted in better result (more compressible).

Swap shuffling
This shuffling is straightforward and there are basically two kinds of swapping, bit swapping or bytes swapping.

Bits swapping.
This method will swap the bit in either single for single swap or group for group swap. Since there are many ways (encoding technic) to deal with this method. Below I put an example so we can get the idea.
Eg, source bits = 01 00 10 11 - 11 10 00 10 = (ASCII value, left to right) 210 & 71
Encoding: swap every 2 bits with the next, result: 00 10 11 10 - 10 11 10 00 = 120 & 29
This is quite simple and quite fast but is it useful? Is the result more compressible? Well, that is depending on the next data content, isn't it?

Bytes swapping.
Basically this one is similar with bits swapping only it uses the whole byte (8 bits) instead of bit by bit, which requires more programming code, and of course, more slow. And this one also to swap byte for byte or group for group (string swap).

Eg, (ASCII value) 20 60 130 150 200 70 255 0
Encoding: divide into four groups and swap group by group, result: 130 150 20 60 255 0 200 70

This shuffling technique is not very useful in data compression but it can be used for the simplest data encryption and of course for your own personal use, because this is easy to crack (decode) so this is not suitable for public use. I believe many compression programmer out there have the same idea with me; shuffling is kind of needed to achieve a better compression ratio. I hope this shuffling page is clear and understandable, if it is not then you still can contact me and I will try my best to explain more. Remember, there is no limit for shuffling technic, the only limit is your imagination.

Flattening


Author Site Map Disclaimer
HMaxF Ultimate Recursive Lossless Compression Research
2001 - 2002 (c) All Rights Reserved.
Hosted by www.Geocities.ws

1