Re: unsharp mask

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 23.11.2010 16:11, schrieb bioster:
>> On 11/23/10 08:24, Patrick Horgan wrote:
> 
>> What is the aim here? Unless I've missed the point, it seems like a 
>> trade-off between computation time for the matrix and memory footprint 
>> of storing all the possible values that matrix could hold.
> 
>> That's fairly bit of memory to grab if there's not a real need. How long 
>> does it take to calculate matrix each time? Is this even a noticeable 
>> proportion of the time required to apply the filter to an image?
> 
>> If I've got the wrong end of the stick, what is the problem with the 
>> current code?
> 
>> regards.
> 
> I think they're talking about trading off between spending CPU time computing the matrix and spending memory storing it precomputed.
> 
> I think I disagree with you about it being a "fair bit of memory".  30-40k of memory in't a big deal by today's standards, and when you put that beside a modestly sized image which can easily run a few megabytes, I would consider it entirely reasonable.  That's assuming you release that memory after your unsharp tool is done.  The computation time is probably in the same class... my computer is fairly brisk and I don't think the time spent computing the matrix is noticable.

Don't forget about code size and the size of memory allocated for the
matrix - this also takes up a certain amount of memory. Maybe not
30-40k, but the difference between run-time computed and pre-computed
values would not be that big, but...

> So it's not that there's a "problem" with the current method, they're just pondering whether they can squeeze better performance out of it by making the tradeoff.

And this is the real trade-off: trading maintainability of code - just
imagine someone wanted to increase the precision of the "radius"
parameter - for a minimum amount of speed.

This function IS CALLED ONLY ONCE for the whole filtering progress!

Which means that this is clearly the least important place for code
optimization in this plug-in, since the speed gained from making the
matrix pre-computed will dissolve into nothingness with growing images!

How many microseconds does the computation of the matrix take ?
Did anyone evaluate this yet ?

I mean, before starting to speculate about methods of optimization for a
certain part of code, one should first have a look at what can be gained
there - in this case: near zero.


  Torsten

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux