The user by nick chr, and maybe he alone, knows how to encode.
The thread you need is:
Emulating Digicam with QEMU which shows you how to emulate the firmware using qemu.
I've successfully done this in order to compile diskboot.bins for the ixus90.
You need to pretty much follow chr's directions exactly. Then you have a system where you can compile, then encode the firmware. The easiest way to do this is to use the firmware that chr mentions in that thread (instead of your own for your camera) unless you already know the memory location of the encoding function in your own firmware. It would be much easier however if yes, someone decoded the algorithm in the firmware (it's not chr's algorithm, it's a function in the firmware. What chr explains how to do in that thread is import the compiled diskboot.bin into memory, call the function to act on the data, which encodes it, then write it back out to file. If you look at what he uses to write the encoded data to file you will see he starts from the memory location he wrote to initially minus 1, which takes into account the requirement of having diskboot.bin start with 0x00).
If you're firmware is massive, you may need to update your compiler. I suggest using what the wiki says do use exactly as you know it will then work.