ReLEna - The Past Of File Archiving

You can post anything you want in here! Woohoo!

Moderators: beyonder, Pez-Man

User avatar
Twilkitri
Pez-Ruler
Pez-Ruler
Posts: 1484
Joined: Sun May 19, 2002 10:20 pm
Location: Australia

ReLEna - The Past Of File Archiving

Post by Twilkitri »

http://content.thegreatbeyond.net:8080/ ... relena.htm

Hey... I've actually got a program up!
Just something I thought I'd try, so I knocked it together in 2 or so days. I can't hope to compete with stuff like ZIP/RAR... so I've gone the other direction, back to RLE. Fun.

Might incorporate some of the later compressions into it later, though.

Only V1.0A at the moment, so if it doesn't work and decides to delete explorer.exe, don't come crying to me.

Tell me ways to make it better. You know you want to.
User avatar
Twilkitri
Pez-Ruler
Pez-Ruler
Posts: 1484
Joined: Sun May 19, 2002 10:20 pm
Location: Australia

Post by Twilkitri »

I know that you were all just waiting for the next version before you replied.

And it's up! V1.1 of ReLEna is now available. With better compression than 1.0A and support for decoding old 1.0A encoded files (but you can't encode in 1.0A... why would you want to?).

Next... status boxes. *shudder* More GUI stuff... sigh...

Tell me what you think/want. You know you want to.

Oh, and I put a comparison up on the ReLEna page comparing it to WinZip. It's not very good... but ReLEna does have an advantage over WinZip. It's smaller. MUCH smaller. Not that WinZip's very big to begin with, but...
User avatar
Jo-chan
Pez-Priest
Pez-Priest
Posts: 700
Joined: Fri Aug 30, 2002 11:17 am
Location: Mt. Plushmore
Contact:

Post by Jo-chan »

.....I hate to say it, DT, but I've never even heard of that kind of extension before. Therefore I really have no use for the program. o_o;; But from the screenshots you provided, it looks like you did a great job with it, so keep it up. ^_^
"Which class did you ass?" -- Chromus
"What does it mean to ass a class?" -- Pez-Man
"Err, add........damn you." -- Chromus
"DRILLMAN bionic nemisis of MegaMan" -- ebay quote
Pez-Man
Pez-Man
Posts: 3427
Joined: Sat May 18, 2002 6:54 pm
Contact:

Post by Pez-Man »

It looks like it works, but I have no idea what it does! And now I get a long, spread-out explanation!
User avatar
Twilkitri
Pez-Ruler
Pez-Ruler
Posts: 1484
Joined: Sun May 19, 2002 10:20 pm
Location: Australia

Post by Twilkitri »

Jo-chan wrote:.....I hate to say it, DT, but I've never even heard of that kind of extension before.
That would be because I created it to use with ReLEna. And when I say 'created', I mean 'stole from some old graphics type that no-one uses anymore, let alone has heard of'.

Pez-Man. You know what WinZip does right? Well that's basically what ReLEna does. Except it can only work with .rle files, and not .zip files.
User avatar
chromus
Pez-Ruler
Pez-Ruler
Posts: 1704
Joined: Tue Aug 13, 2002 9:24 pm
Contact:

Post by chromus »

Alright, it looks like it's time for me to interject some science here.

Run-length encoding is a form of compression. Let's take an example from DT's website:

This is the string that you're trying to compress:
abbccceeeek esdfddd

Using run-length encoding, it can be shortened to this:
1a2b3c4e1k 1e1s1d1f3d

Neat, no?

Run-length encoding was one of the first kinds of compression to come about, and it seems to be very common sense, but there are many problems with it. When implemented incorrectly, a file full of random values actually becomes larger using run-length encoding than without, due to encoding the lengths of all the single character "runs", like so:

Original string:
abcdef

Compressed:
1a1b1c1d1e1f

Run-length encoding only works well for files where you get a lot of repeating values, like in monochrome bitmaps, where you only have black and white pixels.

When DT says he "made up the extension", all he really did was designate a three letter combination to work with his program. Funny enough, the extension ".rle" was originally used for pictures that were compressed using run-length encoding.

DT: You need to investigate a compression technique called a Huffman tree after you get ReLEna to work. It's a wonderful compression algorithm that works wonders. The greatest thing is, a library called ZLib implements free, open-source compression using both a Huffman tree and run-length encoding, so you can check out their source code to get some ideas.
User avatar
Twilkitri
Pez-Ruler
Pez-Ruler
Posts: 1484
Joined: Sun May 19, 2002 10:20 pm
Location: Australia

