[MPlayer-dev-eng] Re: [PATCH] vo_xvmc - bob deinterlacing
Carl Eugen Hoyos
cehoyos at ag.or.at
Sat Jun 24 02:17:55 CEST 2006
Ivan Kalvachev <ikalvachev <at> gmail.com> writes:
>
> 2006/6/5, Tomas Janousek <tomi <at> nomi.cz>:
> > Hi,
> > I added bob deinterlacing support to xvmc. Pretty simple and the results
> > are quite good, especially for sports on TV because of the field rate.
> >
> > Patch attached.
>
> I don't like it.
>
> Your patch tries to artifically increases the framerate 2 times.
> However to do so, it uses sleep inside the vo and effectively cuts the
> available time mplayer could work 2 times.
Then you'll be delighted to read that it works perfectly for every resolution
even without the usleep;-) (at least on my GeForce4 MX)
> Correct handling would require codec or/and mplayer.c sync code tweak.
>
> The other much bigger drawback is that it have hardcoded field order
> ignoring top_field_first flag in mpeg-2. At least this is easy to fix.
Sorry, I don't know how to do this (and, unfortunately, I don't have a sample
since ORF and ARD/ZDF seem to constantly send with top field first).
Changed patch attached, works great to watch soccer using xvmc. Please consider
to apply since it's the only way to watch interlaced HDTV content on my Athlon
XP 2600.
Greetings, Carl Eugen Hoyos
Index: libvo/vo_xvmc.c
===================================================================
--- libvo/vo_xvmc.c (Revision 18804)
+++ libvo/vo_xvmc.c (Arbeitskopie)
@@ -51,6 +51,7 @@
static int first_frame;//draw colorkey on first frame
static int use_queue;
static int xv_port_request = 0;
+static int bob_deinterlace = 0;
static int image_width,image_height;
static uint32_t drwX,drwY;
@@ -363,6 +364,7 @@
{ "benchmark", OPT_ARG_BOOL, &benchmark, NULL },
{ "sleep", OPT_ARG_BOOL, &use_sleep, NULL },
{ "queue", OPT_ARG_BOOL, &use_queue, NULL },
+ { "bobdeint", OPT_ARG_BOOL, &bob_deinterlace, NULL },
{ NULL }
};
@@ -1033,11 +1035,25 @@
vo_window,
0, 0, image_width, image_height,
clipX, clipY, clipW, clipH,
- 3);//p_render_surface_to_show->display_flags);
+ bob_deinterlace ? 1 : 3);
if(rez != Success){
printf("vo_xvmc: PutSurface failer, critical error %d!\n",rez);
assert(0);
}
+
+ if (bob_deinterlace)
+ {
+ rez = XvMCPutSurface(mDisplay, p_render_surface->p_surface,
+ vo_window,
+ 0, 0, image_width, image_height,
+ clipX, clipY, clipW, clipH,
+ 2);
+ if(rez != Success){
+ printf("vo_xvmc: PutSurface failer, critical error %d!\n",rez);
+ assert(0);
+ }
+ }
+
XFlush(mDisplay);
}
More information about the MPlayer-dev-eng
mailing list