[sldev] OpenJPEG, 25% faster

Callum Lerwick seg at haxxed.com
Fri Aug 10 00:01:54 PDT 2007


I'm not sure what upstream is up to, I submitted the first batch of
these but haven't seen them in SVN yet. The fact that they're apparently
still using Visual Studio 6 seems to be kind of a hitch. (not fully c99
compliant...) I wanted to get this all out there in case I get hit by a
bus or something.

My main performance test is the mj2 codec, get the Speedway example:

http://www.openjpeg.org/samples/Speedway.yuv

Encode it like so:

frames_to_mj2 -i Speedway.yuv -o Speedway.mj2 -I 1

Then decode it:

mj2_to_frames Speedway.mj2 Speedway2.yuv

On my Athlon 64 3000+, before patching:

Total decoding time: 13.34 seconds (15.0 fps)

And after patching:

Total decoding time: 9.88 seconds (20.2 fps)

A 26% speedup. Overall speedup is around 25%.

Prebuilt rpms for Fedora are here:

http://www.haxxed.com/rpms/secondlife/

Patches are here:

http://www.haxxed.com/code/

Use the openjpeg.series to get them in the right order.

I've submitted everything up to t1-autovectorize upstream, everything
later is likely messy and possibly questionable.

Note that the DWT vectorization is probably gcc specific, I know icc is
lame and doesn't let you simply multiply and add vector types. I put in
non-vectorized fallback code that's just a straight translation of the
SSE code. Its still faster than the old fixed point code. :) I also
converted the irreversible MCT to floating point, allowing me to get rid
of several rounds of casting from int to float and back. The
irreversible (lossy) decode is now faster than the reversible
(lossless).

Please test! Especially on platforms that aren't Linux/gcc/x86/x86_64...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.secondlife.com/pipermail/sldev/attachments/20070810/421eeac4/attachment-0001.pgp


More information about the SLDev mailing list