Use of Static Arrays in Nohalo Level 2
Forums ► For GEGL developers (read-only) ► Use of Static Arrays in Nohalo Level 2
-
Adam Turcotte
(over 2 years ago)
- Øyvind Kolås (over 2 years ago)
Sent: 2009-07-01 22:19:51 UTC (over 2 years ago)
From: Adam Turcotte
Use of Static Arrays in Nohalo Level 2
I will be implementing Nohalo Level 2 for GEGL. This basically
involves computing double-density pixel data (with a specialized
version of Nohalo Level 1 minus the finishing bilinear) and then
running a slightly modified version of Nohalo Level 1. The simplest
way of implementing this is by having a small "persistent" array or
buffer storing double-density pixel data locally so that the required
values from Level 1 are not recomputed over and over.I originally thought that I could simply use GeglBuffers for this
purpose, but the GeglBuffer code seems fairly complicated. Instead, I
believe that small static arrays could be a better choice. For
example, a 64x64 double-density data array can be computed with the
buffer data corresponding to a context_rect/fetch_rectangle of size
35x35. When the currently stored static array does not contain the
Level 1 data needed to compute the Level 2 value at the current
location, it would simply be recomputed, much like they are in
gegl_sampler_get_ptr (in gegl-sampler.c).Does anyone have a more elegant solution? Any objection to the use of
static arrays for this purpose?Adam Turcotte
_______________________________________________
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer
Sent: 2009-07-02 02:28:33 UTC (over 2 years ago)
From: Øyvind Kolås
Use of Static Arrays in Nohalo Level 2
On Wed, Jul 1, 2009 at 9:19 PM, Adam Turcotte wrote:
> I will be implementing Nohalo Level 2 for GEGL. This basically
> involves computing double-density pixel data (with a specialized
> version of Nohalo Level 1 minus the finishing bilinear) and then
> running a slightly modified version of Nohalo Level 1. The simplest
> way of implementing this is by having a small "persistent" array or
> buffer storing double-density pixel data locally so that the required
> values from Level 1 are not recomputed over and over.
>
> I originally thought that I could simply use GeglBuffers for this
> purpose, but the GeglBuffer code seems fairly complicated. Instead, I
> believe that small static arrays could be a better choice. For
> example, a 64x64 double-density data array can be computed with the
> buffer data corresponding to a context_rect/fetch_rectangle of size
> 35x35. When the currently stored static array does not contain the
> Level 1 data needed to compute the Level 2 value at the current
> location, it would simply be recomputed, much like they are in
> gegl_sampler_get_ptr (in gegl-sampler.c).It sounds like a reasonable approach it might be better if this buffer
is allocated on the heap and allocated/freed by the sampler./Øyvind K.
--
«The future is already here. It's just not very evenly distributed»
-- William Gibson
http://pippin.gimp.org/ http://ffii.org/
_______________________________________________
Gegl-developer mailing list
Gegl-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer



