10-25-08 - 2

You can't use floating points in compression generally because it makes you non-platform-independent due to little differences in the internal precision and so on. But if you were okay with being locked to one platform and one particular FPU (for example, say on Xenon or Cell), I wonder if you could do a very fast arithmetic coder using floating points. A normal arithmetic coder does an integer divide which is usually slower than an FPU divide by quite a bit. And you might even be able to use the fast reciprocal estimate instead of the divide, as a standard kind of giving of some compression for speed. Of course you have to turn your float back into an int to get bits in & out of the code stream and such, but you may be able to do that quickly with a magic number addition or something like that, since you know your floats will be in a limited range. I think the hardest part would be making sure all the float->int parts were fast, not the range update.

No comments:

old rants