Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Compressing A byte

Name: FrozenVoid 2011-10-09 13:25

I will prove theoretically how it possible:
Every byte N contains 8 bits, due format.
However the space of a byte is not optimally used.
This a table of how much space is used by certain bytes:
Byte Value:       Size
128-155       8bits
64-127       7bits
32-63       6bits
16-31   5 bits
8-15  4bits
4-7  3 bits
2-3  2 bits
0-1 1 bit
Notice a pattern? The lower the byte value, the less data it contains!
Aggregation of such truncated bytes would take less bits than initial byte.
a value of 31 will take only 5 bits in a bitstring.

Name: Anonymous 2011-10-09 13:27

The jews are after my children.

Name: Anonymous 2011-10-09 13:55

http://en.wikipedia.org/wiki/Pigeonhole_principle

And assuming you're not trolling, which is becoming increasingly hard to do:

What does 1010 decompress to?
1, 0, 1, 0?
2, 2?
10?

Name: FrozenVoid 2011-10-09 14:03

1010 as 4-bit bitstring is 10, and it will occupy only 4 bits at ideal compression level, not 8.

Name: Anonymous 2011-10-09 14:16

>>4
Then how do you encode 2, 2?

Name: FrozenVoid 2011-10-09 14:23

>>5
I am working on a simple C algorithm to provide fixed-length bitarray compression, there will be a depacking scheme to extract from locations inside bytes.

Name: Anonymous 2011-10-09 14:44

He's officially trolling. You can't be this dense.

Let's do this the hard way, >>1: Write up a code example that decompresses a string of bits to the following bytes:

5, 45, 145, 32, 64, 0, 1

By your logic, this string contains 32 bits. You may not ``read'' any other data except these bits.

Name: Anonymous 2011-10-09 15:12

>2011
>Replying to frozen void
Who am I quoting?

Name: Anonymous 2011-10-09 15:35

if anyone takes this thread seriously - leave /prog/ NOW

Name: Anonymous 2011-10-09 18:14

>>8
back to /jp/

Name: Anonymous 2011-10-09 18:40

>>10
suck my cock dude

Don't change these.
Name: Email:
Entire Thread Thread List