Any Coders out there?
Jan 10, 2002 at 5:25 AM Thread Starter Post #1 of 27

Ctn

Headphoneus Supremus
Joined
Aug 6, 2001
Posts
1,851
Likes
11
Are there are Software Engineers/Coders here
smily_headphones1.gif
 
Jan 10, 2002 at 6:19 AM Post #3 of 27
Do you have any xp in compression
smily_headphones1.gif


i need to fit as much into 5 bytes where 1 byte = 6 bits(dont ask....sigh) 30 bits all up.

Currently i managed 4x compression but i need to fit more.

 
Jan 10, 2002 at 6:49 AM Post #4 of 27
So let me get this straight...

You need to fit 30 bits into a 5 byte space? Specificly, what sort of data are you compressing? The data in question is an important factor in figuring out what compression ratio is even possible.. Each byte of the 5 byte space has to represent 6 bits. Correct?

..Wait

This is an assignment, isnt it?
smily_headphones1.gif


Are there any specific guidelines as to how you compress the data, or can we use any method?
 
Jan 10, 2002 at 7:54 AM Post #6 of 27
No hehe its used for communication to build a domain model
smily_headphones1.gif


Anyways back to the Q...Im compressing numbers (-ve numbers included).
I have a vocab of alphanumeric + 12 symbols

so i figured that 1 char can be represented by 6-7 bits (depending on compression ratio u want)

Im after fixed length compression. It means the compressed size must be 5 bytes with the restriction of the vocab above.

So far Ive managed to fit 20 chars into 5 6 bit "bytes"
And Ive just thought of another way to boost compression by prob a few more chars into 5 bytes.

I was wondering if it were possible to cram more stuff in
smily_headphones1.gif
 
Jan 10, 2002 at 8:46 AM Post #7 of 27
If you have n symbols in your vocabulary, you need exactly
ceiling( log_2 (n) ) bits to encode one symbol.

If you want to achieve something better, you need to know something about the statistical distribution of your symbols
in your code

I'm afraid I'm unable to help without that information


Bye

Redwoood
 
Jan 10, 2002 at 8:51 AM Post #8 of 27
Quote:

Originally posted by Redwoood
If you have n symbols in your vocabulary, you need exactly
ceiling( log_2 (n) ) bits to encode one symbol.

If you want to achieve something better, you need to know something about the statistical distribution of your symbols
in your code

I'm afraid I'm unable to help without that information


Bye

Redwoood


Hi Redwood,

What compression rate would this achieve? roughly speaking?

statistical distribution of your symbols would be out since i need a constant compression rate
frown.gif

Suppose each symbol has an equal chance of ocurring.

Say my vocab is 64. so I need ceiling( log_2 (64) ) = 4.15 bits = 5 bits to encode a symbol? How is this done ? since 2^5 = 32




 
Jan 10, 2002 at 9:36 AM Post #9 of 27
If there's a uniform distribution, there's nothing you can do
(which means all codewords have the same probability and are
not correlated)
In this case your code contains no redundancy and there is no further compression possible

I don't know what you calculated, but

log_2 (64) = 6

since 2^6 = 64

You can represent each symbol of your alphabet by a 6-bit equivalent


Bye

Redwoood
 
Jan 10, 2002 at 1:12 PM Post #10 of 27
I'm a games programmer, if that helps.

Compression is a way of taking data and making it use less storage space. But there's another way of achieving the same thing: What you do is store, say, a 32-bit seed and use that to pseudo-generate a longer data sequence. The trick is in finding the seed/prng that generates the result you want. Or rather, a seed/prng that generates all the results your program needs.
 
Jan 10, 2002 at 5:19 PM Post #11 of 27
Quote:

Originally posted by TerriblySorry
I'm a games programmer, if that helps.

[...]



That's pretty cool, TerriblySorry.
have you ever worked on a game we might know ?


Personally, I'm working on uC++ (micro C++), so chances are very slim that anybody here has even heard about it
rolleyes.gif


Bye

Redwoood
 
Jan 10, 2002 at 7:49 PM Post #12 of 27
Quote:

Originally posted by Redwoood



That's pretty cool, TerriblySorry.
have you ever worked on a game we might know ?


Personally, I'm working on uC++ (micro C++), so chances are very slim that anybody here has even heard about it
rolleyes.gif


Bye

Redwoood


Commander Keen, Earthworm Jim, Gex: Enter the Gecko, Gex: Deep Pocket Gecko - all Game Boy Color.

Going back a bit: Speedball for C64, Lion King on NES and Game Boy.

Going Back lots: Rescue On Fractalus on Spectrum.

Loads of other stuff in-between.
 
Jan 10, 2002 at 8:28 PM Post #13 of 27
Quote:

Originally posted by TerriblySorry
I'm a games programmer, if that helps.

Compression is a way of taking data and making it use less storage space. But there's another way of achieving the same thing: What you do is store, say, a 32-bit seed and use that to pseudo-generate a longer data sequence. The trick is in finding the seed/prng that generates the result you want. Or rather, a seed/prng that generates all the results your program needs.


This is something like what im doing now
smily_headphones1.gif

but is there a way that can boost compression?
With something like this I managed to get abit over 4x compression i.e. leaving less than 1/4 of the original msg. This depends on how big a "variety" we want to talk about. I need control over the compression rate too
frown.gif


Thanks for all you help guys
smily_headphones1.gif


We cant "technically" use a 32 bit seed hehe most is a 30 bit seed.

Encoding would take a long long time but decoding would be heaps quick.

Could you give me a quick example so I know exactely what you mean
smily_headphones1.gif
thanks

 
Jan 10, 2002 at 9:07 PM Post #15 of 27
Hey, Spectrum and C64. Cool. Speedball was a good game... Bitmap Brothers, right?

I miss my speccy and my Your Sinclair mags...
 

Users who are viewing this thread

Back
Top