Re: Rapid gfx display Qs
- From: "Jim Mack" <jmack@xxxxxxxxxxxxxxx>
- Date: Fri, 16 May 2008 17:06:57 -0400
Schmidt wrote:
"Jim Mack" schrieb...
I found that I can reliably load a random image file (BMP)
into a byte array in about 8ms, with enough images that on
average I will swamp the file system cache at least some of
the time. In any case it's how I'll be operating, so it matches
reality. (-:
Think you will have to consider compression in either way,
if you want to load and show these images with ca. 50Hz
randomly.
30Hz is the target, but I need room for computation, so I'm trying for
20ms as the maximum load and display time.
At this frequency (50Hz), your Disks would have to work
with a sustained throughput of ca:
135MB/sec (for 24Bit-Images)
or ca.
90MB/sec (for 16Bit-Images)
Yes, I know. I did say that this would be a fast disk subsystem. It's
specs are 160MB/s sustained, with 1ms maximum seek. How? SSD SATA3
RAID0. (-:
Of course, if we can get away with less it would save money.
Long story short, work with JPGs (if your images are
true-color-images from a VidCam) or work with zlib
or some faster losless compression-algo, if your images
are more "plain-colored" (e.g. screenshots with a low
percentage of color-gradients).
These are complex, real-life images (photo quality), so JPG is a must.
And yes, the VB-LoadPicture-function is really slow if you
need to work with JPGs, but there are much faster JPG-libs
out there. With the ijl15.dll (the intel-jpeg-library) I
just did a small test with an 1280x720.jpg (ca. 140kByte
in size using 85%JPEG-Quality) - and such an image
can be decoded into a 1280x720x3 (24Bit-DIB)
in ca. 9-10msec here on my 1.8GHz Mobile-CPU.
Finally StretchDIBits, drawing from the 24Bit-DIB to the
Form.hDC takes only 4-6msec here.
I'm glad to hear that there are faster JPG alternatives, because I
would like to use a compressed file format for best speed. As you
note, using VB LoadPicture, you give back all of the speed you gain
from faster disk transfers, and then some.
Currently your worst-case with a 16Bit-DIB looks
this way (assuming 80MB/s Disk-Read-speed):
Head-Positioning ca.: 9ms
Transfer 1.75MB imagedata from disk into memory: 22ms
Visualizing of this memorybuffer to screen using
StretchDIBits or SetDIBits: 6msec
Sum: 37msec
You cannot get faster (even with async reads) than
9ms+22ms = 31ms, even on your more capable
CPU-System - maybe you can reach 8ms+20ms=28ms
if it has fast, modern SATA-disks, but not much faster.
As said, maybe with a stripe-set, doubling your sequential
read-speed, you could get down to: 8ms+10ms, but not
much faster.
Diskaccess-time and -diskread is the limitation in your case.
With Jpg-encoded images you will get (even on a
single-disk system):
8-9ms accesstime+2msec for the transfer from disk into RAM.
If done async, you can use these 11msec for decoding
the image and visualizing it (ca. 6-7ms on a fast CPU
for decoding with ijl15.dll + 5-6ms for visualizing per
Set- or StretchDIBits) - so both async-processings need
approximately the same amount of time (ca. 11-13ms).
This way (async read of the next Jpg-Bytes, whilst
decompressing and visualizing the current Bytes)
you can work far below 20msec, giving you some
more time to wait for e.g. the vertical blanc.
If you are interested, I could post an example for the
ijl15-related code.
A pointer to the libs and any samples would be appreciated.
--
Jim
.
- Follow-Ups:
- Re: Rapid gfx display Qs
- From: Schmidt
- Re: Rapid gfx display Qs
- References:
- Rapid gfx display Qs
- From: Jim Mack
- Re: Rapid gfx display Qs
- From: Larry Serflaten
- Re: Rapid gfx display Qs
- From: Jim Mack
- Re: Rapid gfx display Qs
- From: Schmidt
- Rapid gfx display Qs
- Prev by Date: Can a VB6 application 'promote' itself?
- Next by Date: Re: Rapid gfx display Qs
- Previous by thread: Re: Rapid gfx display Qs
- Next by thread: Re: Rapid gfx display Qs
- Index(es):
Relevant Pages
|
Loading