Post by Twilkitri »

Well, I fixed ReLEna so that it doesn't need to include lengths of 1 anymore... usually. I've got the maximum run length specified atm to be 20, but I'm gonna muck around with that later and try and get better compression.

The lengths are stored in the final values of the byte (ie: 236-255 (or, in Java's case, -1 to -20. *shudder* you have no idea how long it took me to figure that out. In Java, a byte, instead of being 0-255, is -127 to 127.)) which means any values between 0 - 235 can be used as single values. If you have a single value between 236 - 255, you have to put 236 (1) first. So, the higher the max run length, the more single values which will need a 1 in front of them. I'm going to try a dynamic type where it scans the file for the longest run length and uses half of that for the maximum, eventually, and see how that works (or 128 if the max is over 256). A good thing about RLE - the decoder doesn't care what the maximum run length is, and'll work with anything.

I got a few compression books out of the Uni library, and I'm going to look at some of the stuff later. I'm aiming to get ReLena finished, then put an LZ77 (or something like it) over the top, and see how that works. *shudder* one of the books says that you should RLE by putting the character, then it's length, then a 'special character' to let the decoder know that that part was compressed :/
I think I'll find this sort of stuff easier if I can find some form of Bit I/O in Java. I don't _need_ it for anything (except the header, and I put together something for that... but it's too long...) but stuff'd be easier if I knew how to do Bit I/O.

Oh, and can people please d/l the thing and try to run it, even if you're not going to use it? Because I downloaded it at Uni, and
a) it made it a zip file, understandable since JARs are zip-compressed, but Windows shouldn't give it a zip extension like that.
b) it wouldn't run... I'd have loaded it up in BlueJ (crap Java compiler that the Uni uses) but I couldn't be bothered. I checked the manifest file and it was correct, so it should have run, but it didn't.

Anyway, I want to see if people have any problems getting it to run.
Pez-Man
Pez-Man
Posts: 3427
Joined: Sat May 18, 2002 6:54 pm
Contact:

Post by Pez-Man »

Isn't it great how Beyonder, Chromus, and DT might be the only people who actually understand what the crap they're talking about here?
User avatar
Jo-chan
Pez-Priest
Pez-Priest
Posts: 700
Joined: Fri Aug 30, 2002 11:17 am
Location: Mt. Plushmore
Contact:

Post by Jo-chan »

Here, here. o_o
"Which class did you ass?" -- Chromus
"What does it mean to ass a class?" -- Pez-Man
"Err, add........damn you." -- Chromus
"DRILLMAN bionic nemisis of MegaMan" -- ebay quote
Pez-Man
Pez-Man
Posts: 3427
Joined: Sat May 18, 2002 6:54 pm
Contact:

Post by Pez-Man »

Where, where?
User avatar
beyonder
Webmaster
Webmaster
Posts: 672
Joined: Mon May 20, 2002 7:53 pm
Location: my house.
Contact:

Post by beyonder »

There, there.
User avatar
chromus
Pez-Ruler
Pez-Ruler
Posts: 1704
Joined: Tue Aug 13, 2002 9:24 pm
Contact:

Post by chromus »

Don't bother with LZ77 compression. It's the type of compression used in ZIP files and it's covered by a patent, so you can get sued for using it. Check out ZLib compression.
User avatar
Twilkitri
Pez-Ruler
Pez-Ruler
Posts: 1484
Joined: Sun May 19, 2002 10:20 pm
Location: Australia

Post by Twilkitri »

Wasn't it LZ78/LZW which was patented? I know that LZW is patented by UniSys... I didn't think that LZ77 was patented...
User avatar
chromus
Pez-Ruler
Pez-Ruler
Posts: 1704
Joined: Tue Aug 13, 2002 9:24 pm
Contact:

Post by chromus »

Sorry, acronym confustion there. DT, you're right, LZW is the method of compression patented by Unisys, and LZ77 is the method of compression that I was talking about in the first place.

Second error, LZW is not the compression scheme used in ZIP files, but GIF files. ZIP files use a variant of LZ77.
User avatar
Jo-chan
Pez-Priest
Pez-Priest
Posts: 700
Joined: Fri Aug 30, 2002 11:17 am
Location: Mt. Plushmore
Contact:

Post by Jo-chan »

Isn't there also a .LHA extension? All those Kisake dolls use that extension, I think.
"Which class did you ass?" -- Chromus
"What does it mean to ass a class?" -- Pez-Man
"Err, add........damn you." -- Chromus
"DRILLMAN bionic nemisis of MegaMan" -- ebay quote
Post Reply