RFE: support “implode” ZIP compression

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: RFE: support “implode” ZIP compression

Re: RFE: support “implode” ZIP compression

by Graf Zahl » Sun May 17, 2009 5:35 am

Then it was changed only in the VC++ project but not the CMake version.

Re: RFE: support “implode” ZIP compression

by Hirogen2 » Sun May 17, 2009 5:25 am

Graf Zahl wrote:The program that creates zdoom.pk3 already can do LZMA and BZip2 but doesn't use these for zdoom.pk3.
Actually, it does:

Code: Select all

$ unzip -lv zdoom.pk3
Archive:  zdoom.pk3
 Length   Method    Size  Ratio   Date   Time   CRC-32    Name
--------  ------  ------- -----   ----   ----   ------    ----
    3176  Unk:014    1321  58%  02-28-09 21:38  135954ff  acs/strfhelp.o
   10628  BZip2      2594  76%  12-06-08 10:22  5fbb01b8  actors/actor.txt
    1433  Defl:X      391  73%  09-14-08 06:44  3cce5f1f  actors/chex/chexammo.txt
[...]

Re: RFE: support “implode” ZIP compression

by Graf Zahl » Sun May 17, 2009 2:54 am

The program that creates zdoom.pk3 already can do LZMA and BZip2 but doesn't use these for zdoom.pk3.

And I doubt that this is going to change. I suspect that at some time zdoom.pk3 will switch to 7z format because it's far more efficient with data that consists of a large number of smaller text files.

Recompressing the current zdoom.pk3 from Zip to 7z shrinks its size from 445864 to 288875.

Re: RFE: support “implode” ZIP compression

by Gez » Sun May 17, 2009 1:41 am

Blzut3 wrote:I'm curious as to if the zdoom.pk3 compression program has been updated to use these formats or if they are actually worse than LZMA, bzip2, and DEFLATE in most cases?
If you change the compression method of zdoom.pk3, you make it unreadable by Slumped.

Re: RFE: support “implode” ZIP compression

by randi » Sat May 16, 2009 9:12 pm

Graf Zahl wrote:Skulltag sure won't like this:
Where do you see that? :p
Blzut3 wrote:I'm curious ... if they are actually worse than LZMA, bzip2, and DEFLATE in most cases?
Shrink is the same LZW compression used in GIFs. Just as PNG beats GIF, so to do any of the LZ77 variants ZIP supports beat Shrink.

Implode is basically a less "refined" version of Deflate. Like Deflate, it's LZ77, but its smaller window and use of mixed Shannon-Fano and fixed-length bit codes instead of strictly Shannon-Fano/Huffman codes for everything means that it will probably never beat Deflate except for contrived cases designed to let it win.

Re: RFE: support “implode” ZIP compression

by Graf Zahl » Sat May 16, 2009 11:41 am

The Zipdir program has not been updated. These are old and rather inefficient compression algorithms that are no longer actively used. Deflate is just better in almost all situations. They are merely supported so that old Zips from /idgames can be loaded.

Regarding the LGPL, don't forget its precise wording! You can not use this code inside a closed source binary without jumping through hoops to comply with it because the end user must be able to recreate the binary with a changed version of the LGPL code. Or you may just stick to the first revision of explode.cpp...

Re: RFE: support “implode” ZIP compression

by Blzut3 » Sat May 16, 2009 11:32 am

Graf Zahl wrote:Skulltag sure won't like this:

/* SetCodeLengths() and DecodeSFValue() are from 7-Zip, which is LGPL. */

:mrgreen:

(not that I care...)
I thought 7-Zip was public domain? (Or does the current version not have those functions.) Also, contrary to what you may think, we have nothing against releasing free open source software. In fact we are releasing our own GPL server browser since we don't have the source to IDESE.

I'm curious as to if the zdoom.pk3 compression program has been updated to use these formats or if they are actually worse than LZMA, bzip2, and DEFLATE in most cases?

Re: RFE: support “implode” ZIP compression

by Graf Zahl » Sat May 16, 2009 11:02 am

First I downloaded the entire archive with an FTP manager and then I wrote a tool that loads a zip, prints information about each entry, then wrote a small batch that ran it over all files in the archive and then I loaded the output into a text editor and searched for the information I was interested in.

There were exactly 4 Zips which contained WADs that were Shrunk, approx. 50-100 (I didn't count) that contained Imploded WADs, none that uses BZip2, LZMA or Reduce for anything. There were also 20 or so Zips which contained Shrunk text files.

Re: RFE: support “implode” ZIP compression

by Enjay » Sat May 16, 2009 8:33 am

Graf Zahl wrote:FYI, I just checked the entire levels/ directory of /idgames.
I've seen you say things like that before when looking for DECORATE issues or something. My question is, how do you manage to check every one of those thousands of files? Presumably it's not a manual check.

Re: RFE: support “implode” ZIP compression

by Graf Zahl » Sat May 16, 2009 5:14 am

FYI, I just checked the entire levels/ directory of /idgames.

There's quite a few files which use Implode as their compression algorithm and a handful that use Shrink - mostly for text files but even for some WADs. However, there is not one single file in there using one of the 'reduce' methods so maybe they really aren't worth bothering.

Re: RFE: support “implode” ZIP compression

by Graf Zahl » Sat May 16, 2009 1:01 am

Skulltag sure won't like this:

/* SetCodeLengths() and DecodeSFValue() are from 7-Zip, which is LGPL. */

:mrgreen:

(not that I care...)

Re: RFE: support “implode” ZIP compression

by randi » Fri May 15, 2009 9:13 pm

Okay, I added Shrink support. (Good thing the LZW patent has expired!)

Reduce, however, that code indicates has only been partially tested, and since PKZIP 1.1 doesn't support Reduce (though it does support Shrink and Implode), I would prefer to have a real-world Reduced file to test with before adding it.

Re: RFE: support “implode” ZIP compression

by Graf Zahl » Fri May 15, 2009 5:47 pm

Since that linked code also contains decompression routines for the other old methods Shrink and Reduce, wouldn't it make sense to make ZDoom's Zip reader feature complete? I have to admit though that I haven't found and Doom relates Zip which uses these 2 methods yet.

Re: RFE: support “implode” ZIP compression

by Graf Zahl » Fri May 15, 2009 12:54 am

Thank god!

I would have given up on the Info_Zip code. The function call interface of it is nearly impenetrable.

Re: RFE: support “implode” ZIP compression

by randi » Thu May 14, 2009 9:14 pm

I found some much easier to understand code from GunZip.c64.

Top