New Posts  All Forums:Forum Nav:

# Any Coders out there?

Are there are Software Engineers/Coders here

Aye.
Do you have any xp in compression

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.
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?

Are there any specific guidelines as to how you compress the data, or can we use any method?
Not wnough information

There is no generic way to compress arbitrary data.
Information-theoretically impossible.

Why don't you just post the question?

Bye

Redwoood
No hehe its used for communication to build a domain model

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
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

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

Bye

Redwoood
Quote:
 Originally posted by RedwooodIf 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
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
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
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.
Quote:
 Originally posted by TerriblySorryI'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

Bye

Redwoood
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 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.

Quote:
 Originally posted by TerriblySorryI'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
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

Thanks for all you help guys

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 thanks
Quote:
 Speedball for C64
i loved my C64, my Vic20 and my C128. Memories.
Hey, Spectrum and C64. Cool. Speedball was a good game... Bitmap Brothers, right?

I miss my speccy and my Your Sinclair mags...
New Posts  All Forums:Forum Nav:
Return Home