Re: OpenMP in CinePaint?
Bob Friesenhahn <[email protected]> Fri, 21 Nov 2008 19:48:40 -0600 (CST)
| Newsgroups | gmane.comp.video.cinepaint.devel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 21 Nov 2008, Robin Rowe wrote:
> A batch program like GraphicsMagick would seem to get more benefit from
> OpenMP. If you want to send a patch though, please do.
Robin,
Any C language program which spends substantial time in repetitive
time consuming code (i.e. any C program which includes image
processing) can benefit from OpenMP. It does not matter at all if the
program is more interactive or more batch oriented. The key thing is
that any code which is run in parallel needs to be thread safe, or
able to be modified to become so.
For example, here is a bit of OpenMP enhanced code which saved
considerable time via OpenMP and only required that one extra line
(the pragma) be added:
#pragma omp parallel for schedule(guided)
for (i=0; i <= (long) MaxMap; i++)
{
if (levels.level_red)
levels.map[i].red=
ScaleMapToQuantum(MaxMap*pow((double) i/MaxMap,1.0/gamma.red));
if (levels.level_green)
levels.map[i].green=
ScaleMapToQuantum(MaxMap*pow((double) i/MaxMap,1.0/gamma.green));
if (levels.level_blue)
levels.map[i].blue=
ScaleMapToQuantum(MaxMap*pow((double) i/MaxMap,1.0/gamma.blue));
}
Bob
>
> Robin
>
> Bob Friesenhahn wrote:
>> Are there any plans to update CinePaint to take advantage of multiple CPU
>> cores via OpenMP? I have done this for GraphicsMagick with spectacular
>> results (http://www.graphicsmagick.org/OpenMP.html). Maybe CinePaint can do
>> the same?
>>
>> Bob
>> ======================================
>> Bob Friesenhahn
>> [email protected], http://www.simplesystems.org/users/bfriesen/
>> GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
>>
>>
>
>
> --
> Robin Rowe
> CinePaint Project Leader
> Beverly Hills, California
> www.CinePaint.org
> www.cinepaint.blogspot.com
> www.linkedin.com/in/robinrowe
>
======================================
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/