[MPlayer-dev-eng] Re: [PATCH] vo_xvmc - bob deinterlacing
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Oct 11 01:58:56 CEST 2006
Hello,
On Thu, Sep 28, 2006 at 04:06:29PM +0000, Carl Eugen Hoyos wrote:
> > 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.
Unfortunately, yes. Though it still does look better than with no
deinterlacing at all.
> > 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.
Modified variant I would prefer.
Could you provide the missing man page entry? Maybe also mentioning that
in the worst case the quality will be similar to -vf tfields=1 ?
Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libvo/vo_xvmc.c
===================================================================
--- libvo/vo_xvmc.c (revision 20146)
+++ libvo/vo_xvmc.c (working copy)
@@ -51,6 +51,8 @@
static int first_frame;//draw colorkey on first frame
static int use_queue;
static int xv_port_request = 0;
+static int bob_deinterlace;
+static int top_field_first;
static int image_width,image_height;
static uint32_t drwX,drwY;
@@ -345,6 +347,7 @@
// 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;
+ top_field_first = mpi->fields & MP_IMGFIELD_TOP_FIRST;
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 }
};
@@ -400,6 +404,7 @@
benchmark = 0; //disable PutImageto allow faster display than screen refresh
use_sleep = 0;
use_queue = 0;
+ bob_deinterlace = 0;
/* parse suboptions */
if ( subopt_parse( arg, subopts ) != 0 )
@@ -1014,6 +1019,7 @@
static void put_xvmc_image(xvmc_render_state_t * p_render_surface, int draw_ck){
int rez;
int clipX,clipY,clipW,clipH;
+int i;
if(p_render_surface == NULL)
return;
@@ -1029,15 +1035,19 @@
if(benchmark)
return;
+ for (i = 1; i <= bob_deinterlace + 1; i++) {
+ int field = top_field_first ? i : i ^ 3;
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);
+ bob_deinterlace ? field : 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