Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user jmi ! (Registered 2024-09-15) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > WANTED: Packer for "Solid Archive" Memory Depacking
2022-04-13 00:07
chatGPZ

Registered: Dec 2001
Posts: 11290
WANTED: Packer for "Solid Archive" Memory Depacking

I was just looking for this and apparently it doesnt exist, a packer that covers the following usecase:

- pack many small files into one chunk of packed data
- uses dictionary and whatever other lookup data for all files
- depacker allows to depack individual files of that chunk into memory (randomly)

Think of eg a music collection - there you have many relatively small files which are very similar (or even identical) in large parts (the replayer code). With this kind of data you'd get a much better ratio when building a dictionary across all the files instead of packing each file separately.

I know one of you packer dudes are bored at easter.... :)
2022-04-13 04:20
Martin Piper

Registered: Nov 2007
Posts: 698
I did this for the Hunter's Moon video sequences. The dictionary helped compression where the scene was drawing or replacing areas of the screen across several different frames.
2022-04-13 04:26
ChristopherJam

Registered: Aug 2004
Posts: 1402
Would you care to provide an example test corpus?

Also, I assume you just want some kind of "Unpack chunk #n" API, where you load an index register with the chunk number before calling decrunch, and the decruncher determines the destination address from information in the archive?
2022-04-13 10:03
Martin Piper

Registered: Nov 2007
Posts: 698
Is all the data meant to be in memory? For example:
$400-$7fff is the demo code
$8000-$afff is a fixed address for uncompressed music
$b000-$fff0 is all compressed data and the decompression API.

Where you can do:
lda #[0-xx] ; Choose the "file number"
jsr $b000 ; Decompress the "file number" into $8000
2022-04-13 12:27
chatGPZ

Registered: Dec 2001
Posts: 11290
Quote:
Would you care to provide an example test corpus?

you could just use ... eg the gt2 example tunes for a test :)
Quote:
Also, I assume you just want some kind of "Unpack chunk #n" API, where you load an index register with the chunk number before calling decrunch

exactly
Quote:
the decruncher determines the destination address from information in the archive?

thats a detail that should be optional imho, saving the destination address in the file or not, and being able to override it when depacking. i can see usecases for all of that :)
Quote:
Is all the data meant to be in memory?

Yes.

But don't get too specific on the "music" usecase - it could also be videoframes to be played in any order which are not always depacked to the same location because of double buffering.
2022-04-18 03:45
Martin Piper

Registered: Nov 2007
Posts: 698
In this case, example logic of the compression algorithm would be: "if there are long strings of literals, or its more efficient to encode a copy from the global dictionary instead of a copy from the uncompressed data, then include that data in the dictionary."

So there would be:
Literal
Copy range from uncompressed data
Copy range from global dictionary data

Hmm...
2022-04-25 11:42
TBH

Registered: Mar 2010
Posts: 21
There may be some cases where it would be useful to encode the packed data relationally and provide a relative offset.

So, for strings of character values (a=0, b=1, etc):
abcde, bcde, cde, de, e
and
fghij, ghij, hij, ij, j

Store only the data:
"abcde"

Then access with the Index 0-4 plus an offset of either 0 or 4 (perhaps packed).

So to retrieve "hij":
Index = 2, offset = 7

The above is contrived, and would rely on there being many patterns that can be transposed in some manner, but this approach might be useful.
2022-04-25 11:50
Krill

Registered: Apr 2002
Posts: 2940
Quoting TBH
There may be some cases where it would be useful to encode the packed data relationally and provide a relative offset.
Compression based on shortest common superstring is implemented in Compactor V2.0 .
2022-04-29 17:20
Martin Piper

Registered: Nov 2007
Posts: 698
Interesting. With a short test of four music files, to test the sparse common data dictionary:

Total original data size: 3064 + 2811 + 4228 + 2607 = 12710 bytes

Compressed without dictionary: 2190 + 2278 + 2969 + 2051 = 9488 bytes

Compressed with 1024 byte dictionary: 1581 + 1909 + 2641 + 1733 = 7864 bytes

Bytes saved in compressed data due to dictionary: 9488 - 7864 = 1624 bytes
- 1024 bytes from original dictionary = 600 bytes


The 1024 byte dictionary was filled after the second file, which is why the first file benefits most from the dictionary. However all files do show some benefit from the dictionary.

The benefit of the dictionary increases if more files, sharing at least some common data, are compressed.

I need to write a 6502 decompress now...
2022-04-29 17:24
Martin Piper

Registered: Nov 2007
Posts: 698
The common data for these music files seems to be the note hi/lo table values and some position independent code.
2022-04-29 17:44
chatGPZ

Registered: Dec 2001
Posts: 11290
Don't get too focussed on that example - there are many other usecases :)
 
... 8 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Courage
Da Snake
Scooby/G★P/Light
REBEL 1/HF
bugjam
Matt
Sychamis
E$G/HF ⭐ 7
WVL/Xenon
megasoftargentina
alwyz/udi
tlr
Guests online: 145
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Uncensored  (9.6)
7 Wonderland XIV  (9.6)
8 Comaland 100%  (9.6)
9 No Bounds  (9.6)
10 Unboxed  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Onscreen 5k  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Morph  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Nostalgia  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.2)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 Tim  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.046 sec.