CPCWiki forum

General Category => Programming => Topic started by: roudoudou on 09:05, 04 May 17

Title: ZX7 cruncher (from Spectrum world)
Post by: roudoudou on 09:05, 04 May 17
Hi, searching some crunching info around the web, i saw this cruncher coming from spectrum world, written by Einar Saukas (Br)


To sum up, the crunching performance are between Exomzier and LZ4, as the decrunching time.


My test file, a real bitmap screen (a conversion of a motocross picture), (interrupt disabled  :D )


i used the docent version of lz4 decruncher
i used the turbo version of zx7 decruncher (not the mega)
i used the optimized version (and re-optimized by me) version of exomizer decruncher


type   size    time   ldir factor
---------------------------------
RAW   16384    0.09s        x 1.0 (reference)
LZ4   11926    0.14s        x 1.5
ZX7   10484    0.43s        x 4.3
EXO    9448    1.42s       x 14.4


download found here: http://www.worldofspectrum.org/infoseekid.cgi?id=0027996 (http://www.worldofspectrum.org/infoseekid.cgi?id=0027996)


and in attachment
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: Sykobee (Briggsy) on 09:22, 04 May 17
Useful, so where speed matters (decompression from extension RAM) most, use LZ4, where size matters (tape/disk loading, crt compression) use EXO, and in the rare case of speed and size mattering, use the ZX7 cruncher.


Can you try it on a non-image by the way? It may be that code compresses differently. Also sometimes with less complex images a simple fast RLE can get fairly decent compression.
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: roudoudou on 09:43, 04 May 17



Sure, there is the wellknown file test BOULDERD.BIN (Boulder Dash executable) of 28837 bytes


ZX7 is very competitive in this case, cause exomizer routine is bigger, slower and need a buffer! For the small gain, it do not worth it!


Just do the test each time you have to crunch


LZ4 -> 13987
ZX7 -> 11651
EXO -> 11026
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: Arnaud on 07:39, 08 May 17
Bad luck there's not a C decompressor included, i can't use it as cross compressor (Windows / CPC).
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: roudoudou on 12:14, 08 May 17
I may write one ;)
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: Arnaud on 12:26, 08 May 17
Quote from: roudoudou on 12:14, 08 May 17
I may write one ;)

I was secretly hoping  ;D
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: reidrac on 13:35, 08 May 17
Quote from: Arnaud on 07:39, 08 May 17
Bad luck there's not a C decompressor included, i can't use it as cross compressor (Windows / CPC).

For LZ4 should be quite easy... I'm using it for my current C64 project and I compress with C in Linux and decompress with 6502 assembler.

Not sure about the others, but if they're documented, all is possible.
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: Ast on 16:40, 08 May 17
Quote from: roudoudou on 12:14, 08 May 17
I may write one ;)
Well done, Roud !
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: Alcoholics Anonymous on 22:27, 12 May 17
Quote from: Arnaud on 07:39, 08 May 17
Bad luck there's not a C decompressor included, i can't use it as cross compressor (Windows / CPC).

You need a newer package:
https://www.dropbox.com/sh/bgtoq6tdwropzzr/AABLP1X6NU9PWBxhgDHHV9y-a/ZX7?dl=0

There is a pc decompressor in there.

zx7 has a number of advantages:  small size, no ram requirement, can decompress backwards and is able to prime its dictionary with a prefix to get better compression.
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: Arnaud on 06:17, 13 May 17
Quote from: Alcoholics Anonymous on 22:27, 12 May 17
You need a newer package: https://www.dropbox.com/sh/bgtoq6tdwropzzr/AABLP1X6NU9PWBxhgDHHV9y-a/ZX7?dl=0 (https://www.dropbox.com/sh/bgtoq6tdwropzzr/AABLP1X6NU9PWBxhgDHHV9y-a/ZX7?dl=0)

Perfect,
thanks @Alcoholics Anonymous (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1116).
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: Arnaud on 08:25, 14 May 17
Here a version of ZX7 for cpctelera and an example. It was really easy to adapt.

Title: Re: ZX7 cruncher (from Spectrum world)
Post by: reidrac on 09:02, 14 May 17
Quote from: Arnaud on 08:25, 14 May 17
Here a version of ZX7 for cpctelera and an example. It was really easy to adapt.

