[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Testers needed for TV benchmark



"Bill B." wrote:
> "Liam E. Gumley" <Liam.Gumley@ssec.wisc.edu> wrote in message news:<3B7183C6.4D1A3622@ssec.wisc.edu>...
> 
> > To obtain the best frame rate for animations, first you should display
> > all the images in a pixmap window, and *then* use DEVICE, COPY to copy
> > each image to a visible graphics window. I'm willing to bet you'll get
> > frame rates better than 10 frames/sec using this method.
> >
> 
> Hi Liam,
> 
> If you look at my benchmark, that is the 1st of the two tests being
> executed:
> 
> <snip>
> 
> FOR I = 0, 49 DO BEGIN
>   WSET, pixmap0_id
>   TV, data, true = 3
>   WSET, pixmap1_id
>   DEVICE, COPY = [0, 0, sz-1, sz-1, 0, 0, pixmap0_id]
> ENDFOR
> 
> <snip>
> 
> Also, the results I posted show no difference between the technique
> that you describe and just TVing directly to the visible window.  Ten
> fps at 512*512 would be great but I see no indication that I can
> achieve that on a PC.  BTW, this benchmarking is in preparation for
> what will be the SW end of a generic (any format) video frame grabber.
>  Could you verify if the snippet above is what you had in mind?

Bill,

The rate at which you can *display* images is different than the rate at
which you can *animate* images. To demonstrate, the following procedure
uses two loops. The first loop displays a sequence of images in pixmap
windows. The second loop copies images from the pixmap windows to a
visible graphics window:

PRO TEST, DELAY=DELAY

;- Set initial parameters
xsize = 512
ysize = 512
nframes = 20
image = dist(512)
if (n_elements(delay) eq 0) then delay = 0.05

;- Display image in pixmap windows
t0 = systime(1)
for frame = 0, nframes - 1 do begin
  window, frame, /pixmap, xsize=xsize, ysize=ysize
  tvscl, shift(image, 10 * frame)
endfor
t1 = systime(1)
print, 'Display rate (frames/sec) = ', $
  float(nframes) / (t1 - t0)

;- Animate the images
window, /free, xsize=xsize, ysize=ysize
t0 = systime(1)
for frame = 0, nframes - 1 do begin
  device, copy=[0, 0, xsize, ysize, 0, 0, frame]
  wait, delay
endfor
t1 = systime(1)
print, 'Animation rate (frames/sec) = ', $
  float(nframes) / (t1 - t0)

END

If the DELAY keyword is not set, the default interval between each frame
is 0.05 seconds. Set DELAY=0.0 to see how fast your system can copy
images from pixmap windows to a visible window. On my PC running IDL
5.3:

IDL> test
Display rate (frames/sec) =        4.0265754
Animation rate (frames/sec) =        15.974441
IDL> test, delay=0.0
Display rate (frames/sec) =        4.0104271
Animation rate (frames/sec) =        56.980046

To summarize, the rate at which you can display the images with TV or
TVSCL is much slower than the rate at which you can animate the images
using DEVICE, COPY=[...].

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/