Author Topic: LZ48/LZ49 Z80 cruncher/decruncher  (Read 5453 times)

0 Members and 1 Guest are viewing this topic.

Offline uniabis

  • Speccy
  • *
  • Posts: 1
  • Country: jp
  • Liked: 0
  • Likes Given: 0
Re: LZ48/LZ49 Z80 cruncher/decruncher
« Reply #25 on: 09:56, 02 April 19 »


Binary of LZ49 Windows compressor & fixed LZ48 Windows compressor.


lz48_bin.zip and lz48_c_source.zip
Code: [Select]
int LZ48_encode_extended_length(unsigned char *odata, int length)
{
   int ioutput=0;
   while (length>255) {


lz48_v002.zip
Code: [Select]
   while (length>=255) {

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.276
  • Country: au
    • index.php?action=treasury
  • Liked: 948
  • Likes Given: 1009
Re: LZ48/LZ49 Z80 cruncher/decruncher
« Reply #26 on: 11:24, 02 April 19 »

Binary of LZ49 Windows compressor & fixed LZ48 Windows compressor.

lz48_bin.zip and lz48_c_source.zip
Code: [Select]
int LZ48_encode_extended_length(unsigned char *odata, int length)
{
   int ioutput=0;
   while (length>255) {

lz48_v002.zip
Code: [Select]
   while (length>=255) {

Hi there.

Ah, your first post to the forums.
 :)

Thanks for the new versions.
Is the greater-than check the only thing that has changed?
My (cancelled) entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.cpc-power.com/index.php?page=detail&num=12494

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 664
  • Country: fr
    • urban exploration
  • Liked: 923
  • Likes Given: 589
Re: LZ48/LZ49 Z80 cruncher/decruncher
« Reply #27 on: 13:15, 02 April 19 »
I realise i did not released the constant time version...
Frames with max nops for decrunching
But also...
Frames with exact configurable nop count for decrunching
use RASM, the best assembler ever made :p

I will survive

Offline Shining

  • Supporter
  • CPC6128
  • *
  • Posts: 266
  • Country: de
    • Shinings little CPC page
  • Liked: 374
  • Likes Given: 173
Re: LZ48/LZ49 Z80 cruncher/decruncher
« Reply #28 on: 22:56, 03 April 19 »
I'm really interested in a version with constant data size for stream decrunching...
TGS is back

Download my productions at:
cpc.scifinet.org

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.379
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2579
  • Likes Given: 1507
Re: LZ48/LZ49 Z80 cruncher/decruncher
« Reply #29 on: 01:03, 04 April 19 »
Because it hang at 27% ?  :-\
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline Zik

  • Speccy
  • *
  • Posts: 1
  • Country: fr
  • Amstrad 6128plus
    • Quasar CPC
  • Liked: 2
  • Likes Given: 2
Re: LZ48/LZ49 Z80 cruncher/decruncher
« Reply #30 on: 23:34, 19 April 19 »
Thank you Roudoudou for this work and for sharing! I am very interested in the LZ48/LZ49 variant you made from LZ4. I may use it in my software cause I need relatively fast compression time and very fast decompression time. 

So, here is a little contribution. 
First remark, you finally put offset byte at the end of the block (after match length), which is not what the diagrams of your first post show. Anyway. 

Then, I propose some small optimizations to the decrunching routine (see attachment). In short:
  • gain 6 nop when no literal, loose 2 otherwise (code around cp #10 when decoding token)
  • optimize literal and match size calculation speed (8 bit add and simply inc b if carry was set)
  • small size optimization on offset calculation (instead of src=dst-oft with 8 bit subtract, perform src=-oft+dst with one 16 bit add) (hint: neg might be avoided here)
  • small size and speed optimization by moving ld c,a around
I am also looking at the crunching routine but it is too soon to share my findings. For now, I could gain >30% time when crunching my reference file (the one that has worse compression ratio). 
First simple optimization is to move the ld bc,3 some lines away in LZ48_get_match_rescan...

Offline LTronic

  • CPC464
  • **
  • Posts: 35
  • Country: fr
  • Liked: 26
  • Likes Given: 14
Re: LZ48/LZ49 Z80 cruncher/decruncher
« Reply #31 on: 00:23, 26 August 19 »
Hello,


I am having trouble getting the cruncher/decruncher working.
I am using lz48decrunch_v006.asm posted in this thread for decrunching on CPC, assembled with RASM, translated with DisArk in order to use with SDCC.
I don't think the C glue code is the source of the issue (C source code found on this forum..).


I am using lz48.c cruncher I compiled on Linux (not sure which version I picked... command line stated it's from 2016).


Crunching / Decrunching in command line on Linux works, not on CPC.
I think I might have a version mismatch here.


Which files should I get ?


Thanks for your help !


[EDIT] : Please disregard, I finally got it working thanks to Arnaud6128 SDCC glue code. source and and target were reversed in my code....
« Last Edit: 10:55, 26 August 19 by LTronic »

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 664
  • Country: fr
    • urban exploration
  • Liked: 923
  • Likes Given: 589
Re: LZ48/LZ49 Z80 cruncher/decruncher
« Reply #32 on: 15:20, 26 August 19 »
last versions are all in this threadi can't help you more without the dataif this is not a secret, send me a mail with thoses datasregards
use RASM, the best assembler ever made :p

I will survive