Log in

View Full Version : What do you call a filter which requires neither spatial nor temporal context


mg262
8th September 2005, 03:01
Edit: as neuron2 pointed out below, the original was badly worded (sorry)...

So, a so-called spatial filter is one in which each output frame depends only on one input frame (per input clip); it could be said to require no temporal 'context'. A temporal filter is one in which each output pixel depends only on the corresponding pixel in several input frames (possibly from different input clips of the same size); it requires no spatial 'context'.

Something that requires both spatial context and temporal context is called spatiotemporal. What would you call something which requires neither spatial nor temporal context -- something like levels (one input clip) or subtract (two input clips)?

This might seem like a rather flippant question, but I think the concept is important from the point of view of making filters run fast, and this seems like a good way to bring it up... and to define a common reference term for the next time I want bring it up.

Guest
8th September 2005, 03:08
You're not making any sense. Your title says "neither spatial nor temporal context" but your main body says "has both of these properties".

For the case of both, one of sh0dan's filters is called "3D", but more common would be "spatiotemporal".

stickboy
8th September 2005, 04:17
Yeah, but his examples matched the title:

Each output pixel from Levels is based only on a single corresponding pixel in the input
clip.

Each output pixel from Subtract is based on multiple pixels, but those input pixels
come from neither temporal nor spatial sources.

Unfortunately I don't have an answer to mg262's question.

foxyshadis
8th September 2005, 09:01
Levels is a point (or single-point) transform. Subtract and overlay are multi-input, but still point transforms.

For more esoteric customised filters that don't fit into point, spacial, or temporal, classification isn't all that useful. (Just invent a new class.) Ex: An 'underwater' plugin for vdub that didn't use the source at all, just generated a water-ripple overlay for each frame.

Mug Funky
8th September 2005, 09:05
hmm... if we're dealing with points, areas and volumes (spatio-temporal), i suppose we could generalise with 1d, 2d and 3d filters. levels would be 0d though... and there are very few 1d filters (also, temporalsoften could be considered a 1d filter in the time dimension).

mg262
8th September 2005, 10:16
Point transform or maybe even point filter sounds good to me.

I've been spending some time trying to speed up scripts by turning parts into plug-ins recently; in the first case I was asked to speed up a colour replacement script (used ColourKeyMask to find colours close to a given colour, and replaced them with that input colour); in the second case looking at Didée's LimitedSharpen and Soothe functions.

In both cases it seemed that the main area where scripts were inefficient was in dealing with point filters. Given any sequence of point transforms, a plug-in can apply it point by point, loading a pixel from memory, applying the entire sequence, and writing it back to memory.* But the script has no option but to load all the pixels, apply the first operation to them all, write them all back to memory, load them all again, apply the second operation, etc. This is very expensive because it puts a strain on the cache.

*A little thought shows that any sequence of point transforms can always be tacked onto the end of the previous transformation... so essentially they have zero memory overhead.

In some cases YV12LUT is a very effective way to deal with this kind of situation... but it can't always be used directly, for example because there is some interaction between the colour planes (as in my first example).

(If I'm verging into development territory, please move this thread.)