LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Compressions (https://www.linuxquestions.org/questions/programming-9/compressions-257634/)

JanusPaul 11-21-2004 01:29 PM

Compressions
 
I would like to obtain a software equivalent to the poly/multinomial expression used in v.90 dailup modems inorder to compress data. (Example: 8kB down to 2kB)
Anything along those lines. Any suggestions?

PS This will be for realitively 'small' concentrations of data. So GZIP/ZLib wouldn't apply :(

Tinkster 11-21-2004 01:54 PM

Have a look at compress' source.


Cheers,
Tink

JanusPaul 11-21-2004 10:07 PM

LZW is alot like ZLib, redundancy based. I want something that in 99% of the cases will compress 8 kB to 2 kB, not something left to chance. The v.90 modem polynomial compression met this challenge.

theYinYeti 11-22-2004 03:33 AM

Just guessing here, but maybe you should look at the source code for a Linux OpenSource winmodem driver...

Yves.

jlliagre 11-22-2004 04:09 AM

Quote:

I want something that in 99% of the cases will compress 8 kB to 2 kB
No such thing can exists ...
Lossless compression is usable only with data that have some kind of redundancy, and chance is always part of the deal.

theYinYeti 11-22-2004 04:56 AM

True. My modem does excellent compression with text/*, but is very bad at compressing jpeg, tarballs...

Yves.

JanusPaul 11-22-2004 12:09 PM

The compression in a dailup modem DOES EXIST! And it's not going to be found in a 'driver' file. It's HARD BUILT into the hardware itself. When one modem sends data over the wire to another modem, one divides the data by the polynomial expression, sends the remainder, the receiving end applies the remainder back into the expression. There ya go, a perfect 4:1 lossless compression for any case! Awesome/Brilliant as it may seem, it's possible!

jlliagre 11-22-2004 12:27 PM

If this is brilliant, it is only brilliant marketing and you've been abused.
Hardware can't change that, it is mathematically demonstrated impossible to compress successfully any kind of data, should it be 100% of case like you now claim, or 99% like you were previously.
Just like gambling strategies, you can't always win ...

theYinYeti 11-23-2004 03:52 AM

Quote:

Originally posted by JanusPaul And it's not going to be found in a 'driver' file. It's HARD BUILT into the hardware itself.
Are you sure, that this is true even with winmodems? Note that I didn't say to look at a normal modem's driver (does it even exist?). I'm not sure myself, though.

Yves.

jlliagre 11-23-2004 07:32 AM

theYinYeti,
You are right, winmodems (aka linmodems) are implementing in software the compression, transport, and correction algorithms, as the very difference between winmodems and classical modems is precisely a dedicated chip (controller) for these functions on the latter.

Another point, due to the limited resource available to these hardware components, modem compression is actually less efficient, in term of data size reduction, compared to software ones (gzip, zlib, ...) for commonly transfered data.

JanusPaul 11-24-2004 03:00 AM

It would just be nice to be able to compress 8 kB to under 2 kB regardless how lack of redundancy the contents hold. This is working towards a compression of Image data, a 44 by 44 image of 32-bit quality o.O. GZip/ZLib/LZW are good, but I don't think they're that good...

jlliagre 11-24-2004 04:58 AM

Quote:

It would just be nice to be able to compress 8 kB to under 2 kB regardless how lack of redundancy the contents hold.
Again, it would be indeed nice, but is easily demonstrated impossible, as long as lossless compression is concerned.
If such an algorithm have existed, then if would be possible to apply it recursively until the resulting file is smaller than a given size, say for example 8 bytes.
But as there are exactly 2048 possible different files 8 bytes long, uncompressing them could only lead to 2048 other files, which is obviously smaller that the number of possible files of any given size larger than 8 bytes ...
In fact, this demonstration is true even after the first level of compression.

JanusPaul 11-24-2004 11:11 PM

Which of these would be better... bzip or 7zip?

jlliagre 11-25-2004 01:46 AM

7zip only run on windows (AFAIK)
7zip handle many formats. When using its own (7z), it seems to compress better but slower.
bzip2 is faster than 7zip, better but slower than gzip ...

Choosing an algorithm is often a trade-off between speed and compression factor, and is highly dependent on the kind of data processed.

JanusPaul 11-25-2004 02:13 AM

I've heard 7zip is open source, so, if true, not a problem as far as platform. Basically it's all about compressing image data. Approx 8 kB (as noted in my previous posts), would be the largest size. Just trying to get an idea or two about compression ratios people themselves have encountered *shrugs*.


All times are GMT -5. The time now is 04:50 PM.