Home | Reviews | GUIpedia | Forum | Fun500


agumaCompression Algorithms
Does anybody know any sort of simple ones besides LZW and RLE? If you do, please reply. Thanks! :)
2008-08-241:57 PM

ksrRe:Compression Algorithms
Huffman is a good one; it's used in MP3s and JPEGs. Reading about it, it seems simple enough, but I've never tried to implement it. http://en.wikipedia.org/wiki/Huffman_coding edit: Although in the article, it says LZW often has better compression, and it's probably simpler.
2008-08-241:59 PM

ToddRe:Compression Algorithms
Huffman is pretty simple to learn. It's mainly for demonstrations these days but it's the base for many different compression algorithms.
2008-08-243:26 PM

agumaRe:Compression Algorithms
Well, my goal is for it to be able to compress Fun500 4's GUI.EXE. Right now my compressor isn't optimized at all, so I probably won't be able to -- yet. I'll keep editing this and telling my progress. :) Stay tuned lol 8:51 AM: W00T I can compress THE/RAIN/IN/SPAIN/FALLS/MAINLY/ON/THE/PLAIN!!!
2008-08-2511:46 AM

agumaRe:Compression Algorithms
Sorry for double posting, but otherwise nobody would notice I posted this. :P Anyway, I'm having some trouble optimizing one thing. There's a problem when you have a string with a bunch of the same characters, for example SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS it compresses it, but the dictionary looks like this: S SS SSS SSSS SSSSS SSSSSS SSSSSSS how do I get rid of that?
2008-08-2512:23 PM

ToddRe:Compression Algorithms
I'd have to see the code. My guess is that it's trying to compress it by looking for a replacement for the one preceding it. So "S" would be "SS" and then it replaces "SS" with "SSS", and so on and so on.
2008-08-252:07 PM

agumaRe:Compression Algorithms
Well I'm using a slightly modified LZW algorithm, and it's supposed to happen, but I don't know how to make it work right. looooool :laugh:
2008-08-252:08 PM

SonicBritRe:Compression Algorithms
Due to the way it has to build up the dictionary it can only include stuff from the actual stream itself (hence why it will duplicate), you could however scan the file first and create a dictionary file and then using that as the symbols instead. Eg instead of @ (64), you could encode the word 'the' etc.. That is where huffman is also useful because you are dealing with weights (frequencies), so if a word is duplicated more then the higher up the tree it will exist, and the smaller bits used to reference (encode) that word. (I hope that makes sense), basically a similar technic is used to compress the qbasic help files.
2008-08-2510:36 PM

Other


2021 Brandon Cornell