Re: "floccinaucinihilipilification", or "convolutions, blocking, and windows server 2003"

Jaymz Julian <jaymz-y6qSm6YX8/[email protected]>
Newsgroups gmane.comp.freedesktop.xserver
Message-ID <[email protected]>
On Sun, Mar 14, 2004 at 07:11:13PM -0800, Keith Packard wrote:
> I'm probably hopelessly confused, but my understanding is that a
> 'convolution' is just a 2D FIR filter.  Hand the system a rectangular 
> array of filter coefficients and the server can compute the 'logical' 
> value of of any point by laying the filter array over the pixel array and 
> multiplying each color value by the matching filter coefficient and adding 
> them all together.

That's the simplest case, yes.  There are other ways of doing the matrix op
(IIR, RLE), but that's the basic case.  That is, however, also the slowest 
possible implentation of certain very common things that you actually want to 
do with it (blur is one of these).  Originally I implemented only this, and 
it was way too slow to actually use on my hardware, hence the support for 
special case ops, and the caching.

> Render already has a Filter mechanism which provides for parameterized
> filters which can take arbitrary lists of fixed point coefficients.  This 
> mechanism already provides nearest neighbor and bilinear interpolation 
> filters; I thought adding 2D FIRs would be pretty straight forward and not 
> actually require any new protocol or API within the Render library.

I can move this code to use the Filter mechinism easily enough.  I'd like to
claim some high reason for not using it before, but in reality, it's because
I looked at it, and it looked to me like it was specifically for a 
transformation filter (bilinear, nearest, etc), although having the server
transparently handle multiple convolutions and my understanding of that being
difficult with the Filter interface also coloured that.

> Or am I just missing something?

Possibly, but probably not :).  Like I said, my design justification for the
API as written is speed and simplicity for complex combinations of ops.  I'm 
not married to this interface, I agree that it sucks in large portions, and 
part of the reason I put it up was because I wanted to see wether people 
wanted this complexity of operations before I spent the time to clean
it up.

	-- jj

--
Jaymz Julian - Coder, Visionary, Fat Ass.
"Hannibal is a serial killer. He only likes to kill and eat people. 
 Very few people have `I want to be killed and eaten' on their cards, 
 so Hannibal is out of a job." - http://cards.sf.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.