VOGONS


First post, by Harry Potter

User metadata
Rank Oldbie
Rank
Oldbie

Hi! I successfully debugged one of my compression techniques several times recently, but each time, the compression ratio was poor. 🙁 I believe it's because I was using MTF without anything else and hash tables for LZ77. I got another technique to do very well, but when I applied hash tables to its LZ77, I lost big points with its compressibility. 🙁 Worse yet, it cost well over 8k for its table, and I'm coding for 8-bit systems, where memory is at a premium. 🙁 I'm looking for a better way that requires much less RAM and produces much better results. It can be slightly slower. Any suggestions?

BTW, I want to implement BWT and a better form of BPE. I'm currently using a method of BPE that acts like LZ77 and compresses very recent occurrences better. I really think I should use a form of tokenization there and compress the most often-occurring words better but need a more efficient method to do so. Any ideas?

Joseph Rose, a.k.a. Harry Potter
Working magic in the computer community

Reply 1 of 4, by Zup

User metadata
Rank Oldbie
Rank
Oldbie

Have you looked at zx7?

Einar Saukas made it as a decompressor for ZX Spectrum. The uncompress routine is very small (69 bytes in assembler, and not too much more while decompressing), but the compression is made offline (using a PC). It is used often to store code, graphics and text and decompress it on-the-fly...

Pros:
- Very small decompressor.
- Very small memory usage.
- It can give you some ideas.

Cons:
- Compression is made on a PC (do you really need to compress data on your 8-bit system?).
- It is LZ77/LZSS, as you wished.
- Not the best compression ratio, but still very efficient. Other works from Einar Saukar are more efficient, and can help you too.

I have traveled across the universe and through the years to find Her.
Sometimes going all the way is just a start...

I'm selling some stuff!

Reply 2 of 4, by Harry Potter

User metadata
Rank Oldbie
Rank
Oldbie

I have ZX0 and based some of my techniques on it, and right now, one of them is doing better than its main competitor. I don't need to do it on an 8-bit system. In fact, I plan to implement it on 32-bit Windows and ANSI C. I'm just working on it for 8 bits for now. My problem now is that right now, it's very slow. Hash tables helped but not enough, and the table requires well over 8k of memory and produced very poor compression ratio. That's why I'm asking.

Joseph Rose, a.k.a. Harry Potter
Working magic in the computer community

Reply 3 of 4, by Harry Potter

User metadata
Rank Oldbie
Rank
Oldbie

I looked at ZX7 and didn't find any source code. 🙁 I may come back soon to ask for more ideas but am not ready for them right now.

Joseph Rose, a.k.a. Harry Potter
Working magic in the computer community

Reply 4 of 4, by Harry Potter

User metadata
Rank Oldbie
Rank
Oldbie

This is a little premature, but how can I implement BPE efficiently? I'm currently using a LZ77 variation to do BPE's job but think the original's tokenization design should be better. I don't want to go through the file many times and keep tabs of every possible token, though. A better approach doesn't have to produce 100% best results but require little RAM and CPU time. As I said, I want to work on BWT soon. I should still have code left over from a previous experiment with it, but it was very inefficient.

Joseph Rose, a.k.a. Harry Potter
Working magic in the computer community