[gst-devel] [jonathan.rosser at rd.bbc.co.uk: zoneplate patch]
David Schleef
ds at schleef.org
Fri Nov 21 21:34:31 CET 2008
I just checked this patch into CVS. (Note that 'pattern=13' is
incorrect, as it is 14, aka 'pattern=zone-plate'.)
dave...
----- Forwarded message from Jonathan Rosser <jonathan.rosser at rd.bbc.co.uk> -----
Envelope-to: ds at schleef.org
Delivery-date: Fri, 21 Nov 2008 10:06:38 -0800
From: Jonathan Rosser <jonathan.rosser at rd.bbc.co.uk>
To: David Schleef <ds at schleef.org>
Subject: zoneplate patch
Dave,
Attached is a patch to videotestsrc to generate a zoneplate.
It is worth asking if this test pattern belongs in videotestsrc at all as
we discussed before. There are lots of controls to fiddle with, here is a
brief explanation:-
Generate plain grey fields:
videotestsrc pattern=13 k0=100
videotestsrc pattern=13 k0=100 kt=1
Generate horizontal bars, kx is in units of n/256 of a cycle per pixel:
videotestsrc pattern=13 kx=1
videotestsrc pattern=13 kx=1 kt=1
likewise for horizontal bars with ky
diagonal bars with combinations of kx and ky
frequency varying vs time bars with kxt and kyt
horizontal and vertical frequency sweeps with kx2 and ky2
circular zoneplate with kx2 and ky2 together
"inside out" zoneplate with kx2 -ky2
hyperbolic curves with kxy
kt2 to sweep temporal phase
It is quite CPU intensive at the moment but I have done a first found of
optimisation to allow 30fps on a modest computer. Have a play with the
various controls, some combinations dont make much sense but there are lots
of useful patterns you can make with this.
To generate a particular frequency, you need to calculate the rate of
change of phase that corresponds to the frequency you want and scale it
suitably, where 128 is the nyquist limit. Note that arbitrarily big values
can be given and the phase just keeps wrapping round. The calculation is
currently scaled so that this frequency occurs in the sweep at width/2
pixels from the value of xreset. For example, to generate standard
definition sweep where the edge of the horizontal passband is 5.75MHz with
a pixel sample rate of 13.5MHz, you would use kx2=(5.75/13.5)*128=55,
xoffset=-360
Hope this makes some kind of sense... don't get hypnotised by the moving
patterns!
Regards,
Jonathan.
More information about the gstreamer-devel
mailing list