The Traveling Salesman Problem and Javascript Compression - http://timepedia.blogspot.com/2009...
I started porting the 7zip C++ code a few months back, but it was pretty slow going. It's some of the worst code I've had to parse. Had to give up eventually- it was easier just to exec() the native ones. - Matt M (inactive)
Yeah, a lot of those codecs look like that, and the Java ports tend to be really nasty. The only real way to do it is reimplementation, not C->Java translation, which means spending time learning exactly how the implementation works, and rewriting it. A tall order, but maybe the open source community can help. - Ray Cromwell
BTW, I've been able to demonstrate a 25% reduction on image bundles generated by ClientBundle by running them through a PNG optimizer. It makes me wonder if optimal PNG sprite packaging should take into account not only minimizing wasted space/dimensions, but also, the effect of ordering different images next to one another will have on DEFLATE. - Ray Cromwell
I was hoping to take a first stab at a direct port, the try to reverse engineer what I had done once it worked. Would be nice to have a proper clean room apache version of it (any direct port would likely inherit the LGPL). - Matt M (inactive)
Interested to see what you come up with on the PNG side. Most PNG optimizers just brute force different codecs and interlace flags. I doubt there's been any real study of doing it with a more refined approach yet. Plus all of them use libpng's subpar zlib compression in the end :) - Matt M (inactive)
I think the AdvanceCOMP has a tool that uses 7-zip's implementation of deflate to recompress PNGs. - Ray Cromwell
Matt, if you have some partial code, I can contribute, although it will probably have to be 2 weeks out, as I've got some big patches in the pipeline right now. But getting a Java implementation of 7-zip deflate in the linker is definitely on my wish list, and we can reuse the suffix tree implementations to implement LZDIST to improve clustering as well. - Ray Cromwell
Have you seen http://code.google.com/p... ? Is LZF the same thing? It's EPL licence, which might be ok? - Nick Lothian