y4mdenoise does that sort of threading internally.  It'll denoise the intensity 
plane and color plane separately, plus it has reader threads and writer 
threads.  I wrote a small thread-related class hierarchy that should be 
reusable.  If nothing else, it should be inspirational.

BTW, you probably don't want to literally assign a thread to each individual 
line -- the system-call overhead of the semaphores would more than outweigh 
your processing time.  Mutexes are by no means free.


Hope that helps.

Steven Boswell



________________________________
From: Mark Heath <mjp...@silicontrip.org>
To: MJPEG-tools user list <mjpeg-users@lists.sourceforge.net>
Sent: Wednesday, September 21, 2011 3:21 PM
Subject: [Mjpeg-users] writing multi threaded code

Hi Guys,

I'm wondering if anyone has some skeleton C code for writing  
multithreaded filters.

Similar to this kind of pseudo code;

while not end of file {

    read frame

    create threads (number of CPUs)

    for y = 1 to height {

        while no available threads  { wait for a thread to finish; }

        run in thread { for x = 1 to width { process pixel} }
    }
    write frame
}

I've written a temporal bilateral filter and an nl-means filter and  
they are slow, so was looking to speed things up on my multi cpu  
machines.

If not, I'll see if I can generate my own skeleton.

Thanks
Mark

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to