English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 06 March 2017, 17:17   #481
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,839
That's pretty short

Can't you make it simpler by packing 8 mode bits into a byte, and then having 8 literals (8 bits) and offsets (16 bits) after that, or does that decrease packing efficiency?
Thorham is offline  
Old 06 March 2017, 19:46   #482
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
Quote:
Originally Posted by Thorham View Post
That's pretty short

Can't you make it simpler by packing 8 mode bits into a byte, and then having 8 literals (8 bits) and offsets (16 bits) after that, or does that decrease packing efficiency?
Yes, you can have the select bit packed in byte (is more or less what standard LZSS do: a select bit for single literal or match/lenght pair 4:12).
But you can try my encoder: practically beat LZSS everytime.

The problem in pure LZSS was the single literal run (initially the file grow significantly), and too many bit for pair.
In my version initially we have little waste for the run of literal (1byte/run vs 1bit/byte, if run>8 we gain); anyhow after the first stages of depacking, incompressible data tend to be less and less... so bad for big files. Same situation for match/lenght (1+15 vs 1+16 bit): if we stay in 'offset' we gain a bit everytime and with longer match!
So, well balanced for small data, bytecode access and no bit count/carry replenish.

[When you wrote 8 literals (8bits) do you mean 256 literals (8bits) or 8 literals (3bits)?]
Your suggestion is just my version with more bits available, so for large files work better. The breakeven could be around 16KB of data.

We could try

Last edited by ross; 06 March 2017 at 20:26. Reason: better explanation: run of literal
ross is offline  
Old 06 March 2017, 20:40   #483
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
First try for Thorham version, got 42byte depacker
I need to think better...
ross is offline  
Old 06 March 2017, 21:25   #484
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
38byte, i don't know if I can do better


EDIT: 36! (34 with 15 bit offset)

Last edited by ross; 06 March 2017 at 21:53. Reason: got two byte :)
ross is offline  
Old 07 March 2017, 08:20   #485
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
Changing the encoding to pack more literals and longer offsets will give results that depend heavily on the kind of data to be compressed and its size. So if it's about changing the format, i would like trying to switch to another algorithm.
Can we have access to the typical data you intend to crunch ?
meynaf is online now  
Old 07 March 2017, 09:07   #486
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
Quote:
Originally Posted by meynaf View Post
Changing the encoding to pack more literals and longer offsets will give results that depend heavily on the kind of data to be compressed and its size. So if it's about changing the format, i would like trying to switch to another algorithm.
Can we have access to the typical data you intend to crunch ?
Meynaf sorry I did not understand if the question is directed to me or to Thorham.
If it's for me, I don't have a data target, it's all for fun and mental exercise like everything on Amiga.
Since returning I rediscovered why I loved this wonderfull machine.

Regarding other types of compressors algorithms I know them well enough, but it is always a pleasure to be able to discuss it with someone!

ross is offline  
Old 07 March 2017, 12:49   #487
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
It was directed to you. If you had some typical data to compress, we could have tried to get to the smallest code+data final size, more fun imo.
meynaf is online now  
Old 07 March 2017, 14:49   #488
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
Quote:
Originally Posted by meynaf View Post
It was directed to you. If you had some typical data to compress, we could have tried to get to the smallest code+data final size, more fun imo.
smallest code+data final size, mmh, maybe a depacker for lzx, or already exists?

But the real problem here is the encoder part.
All this lz+huff(/ari) packers (zip, lzx, lha, lzma..), aside optimal parsing and great encoding, is facing another well defined problem: the split point for the entropy table rebuild.
The myriad of ZIP 'deflate' alternative varies in this matter: some euristic vs brute force... (kzip, zopfli, the same 7zip..).
You can have the best algorithms but is like the chicken and the egg causality dilemma: which is the best split point for the best entropy result for the best encoding , if encoding modify entropy which in turn modifies the split point?
And then, as you said, it all depends on the type of data

Back on the road: exists a decompressor for lzx (in optimized 68k code of course!) or similar powerfull compressor?

ross is offline  
Old 07 March 2017, 15:30   #489
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
Quote:
Originally Posted by ross View Post

smallest code+data final size
, mmh, maybe a depacker for lzx, or already exists?
Again it depends on the kind and size of data, but in some cases lzx can be easy to beat


Quote:
Originally Posted by ross View Post
But the real problem here is the encoder part.
All this lz+huff(/ari) packers (zip, lzx, lha, lzma..), aside optimal parsing and great encoding, is facing another well defined problem: the split point for the entropy table rebuild.
The myriad of ZIP 'deflate' alternative varies in this matter: some euristic vs brute force... (kzip, zopfli, the same 7zip..).
You can have the best algorithms but is like the chicken and the egg causality dilemma: which is the best split point for the best entropy result for the best encoding , if encoding modify entropy which in turn modifies the split point?
There is little choice but to try several points and keep the best...


Quote:
Originally Posted by ross View Post
And then, as you said, it all depends on the type of data
This is why we can't get far without actual data sets to compress.
A small bootblock isn't the same as a 30MB wave file.


