Small data compression

I have a program in which I create bit streams, about 80-150 bits or so, that I would like to compress, because I'm going to turn them into some kind of ASCII string so that people can transmit them.

Does anyone know of a good, free bit compress that can run on such a stream? My main problem with the "standard parameters" is that this stream really needs to be processed as bits, not bytes, otherwise the structure is lost, and their service swamps get any gain.

Addition:

The reason I want to compress these streams is because users will cut + paste them, possibly using something like base64 encoding, so it’s useful to save some data.

Here is an example for those who would like to see him. I will add formatting to make it easier to read:

110 110 - This is a 6x6 grid (the maximum is 7x7, so we only need 3 bits!)

000000
011110
010010
010010
011110
000000 - This is one layout grid

000000
000000
001000
000100
000000
000000 - This is the second layout grid

Now we will list some fragments

010 11111111 - A piece is a 3-bit colour code, then an 8-bit list of 'on / off' bits.
001 10101010 - Another bit!
001 10101010 - Another, identical bit!

The reason why I say this should be considered as “bits”, because there are obvious compression parameters, if we consider them as a bit stream (in particular, as a rule, there are many 0 in the “grid”), which disappear if you consider it a byte-stream.

+3
source share
12 answers

What do you hope to achieve by compressing 150 bits? If you do not combine several of these posts 19b, I'm not sure what you hope to receive. This is a user interface question - in which do you want your users to send / receive "codes"?

base 64? .

+8

, . , - , . .

http://en.wikipedia.org/wiki/Run-length_encoding

0.

, ? ; .

, , . , , , TCP, MTU . ( , )

!

+4

, .

, , (, - ).

+3

, ?

, , ? ?

, - , RPG, "Chrono Trigger" "Final III. , ( ), . , , , .

. , (.. "" 58 ) .

+2

zlib. , . , , , . , .

, . , , . , , , , - , 12 .

, GIF, . , , , . , - ; , .

+2

, .

1: ,

2: base64 ASCII-,

0- N ( N - , 1), .

, , PNG, , , . , - , " , 0, 1, ," , , .

+1

zlib (, , gzip) . , , , .

png gif , , , , , .

0

- . , -, . Google , , , .

? , ?

, , , , "", / .

- , , , , .

0

, - . , , , , - - ascii, uuencode mime-encode (aka Base64 ").

0

CCITT 3 4, TIFF G3 G4, . G4 TIFF - - , . , , - RLE.

0

, " " ? , , .

vs ascii - , , , , Base64 .

Note that any conversion from binary to ascii is the opposite of compression.

0
source

All Articles