|
From: Erik W. <om...@cs...> - 2000-06-11 07:46:47
|
On Wed, 7 Jun 2000, Bernhard Schwall wrote:
> Unfortunately after a (very short I must admit) look into the libdv
> sources it looks to me that there isn't a function returning the
> complete YUV picture and one for converting YUV->RGB. Instead the
> conversion is done block by block so it should be a bit of work to do
> simple operations on the picture before color conversion.
The reason it's done this way is because it's significantly faster. If
you do all your operations frame-at-a-time, you're blowing your cache
repeatedly (unless you have more than 2MB of L2). In its current form, we
are or easily can be within the 16KB L1 data cache of most common CPUs
pretty much all the time. This is one of the things that makes DV a lot
easier than MPEG, since MPEG (-2 MP@ML) is always referring to a massive
data set (a hair over 2MB) at all times.
As for making libdv easier to work with, I'll very soon be committing some
fairly major changes that will make libdv an actually library ;-) My most
recent success is a ~150 line program that shows DV data off disk in full
screen scaled to 2048x1536 at about 1/4 realtime using 78& CPU on a
partially crippled K6-2 350. This is accomplished with XFree 4.0 and SDL
on a G400. A third of the time is currently spent in brute-force code
that can be reduced to around 1% of total running time once I optimize (C
and MMX), meaning I can go quite a bit faster even on this machine without
much more work.
> Has anyone implemented such a function (returning the complete YUV picture)
> for libdv yet?
The library API I'm building has several layers, the lowest of which I'm
focusing on right now. The highest layer simply takes a buffer of
sufficient size (120K or 144K) and fills a frame buffer with either raw
YUV or any other format we add converters for, or you supply yourself. The
lowest layer API lets you deal all the way down to video segments, which
is ideal for things like time-warp (you know the cool effect you see when
fast-forwarding on your camera? that's simply regular strided samples of
video segments off tape, the effect is a fuction of the segment scrambling
built into the format) and other specialized operations.
Erik Walthinsen <om...@cs...> - Staff Programmer @ OGI
Quasar project - http://www.cse.ogi.edu/DISC/projects/quasar/
Video4Linux Two drivers and stuff - http://www.cse.ogi.edu/~omega/v4l2/
__
/ \ SEUL: Simple End-User Linux - http://www.seul.org/
| | M E G A Helping Linux become THE choice
_\ /_ for the home or office user
|