conor42 / Radyx

Multithreaded 7-zip compatible file archiver
31 stars 0 forks source link

codec plugin for 7-Zip #1

Open StephanBusch opened 8 years ago

StephanBusch commented 8 years ago

please create a plugin for 7-Zip so that this open and free archiver can directly use Radyx. This would also help making Radyx more famous in the world.

there are already plugins that work with 7-Zip (including descriptions and sources):

ZSTD

https://github.com/mcmilk/7-Zip-Zstd

LZHAM http://richg42.blogspot.de/search?updated-max=2015-12-03T16:22:00-08:00&max-results=7&start=21&by-date=false https://github.com/richgel999/lzham_codec_devel

conor42 commented 8 years ago

Thanks for the info Stephan. I'll probably have some time to look into it in the next few weeks.

ghost commented 6 years ago

@conor42 If you think, that the code could be used in production systems, then I would accept to include it into 7-Zip ZS ;-)

But you should help me with that. The best would be, when you send me some pull request.

conor42 commented 6 years ago

@mcmilk I will be working again on the project this week, starting with tidying up. I think the compression code needs no modification so it will be ready for production soon.

conor42 commented 6 years ago

@mcmilk What version of VS do you compile with? Radyx needs VS 2013 or later iirc. Would need to make a dll with the compression code if you use an earlier version.

ghost commented 6 years ago

I let it build on appveyor, this is the script used therefore: https://github.com/mcmilk/7-Zip-zstd/blob/master/CPP/appveyor.cmd

Here are the logs and binaries of it: https://ci.appveyor.com/project/mcmilk/7-zip-zstd/

It builds nicely with all of these:

conor42 commented 6 years ago

@mcmilk It's all working except for one snag - if I register the radyx codec as method id 0x21 to indicate lzma2 output, it's impossible to use because the standard lzma2 encoder runs when I specify radyx. I can use a new id code but standard 7-zip won't recognize the method for decompression. Any suggestions? It may be necessary to modify the codec selection code to handle cases where two codecs have the same format id.

ghost commented 6 years ago

@conor42 is the radyx lzma2 stream of your compression code fully compatible?

if yes, we need no id change, but some switch to let the user choose what codec he wants to use... it would be better to understand for me, when I have some pre-finished code ;)

two compatible codecs can share one id, I think ;)

conor42 commented 6 years ago

@mcmilk Yes it's fully compatible. The switch is -m0=RADYX but the problem is 7-zip looks up the method ID and uses that later when creating the encoder object. Internally 7-zip passes method IDs around instead of codec names. The first matching encoder in the list is standard LZMA2 so it uses that. Same problem with the GUI.

Everything is committed on my local repo. How do I get this to your github repo in a topic branch? Assuming that's what you want to do. I know little about using github.

conor42 commented 6 years ago

I found a kludge to work around this problem - use a unique id, check for it when writing the method info to the archive, and replace it with 0x21. Ugly but it works :)

ghost commented 6 years ago

How does your local branch look like?

Is it a local clone of the 7-Zip-zstd repo with your modifications? If yes, then it's easy:

  1. Just fork 7-Zip-zstd to your repos.
  2. clone your fork to your local pc
  3. overwrite all the changed files an create a new commit
  4. push your own local 7-Zip-Zstd repo to the one in github
  5. then you can use the "New pull request" in your own 7-Zip-Zstd github repo ...

Then it's up to me to change some things ... and then it's done ;-)

To the work around ... sth. like that was also in my mind.