You really should comply with the license. Einar is very kind sharing is work with all of us and it is really easy to play fair with him doing things legally.

Sorry to be that guy.
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: Arnaud on 09:12, 14 May 17
Quote from: reidrac on 09:02, 14 May 17
You really should comply with the license. Einar is very kind sharing is work with all of us and it is really easy to play fair with him doing things legally.

Sorry to be that guy.

I'm totaly agree with you, but what is missing in my release ? The name of the creators is in the asm file, and the ZX7 name is kept.

edit : Maybe i should add in comment i have modified the asm file for the adaptation for cpctelera

Here the license :
=======
LICENSE
=======

The optimal C compressor is available under the "BSD-3" license. In practice,
this is relevant only if you want to modify its source code and/or incorporate
the compressor within your own products. Otherwise, if you just execute it to
compress files, you can simply ignore these conditions.

The Z80 assembly decompressors can be used freely within your own ZX-Spectrum
programs (or any other Z80 platform), even for commercial releases. The only
condition is that you must indicate somehow in your documentation that you have
used "ZX7".
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: reidrac on 11:34, 14 May 17
Quote from: Arnaud on 09:12, 14 May 17
I'm totaly agree with you, but what is missing in my release ? The name of the creators is in the asm file, and the ZX7 name is kept.

edit : Maybe i should add in comment i have modified the asm file for the adaptation for cpctelera

Here the license :
=======
LICENSE
=======

The optimal C compressor is available under the "BSD-3" license. In practice,
this is relevant only if you want to modify its source code and/or incorporate
the compressor within your own products. Otherwise, if you just execute it to
compress files, you can simply ignore these conditions.

The Z80 assembly decompressors can be used freely within your own ZX-Spectrum
programs (or any other Z80 platform), even for commercial releases. The only
condition is that you must indicate somehow in your documentation that you have
used "ZX7".

You didn't include that information in the two ZIP files you uploaded.

I didn't get the impression you rewrote the code so is not based on Einar's code.
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: Arnaud on 12:04, 14 May 17
Quote from: reidrac on 11:34, 14 May 17
I didn't get the impression you rewrote the code so is not based on Einar's code.

I haven't rewrite the code, i just made some minor modifications to make Einar's code compatible with cpctelera and easily used with it.

I send a message to @Urusergi (http://www.cpcwiki.eu/forum/index.php?action=profile;u=923), cowritter of ZX7 decoder, to be sure i can distribute this code (but i think all is ok)
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: Arnaud on 19:43, 29 December 18
Hello,
i'm looking for the C version of ZX7 Backward decoder in order to have WinCpcTelera compatible with the version 1.5.0 of CPCTelera which includes zx7 compressor.

I haven't found in the following repositories :I also tried to adapt the ZX7 "normal" but my code doesn't work.

Thanks for help.
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: roudoudou on 21:03, 29 December 18
I thought the backward version was named Saukav
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: Arnaud on 07:54, 30 December 18
Quote from: roudoudou on 21:03, 29 December 18
I thought the backward version was named Saukav
You are right, but same problem, there's not C decoder.
Title: Re: ZX7 cruncher (from Spectrum world)
Post by: antoniovillena on 11:56, 02 January 19
Quote from: Arnaud on 07:54, 30 December 18
You are right, but same problem, there's not C decoder.


Hi. I have created a decoder here:
https://github.com/antoniovillena/zx7b/blob/master/dzx7b.c

Also published 8086 real mode decoder (.com file) used in bacteria.
https://github.com/antoniovillena/zx7b/blob/master/bacteria_dzx7b.asm


saukav is a generalization algorithm. It has 36 different compression codings and zx7b is only one of them). But there is no C decoder for it.

Title: Re: ZX7 cruncher (from Spectrum world)
Post by: Arnaud on 12:26, 02 January 19
Thanks a lot @antoniovillena (http://www.cpcwiki.eu/forum/index.php?action=profile;u=436) to make it so quickly.

Quote from: antoniovillena on 11:56, 02 January 19
saukav is a generalization algorithm. It has 36 different compression codings and zx7b is only one of them). But there is no C decoder for it.
Ok, i think dzx7b is only what i need.
Powered by SMFPacks Menu Editor Mod