Impossible. I've done my best but in this case the only way to have it aligned would be to copy it at an aligned location. Not sure this is the best thing to do to achieve high speed.
Posted on 2004-01-16 07:14:54 by Chrishka
Hrm... {$ALIGN} directive might help you? I dunno if it works only on records or if it can be used on data variables too, and whether you can specify alignment in the directive. Try a {$A8} ? The compiler really ought to have settings for default data alignment, at least all C++ compilers I know have - and I think Delphi does too, if you dig deep enough?
Posted on 2004-01-16 07:17:38 by f0dder
the data is already aligned, but the way the algorithm works will always create unaligned access to memory. I have an array of byte aligned by 16, but it's not read at +0, then +16, ect... it's read at +0, then +1, +2, etc... in a loop, so as soon as the second iteration is executed, exception raises...
Posted on 2004-01-16 07:33:11 by Chrishka
Hm, sounds pretty bad... perhaps if you post some info on the algorithm, some of the clever heads here can help optimize it?
Posted on 2004-01-16 07:37:56 by f0dder
unfortunately I'm not allowed to do that
Posted on 2004-01-16 07:49:49 by Chrishka
Perhaps you can give a clue as to what the purpose of the code is?
Posted on 2004-01-16 07:55:02 by f0dder
the purpose is video compression, it's integer motion estimation that's bugging me. I've coded a SSE sum of absolute difference for 16x8 and 16x16 blocks, but integer motion estimation calls the SAD with x=0, x=1, etc... I thought it would do x=0, x=16... but it appears not.
Posted on 2004-01-16 08:35:26 by Chrishka
Perhaps there's some smart trick around this? Like computing ahead and returning subset results? I don't really have any clue how this stuff works, and I'm not that much of an algorithm guy anyway... but there's surely some clever heads around here that could shuffle out some tricks... perhaps start a new thread in main, with an algorithm description (as much as you're allowed to disclose) plus some of the problems you've ran into...
Posted on 2004-01-16 08:43:37 by f0dder
ok, thanks a lot for helping me out
Posted on 2004-01-16 09:18:12 by Chrishka