Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Re: MMX speedup...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 26 Topic 4642 of 4724
Post > Topic >>

Re: MMX speedup for Floyd Steinberg error diffusion

by Terje Mathisen <spamtrap@[EMAIL PROTECTED] > May 9, 2008 at 09:03 PM

Robert Redelmeier wrote:
> rep_movsd <spamtrap@[EMAIL PROTECTED]
> wrote in part:
>> The thing is Floyd-Steinberg dithering works serially
>> one pixel at a time... Each pixel processed affects the
>> pixel to its right and the pixels on the next scanline.
> 
> Hmm ... this sounds a bit like the game of LIFE .
> It has seen some asm optimization that might be reelvant.

Indeed.

I was sure that I had the victory to "Dr Dobbs Second Annual Code 
Optimization Challenge" all sewn up:

I had very code data compression, I worked on four cells in parallel, 
and I used the minimum possible (i.e. 3) updates to modify the 
surrounding cells when anything changed.

David Stafford didn't only beat me, but he did so by a factor of two, by 
taking advantage of the fact that the 486 target cpu had an 8 KB L1 cache.

My algorithm did less work, and was faster when a lot of cells were 
alive, but after the first 200 generations or so, David's working set 
started to fit in L1 cache, and he blew me away from that point on. :-)

Anyway, FS works on the current pixel values, instead of being able to 
generate a new output bitmap in parallel for all cells/pixels.

On a real many-core cpu it might still make sense to run the algorithm 
in parallel:

Start core 1 on pixel (1,1). As soon as it finishes pixel (2,1) there 
will be no further updates to pixel (1,2), so the second core can start 
on this pixel at this time, right?

When the second core has finished the first two pixels, the third core 
can start on the third line etc.

In the limit, such an approach can reduce the problem from 
O(height*width) to O(height+width) as long as you have the resources 
needed for (height) scan lines, in the form of separate 
cores*number_of_scanlines_that_fit_in_registers.

Terje
-- 
- <Terje.Mathisen@[EMAIL PROTECTED]
>
"almost all programming can be viewed as an exercise in caching"
 




 26 Posts in Topic:
MMX speedup for Floyd Steinberg error diffusion
rep_movsd <spamtrap@[  2008-05-05 04:04:14 
Re: MMX speedup for Floyd Steinberg error diffusion
"Maarten Kronenburg&  2008-05-07 19:56:39 
Re: MMX speedup for Floyd Steinberg error diffusion
"Maarten Kronenburg&  2008-05-07 20:49:56 
Re: MMX speedup for Floyd Steinberg error diffusion
"Maarten Kronenburg&  2008-05-07 22:35:41 
Re: MMX speedup for Floyd Steinberg error diffusion
James Harris <spamtra  2008-05-07 16:26:13 
Re: MMX speedup for Floyd Steinberg error diffusion
rep_movsd <spamtrap@[  2008-05-08 00:57:41 
Re: MMX speedup for Floyd Steinberg error diffusion
Terje Mathisen <spamt  2008-05-08 18:00:18 
Re: MMX speedup for Floyd Steinberg error diffusion
"Maarten Kronenburg&  2008-05-08 17:14:21 
Re: MMX speedup for Floyd Steinberg error diffusion
Robert Redelmeier <red  2008-05-09 14:19:08 
Re: MMX speedup for Floyd Steinberg error diffusion
Terje Mathisen <spamt  2008-05-09 21:03:11 
Re: MMX speedup for Floyd Steinberg error diffusion
rep_movsd <spamtrap@[  2008-05-08 07:23:41 
Re: MMX speedup for Floyd Steinberg error diffusion
Jim Leonard <spamtrap  2008-05-08 13:48:14 
Re: MMX speedup for Floyd Steinberg error diffusion
Terje Mathisen <spamt  2008-05-09 10:21:40 
Re: MMX speedup for Floyd Steinberg error diffusion
rep_movsd <spamtrap@[  2008-05-09 00:24:23 
Re: MMX speedup for Floyd Steinberg error diffusion
Terje Mathisen <spamt  2008-05-09 15:31:53 
Re: MMX speedup for Floyd Steinberg error diffusion
Phil Carmody <thefatph  2008-05-09 17:18:44 
Re: MMX speedup for Floyd Steinberg error diffusion
Terje Mathisen <spamt  2008-05-09 21:03:09 
Re: MMX speedup for Floyd Steinberg error diffusion
rep_movsd <spamtrap@[  2008-05-10 00:28:25 
Re: MMX speedup for Floyd Steinberg error diffusion
Terje Mathisen <spamt  2008-05-10 21:25:29 
Re: MMX speedup for Floyd Steinberg error diffusion
Phil Carmody <thefatph  2008-05-10 22:48:49 
Re: MMX speedup for Floyd Steinberg error diffusion
Phil Carmody <thefatph  2008-05-10 22:07:04 
Re: MMX speedup for Floyd Steinberg error diffusion
rep_movsd <spamtrap@[  2008-05-10 02:28:42 
Re: MMX speedup for Floyd Steinberg error diffusion
Terje Mathisen <spamt  2008-05-10 21:17:34 
Re: MMX speedup for Floyd Steinberg error diffusion
rep_movsd <spamtrap@[  2008-05-11 01:33:13 
Re: MMX speedup for Floyd Steinberg error diffusion
Phil Carmody <thefatph  2008-05-11 13:14:37 
Re: MMX speedup for Floyd Steinberg error diffusion
rep_movsd <spamtrap@[  2008-05-11 01:25:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 20 17:38:19 CDT 2008.