SansGrip
26th November 2002, 22:58
I'm currently attempting to port FluxSmooth to MMX and my brain isn't cooperating at all. Here's the algorithm, in a depressingly small nutshell:
cpel = pel from curr frame
ppel = pel from prev frame
npel = pel from next frame
if (cpel < ppel and cpel < npel) or (cpel > ppel and cpel > npel)
sum = mean of immediate temporal neighbours within temporal threshold
sum += mean of immediate spatial neighbours within spatial threshold
new pel = sum / count of values in sum
I've figured out the conditional part and have the code for it, but it's the averaging that I'm having the biggest difficulty with. Life would be fine if I could keep everything in packed bytes and use pavgb, but I fear the cumulative error would be substantial. The only alternative I can see is to process two pels at a time and work with packed words.
I read the C3D source but it made me even more confused. Would any kind soul out there be able to push me in the right direction? I think once I have an idea of how to proceed I'll be able to code it up fairly easily. It seems to be getting started that's the hard part...
Any help would be much appreciated.
cpel = pel from curr frame
ppel = pel from prev frame
npel = pel from next frame
if (cpel < ppel and cpel < npel) or (cpel > ppel and cpel > npel)
sum = mean of immediate temporal neighbours within temporal threshold
sum += mean of immediate spatial neighbours within spatial threshold
new pel = sum / count of values in sum
I've figured out the conditional part and have the code for it, but it's the averaging that I'm having the biggest difficulty with. Life would be fine if I could keep everything in packed bytes and use pavgb, but I fear the cumulative error would be substantial. The only alternative I can see is to process two pels at a time and work with packed words.
I read the C3D source but it made me even more confused. Would any kind soul out there be able to push me in the right direction? I think once I have an idea of how to proceed I'll be able to code it up fairly easily. It seems to be getting started that's the hard part...
Any help would be much appreciated.