Firstly apologies in advance if anyone has any objections to this.

I reversed a proprietary compression algorithm a while ago, but I don't really have enough knowledge with compression algorithms in general to be able to identify what it is (or even really understand what it does).
You can see my decompiled C code here: http://pastebin.com/ENeR1Uw0
This is a compressor only - I don't have decompression code.

Note:
  • All names (variables/functions etc) and comments are completely made up by me, and may very likely be misleading/incorrect
  • This compression algorithm is used on the PSP for compressing internal firmware resources, as well as distributable theme files
  • I may have stuffed up the code somewhere, since I suck at decompiling code, but it does seem to generate the same thing that the application it's reversed from does
  • The application uses the algorithm by supplying the relevant buffers/lengths to function I named "rlzcompress". For the "mode" argument, the application tries mode=5, then mode=6, then mode=7 and picks smallest size output of these three, as the final output
  • Compression seems to be more efficient (in terms of compression ratio) than zlib
  • Apologies for messy code


Thanks in advance for any assistance!