Quote:
Originally Posted by ross View Post
Back on the road: exists a decompressor for lzx (in optimized 68k code of course!) or similar powerfull compressor?
None that I know of.
I have code for something powerful but it's not general purpose.
meynaf is online now  
Old 07 March 2017, 15:58   #490
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
Quote:
Originally Posted by meynaf View Post
..Again it depends on the kind and size of data, but in some cases lzx can be easy to beat
..A small bootblock isn't the same as a 30MB wave file.
..I have code for something powerful but it's not general purpose.
Do You have something for audio data?
ross is offline  
Old 07 March 2017, 16:07   #491
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
Quote:
Originally Posted by ross View Post
Do You have something for audio data?
I may have something in this area, yes. Why, do you have nasty ideas to pack audio like crazy ?
meynaf is online now  
Old 07 March 2017, 16:42   #492
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
Quote:
Originally Posted by meynaf View Post
I may have something in this area, yes. Why, do you have nasty ideas to pack audio like crazy ?
Not nasty nor crazy (can be a language misunderstanding, is this a negative sentence?).
Simply some idea, as I have in so many other fields (only for fun and selflearning).
Nothing of lossless, but something about Adaptive DPCM (not IMA related), with quantisation table based on Amiga audio characteristic (mostly on PWM volume and not-DMA driving).
Until a few days ago I did not even know what it was the ADPCM...

Ciao
ross is offline  
Old 07 March 2017, 17:01   #493
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
Quote:
Originally Posted by ross View Post
Not nasty nor crazy (can be a language misunderstanding, is this a negative sentence?).
This didn't have a negative meaning. I just asked if you were into something big, unusual.


Quote:
Originally Posted by ross View Post
Simply some idea, as I have in so many other fields (only for fun and selflearning).
Nothing of lossless, but something about Adaptive DPCM (not IMA related), with quantisation table based on Amiga audio characteristic (mostly on PWM volume and not-DMA driving).
Until a few days ago I did not even know what it was the ADPCM...
Frankly i prefer lossless compression so I will not follow you there. Sorry.
meynaf is online now  
Old 07 March 2017, 17:14   #494
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
Quote:
Originally Posted by meynaf View Post
This didn't have a negative meaning. I just asked if you were into something big, unusual.


If I can do something I'll let you know
ross is offline  
Old 07 March 2017, 19:05   #495
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,036
Quote:
Originally Posted by ross View Post
smallest code+data final size, mmh, maybe a depacker for lzx, or already exists?

But the real problem here is the encoder part.
All this lz+huff(/ari) packers (zip, lzx, lha, lzma..), aside optimal parsing and great encoding, is facing another well defined problem: the split point for the entropy table rebuild.
The myriad of ZIP 'deflate' alternative varies in this matter: some euristic vs brute force... (kzip, zopfli, the same 7zip..).
You can have the best algorithms but is like the chicken and the egg causality dilemma: which is the best split point for the best entropy result for the best encoding , if encoding modify entropy which in turn modifies the split point?
And then, as you said, it all depends on the type of data

Back on the road: exists a decompressor for lzx (in optimized 68k code of course!) or similar powerfull compressor?

One of the best known me 68k is Arj mode 7 (better than LZX). Better is only hitchhikr's PackFire compressor, but has slow decompression, due mulu.http://www.pouet.net/prod.php?which=54840
Optimised PackFire depacker was used in one or two WT releases.
Don_Adan is offline  
Old 07 March 2017, 21:09   #496
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
Quote:
Originally Posted by Don_Adan View Post
One of the best known me 68k is Arj mode 7 (better than LZX). Better is only hitchhikr's PackFire compressor, but has slow decompression, due mulu.http://www.pouet.net/prod.php?which=54840
Optimised PackFire depacker was used in one or two WT releases.
Thanks for the info!

PackFire is LZMA based (entropy coder is arithmetic, so the mul).
Slow for 68k

Some test on ARJm7: beat original LZX practically everytime and is relatively fast!. I try to better understand how the encoding is.
But the 'new' LZX (https://wimlib.net/compression.html#LZX) beat ARJm7 (only tested a small sample of files).

We urge unpacker for the new LZX to test speed on 68k

ross is offline  
Old 08 March 2017, 09:11   #497
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
If you really like high compression ratios I suggest you try WinRK.
meynaf is online now  
Old 08 March 2017, 22:17   #498
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
Quote:
Originally Posted by meynaf View Post
If you really like high compression ratios I suggest you try WinRK.
Tks!

ross is offline  
Old 18 March 2017, 10:04   #499
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
Another idea for short code competition...

It's about a routine which takes some value as input (in a register).

It must output 4 flags in the 4 lower bits of another register, giving the following information :
- value fits in signed word (range FFFF8000-00007FFF)
- value fits in unsigned word (range 00000000-0000FFFF)
- value fits in signed byte (range FFFFFF80-0000007F)
- value fits in unsigned byte (range 00000000-000000FF)

Original value must not be altered. Other bits in the flags register are unimportant.
020+ is allowed, total size (including rts and eventual data) has precedence over speed.

If you need motivation, goal to beat is 42 bytes.
meynaf is online now  
Old 18 March 2017, 10:57   #500
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
Next try, did it in 32 bytes
I'm starting to believe it can't be done shorter...
meynaf is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting ASM coding on A1200. Which Assembler? Nosferax Coders. Asm / Hardware 68 27 November 2015 16:14
4th tutorial on ASM- and HW-coding Vikke Coders. Asm / Hardware 11 10 April 2013 20:32
3rd tutorial on ASM- and HW-coding Vikke Coders. Asm / Hardware 6 26 March 2013 15:57
First tutorial on ASM- and HW-coding Vikke Coders. Asm / Hardware 46 18 March 2013 12:33
2nd tutorial on ASM- and HW-coding Vikke Coders. Asm / Hardware 10 17 March 2013 11:49

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:17.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11088 seconds with 14 queries