Monday, April 23, 2007

SPE-JPEG


SPE-JPEG is my first project for CELL.
It is a tiny jpeg decoder suitable for texture decompression.
Only 4:2:0 mode, 16-aligned dimensions, no restart markers.
So far it is mainly scalar prototype code, but the bitstream and huffman decoding are coded specifically for SPE's 128 bit vectors.

Performance of scalar code on SPE is frustrating.
20 msec (- ~1.5 msec for spe code loading) to decode this 512x384 image vs. 4 msec on Athlon64 2Ghz.

TODO: SIMD iDCT + colorspace conversion, input stream double buffering (right now the whole image is in spe memory), optimization ;)