Re: patch-fu
David Squire <[email protected]>
| Newsgroups | gmane.comp.gnu.gift.general |
|---|---|
| Message-ID | <[email protected]> |
Jonas Lindqvist wrote:
> Hi!
>
> I feel an urge to ask some questions... (Perhaps silly, but anyway...
> I know I could probably find the answers by digging in the code a bit
> deeper, but I admit I'm lazy...)
>
> * The function gabor_filter, in gabor.c, now uses a fixed array of
> 65536 doubles, instead of callocing the size indicated by the width
> and height that are passed as parameters to gabor_filter(...). Very
> well...
> Are the width and height always 256, or can they be 128*512 or 2*32768
> or whatever?
That is not a change I would approve. The width and height are presently
always 256x256, but this was always intended to be a temporary measure.
Code that does not need this assumption should not make it. The code
should be kept as open for extension and generalization as possible.
>
> * I guess that most modern CPUs have some kind of SSE2-ish features
> that gcc could use, but what would the effect of the patch be for an
> architecture that lacks it? (Something seriously old, pre MMX, or
> something else that perhaps one would not use for this application
> anyway...)
>
> * Wouldn't memset be faster than looping and setting to zero?:
> for (i = 0; i < width*height; i++)
> {
> conv[i]= 0; /* needs to be zeroed */
> }
calloc should handle this.
> and isn't width*height always 65536?
>
See my comment above.
I've just got back from a few weeks away from the internet. Much
catching up to do...
Regards,
David
--
Dr David McG. Squire, Senior Lecturer, on sabbatical in 2006
Caulfield School of Information Technology, Monash University, Australia
CRICOS Provider No. 00008C http://www.csse.monash.edu.au/~davids/