[sldev] OpenJPEG, 25% faster

Paul TBBle Hampson Paul.Hampson at Pobox.com
Fri Aug 10 20:33:50 PDT 2007


On Fri, Aug 10, 2007 at 02:01:54AM -0500, Callum Lerwick wrote:
> Patches are here:

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

I had a quick go (compile-tested only) and three things came up:

dzonatas.20070407.dwt.patch is at -p0, the rest are at -p1. This
means
for d in `cat ../../callum/openjpeg.series`; do echo $d; patch -p1 < ../../callum/$d; git-commit -m "$d" -a; done
didn't work to slap the patches on top of a git-svn checkout I just
did of openjpeg.

gcc needs -std=c99 in the cflags to recognise the 'restrict' keyword.

mm_alloc.h and _mm_malloc are x86-specific. A test for __MMX__ would
prolly catch it on gcc, and I presume it's always available on MSVC,
since it's not actually using any of the MMX stuff (despite the name)

On non-x86, posix_memalign looks like the only portable way to go, and
it needs #define _XOPEN_SOURCE 600 or #define GNU_SOURCE.

And of course its signature doesn't match malloc, so you can't just
#define around it.

Maybe if not pulling in _mm_malloc, you could implement an inline
wrapper function around posix_memalign. (I would, but I just read
the gcc implementation thereof, and OpenJPG's under a BSD license
so I want some time to forget it) ^_^

This is on gcc 4.1 on PowerPC Linux.

-- 
-----------------------------------------------------------
Paul "TBBle" Hampson, B.Sc, LPI, MCSE
Very-later-year Asian Studies student, ANU
The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361)
Paul.Hampson at Pobox.com

Of course Pacman didn't influence us as kids. If it did,
we'd be running around in darkened rooms, popping pills and
listening to repetitive music.
 -- Kristian Wilson, Nintendo, Inc, 1989

License: http://creativecommons.org/licenses/by/2.1/au/
-----------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.secondlife.com/pipermail/sldev/attachments/20070811/dca0c55d/attachment-0001.pgp


More information about the SLDev mailing list