Log in Register FAQ Memberlist Search pcHDTV Forum Index
pcHDTV Forum

pcHDTV Forum Index -> xine-hd -> Hardware bob deinterlacing for xine
Post new topic  This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic 
Hardware bob deinterlacing for xine
PostPosted: Mon Apr 17, 2006 11:36 pm Reply with quote
Scott Larson
 
Joined: 15 Oct 2003
Posts: 713
Location: Portland, OR




I ported my simple XvMC deinterlacing to xine and it seems to work. Enjoy the smooth motion of 60 fields per second instead of the 30 frames per second that xine gives you now. Here's the patch:

Code:
--- video_out/video_out_xvmc.c.orig     2006-04-16 23:45:21.000000000 -0700
+++ video_out/video_out_xvmc.c  2006-04-17 23:19:08.000000000 -0700
@@ -966,15 +966,34 @@
   /* Make sure the surface has finished rendering before we display */
   XvMCSyncSurface(this->display, &this->cur_frame->surface);
   
-  if (this->deinterlace_enabled &&
-      (this->deinterlace_method == DEINTERLACE_ONEFIELD)) {
+  if ((this->deinterlace_enabled) &&
+    (this->deinterlace_method == DEINTERLACE_BOB) &&
+    !frame_gen->progressive_frame) {
+
+    unsigned int first_field, second_field;
+
+    if (frame_gen->top_field_first) {
+      first_field = XVMC_TOP_FIELD;
+      second_field = XVMC_BOTTOM_FIELD;
+    } else {
+      first_field = XVMC_BOTTOM_FIELD;
+      second_field = XVMC_TOP_FIELD;
+    }
+
+    XvMCPutSurface(this->display, &this->cur_frame->surface,
+                  this->drawable,
+                  this->sc.displayed_xoffset, this->sc.displayed_yoffset,
+                  this->sc.displayed_width, this->sc.displayed_height,
+                  this->sc.output_xoffset, this->sc.output_yoffset,
+                  this->sc.output_width, this->sc.output_height,
+                  first_field);
     XvMCPutSurface(this->display, &this->cur_frame->surface,
                   this->drawable,
                   this->sc.displayed_xoffset, this->sc.displayed_yoffset,
                   this->sc.displayed_width, this->sc.displayed_height,
                   this->sc.output_xoffset, this->sc.output_yoffset,
                   this->sc.output_width, this->sc.output_height,
-                  XVMC_TOP_FIELD);
+                  second_field | XVMC_SECOND_FIELD);
   } else { /* WEAVE */
     XvMCPutSurface(this->display, &this->cur_frame->surface,
                   this->drawable,

I also have it here in case the cut and paste doesn't work.

The condecending tone of the core mplayer developers is encouraging me to focus on improving xine instead. I'm hoping to get my EIA-708 subtitles working in xine as soon as I understand how the timing works. Apparently subtitle data on DVD's is only at the first frame of a GOP so the code right now doesn't work with subtitle data being scrambled over several out-of-order frames which is how it arrives in ATSC.
View user's profile Send private message
PostPosted: Fri Apr 21, 2006 12:20 pm Reply with quote
markzimm
 
Joined: 15 Jul 2004
Posts: 24
Location: Black Forest, CO




Thanks; this brings a noticeable improvement. I wonder why they didn't do this already. Do you know if it might be included in the baseline at some point?
View user's profile Send private message
PostPosted: Mon May 01, 2006 10:53 am Reply with quote
Scott Larson
 
Joined: 15 Oct 2003
Posts: 713
Location: Portland, OR




I should probably submit it to the xine-devel list since they don't seem to be as insular as the mplayer developers.
View user's profile Send private message
Hardware bob deinterlacing for xine
  pcHDTV Forum Index -> xine-hd
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 7 Hours  
Page 1 of 1  

  
  
 Post new topic  This topic is locked: you cannot edit posts or make replies.  


Powered by phpBB © 2001-2003 phpBB Group
Theme created by Vjacheslav Trushkin