On Sat, Jul 13, 2002 at 07:48:36PM -0400,
[EMAIL PROTECTED] wrote:
> On Thu, Jul 11, 2002 at 12:23:50AM +0300, Ville Syrj�l� wrote:
> > Would it be possible to do field notification when blitting from an
> > offscren surface to the BES surface?
>
> So you want to blit each field separately to the BES surface (i.e.
> double the display frame-rate from 29.97 to 59.94 fps)?
Well 25 and 50 for me :)
> What video
> cards support scanline scaling (i.e. doubling the scanlines in a 240
> line frame to produce a 480 line frame) in their BES?
I wasn't planning on doubling the scanlines.
> Or are there
> other methods to deinterlace being used? I am hoping you will say the
> Matrox G400. I have one of those. :-)
I think the G400 BES does something to one of the fields but it doesn't
actually modify the memory contents. The effect is only applied to the
actual output.
I'm not sure what I was thinking :) What I think I was thinking is that
I'd let the v4l device keep on capturing and on v4l vsync blit only one of
the fields thus leaving every other line untouched.
I was thinking about source color keying for this but now that I think
about it there wouldn't be any black lines in the source image to be keyed
out. The v4l device will keep capturing to the buffer and it won't clear
the buffer in between fields. Ah, I could clear it myself after blitting
the field thus the next field would always be captured to a clear surface
(if the blit is fast enough).
Or source pitch could be programmed to two lines so it would skip the
lines but I'm not sure what would happen to the destination surface. Will
it write something to the pixels that are not part of the destination line
but are included in the pitch? This would have to tested or maybe it's
mentioned in the docs. But the BES supports putting the fields to separate
buffers so that might help there.
>
> > I've been thinking about the best
> > way to do capturing and getting a good deinterlaced image.
>
> Yes!
>
> > Here's the
> > sequence I came up with:
> >
> > 1. capture (overlay mode) to an offscreen surface.
> > 2. on v4l vsync
>
> Which as I understand it is one vsync per frame (two fields), which is
> no good for proper interlaced capture and display. But I see your
> comment below. I also just read the thread you commented on on v4l.
>
> > blit (with source color key) to the bes backbuffer.
>
> > 3. Flip the bes buffers.
> >
> > But deinterlacing would require the field notification to work.
> >
> > Any thoughts?
> >
> >
> > Naturally this requires accurate field syncing from the v4l device. I've
> > hacked the bttv driver to do just that.
>
> What version of bttv driver?
0.7.91 it seems :) It's included in linux-2.4.19-rc1.
> I am very interested in this work you are doing as it will allow for
> accurate interlaced video capture and display,
Well pretty accurate anyway. Depending on the output refresh rate and
input rate things might get bad. The G400 does support being slaved to
some other clock so I think it might be possible to make it really
accurate. But I don't know much about that kind of stuff.
> which we don't have
> right now due to neither capture nor playback being field based
> currently.
>
> Can you send me (or make available somehow) your directfb app that you
> are using?
I'm actually using df_video and df_layer from DirectFB-examples :) I've
massaged them around and tried different things with them. Like capturing
to system surfaces, offscreen video surfaces and stuff. I have made a big
mess of my ~/src and if I try to clean it up I'm sure I'll lose something
useful.
> I will get your bttv patch off of v4l.
You'll also need to modify the v4l video provider.
I don't have the energy to do a real patch. I have at least three
DirectFB source trees here and all kinds of crap everywhere so patching
isn't very attractive. Here are my changes in a pseudo diff format :)
- struct timeval tv;
+ int neg = -1;
- tv.tv_sec = 0;
- tv.tv_usec = 20000;
- select( 0, 0, 0, 0, &tv );
+#define BTTV_FIELDNR _IOR('v', BASE_VIDIOCPRIVATE+2, unsigned int)
+ ioctl( data->fd, VIDIOCSYNC, &neg);
+ ioctl( data->fd, BTTV_FIELDNR, &field);
+ field = !field;
that last line is there because IMO it makes the image look better. If I
don't do it the image flashes like with the select hack and there's some
blockiness in the image. Can you try with or without that last line and
tell me if you see something funny in the image.
> Was there anything
> further in that thread than what was on the list?
No.
> Was Gerd's reaction to your bttv mods positive?
No response really :( Maybe he's got something cooking, I don't know but
I'll wait for while and see if he responds.
--
Ville Syrj�l�
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/
--
Info: To unsubscribe send a mail to [EMAIL PROTECTED] with
"unsubscribe directfb-dev" as subject.