[MPlayer-dev-eng] Re: [PATCH] vo_xvmc - bob deinterlacing

Carl Eugen Hoyos cehoyos at ag.or.at
Thu Sep 28 18:06:29 CEST 2006


Hi Ivan!

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.
> 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.

Fixed patch attached.

Please consider to apply, Carl Eugen

Index: libvo/vo_xvmc.c
===================================================================
--- libvo/vo_xvmc.c     (Revision 20001)
+++ 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;
@@ -345,6 +346,8 @@
 // the surface have passed vf system without been skiped, it will be displayed
    rndr->state |= MP_XVMC_STATE_DISPLAY_PENDING;
    p_render_surface_to_show = rndr;
+   p_render_surface_to_show->display_flags =
+     bob_deinterlace ? mpi->fields & MP_IMGFIELD_TOP_FIRST ? 1 : 2 : 3;
    return VO_TRUE;
 }

@@ -363,6 +366,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 +1037,24 @@
                         vo_window,
                         0, 0, image_width, image_height,
                         clipX, clipY, clipW, clipH,
-                        3);//p_render_surface_to_show->display_flags);
+                        p_render_surface_to_show->display_flags);
    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,
+             3-p_render_surface_to_show->display_flags);
+   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