On Fri, 4 Feb 2005, Isaac Richards wrote:
]On Thursday 03 February 2005 10:06 pm, Daniel Thor Kristjansson wrote:
]> On Fri, 4 Feb 2005, Andy McMullan wrote:
]> ]System is bt878/PAL/nvidia/tvout.
]> ]With latest cvs, I see image 'vibration' when using bob deint. This is
]> Why are you using deinterlacing with TVOut?
]There does seem to be less flicker at the bottom of the image with the height 
]changed to - 2 * halfLineSrc.  

The scaling is half a line off by the time it reaches the bottom with 
just -halfLineSrc and not with -2 * halfLineSrc, so this is better. I 
also changed DrawUnusedRects() so that it subtracts boboff lines from 
the bottom as well. This ensures that the colorkey line doesn't return 
on the bottom row because of rounding error.

I've attached a patch that makes the fix and also ads two super verbose 
VB_PLAYBACK macros that should help me debug the problems people 
encounter.

I only made the fix to XV because XvMC behaves a little differently, and 
I want to look at it more carefully before making a patch.

-- Daniel
Index: libs/libmythtv/videoout_xv.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/videoout_xv.cpp,v
retrieving revision 1.116
diff -u -r1.116 videoout_xv.cpp
--- libs/libmythtv/videoout_xv.cpp      3 Feb 2005 23:58:11 -0000       1.116
+++ libs/libmythtv/videoout_xv.cpp      4 Feb 2005 14:47:18 -0000
@@ -920,10 +920,17 @@
                 src_h = imgh / 2;
                 int halfLineSrc = (int)round(((float)disphoff) / imgh - 
0.001f);
                 src_h -= (halfLineSrc) ? 1 : 0;
+                
+                VERBOSE(VB_PLAYBACK,
+                        QString("XvPut img_h(%1-%6) dest y(%2+%4) h(%3-%5)")
+                        .arg(imgh).arg(dest_y).arg(disphoff)
+                        .arg(halfLineSrc).arg(2 * halfLineSrc)
+                        .arg(2*(halfLineSrc ? 1 : 0))); /* 2* for imgh coords 
*/
+
                 XvShmPutImage(data->XJ_disp, xv_port, data->XJ_curwin,
                               data->XJ_gc, image, src_x, src_y, src_w, src_h,
                               dispxoff, dest_y   + halfLineSrc,
-                              dispwoff, disphoff - halfLineSrc, False);
+                              dispwoff, disphoff - 2 * halfLineSrc, False);
                 drawn = true;
             }
         }
@@ -1040,12 +1047,14 @@
     // boboff assumes the smallest interlaced resolution is 480 lines
     int boboff = (int)round(((float)disphoff) / 480 - 0.001f);
     boboff = (m_deinterlacing && m_deintfiltername == "bobdeint") ? boboff : 0;
+    VERBOSE(VB_PLAYBACK, QString("disphoff(%1) boboff(%2) ndc(%3)")
+            .arg(disphoff).arg(boboff).arg((data->needdrawcolor?"yes":"no")));
 
     if (data->needdrawcolor)
     {
         XSetForeground(data->XJ_disp, data->XJ_gc, data->colorkey);
         XFillRectangle(data->XJ_disp, data->XJ_curwin, data->XJ_gc, dispx, 
-                       dispy + boboff, dispw, disph);
+                       dispy + boboff, dispw, disph - 2 * boboff);
     }
 
     // Draw black in masked areas
@@ -1060,11 +1069,11 @@
                        (dispx + dispw) - (dispxoff + dispwoff), disph);
     if (dispyoff + boboff > dispy) // top of screen
         XFillRectangle(data->XJ_disp, data->XJ_curwin, data->XJ_gc, 
-                       dispx, dispy, dispw, dispyoff + boboff-dispy);
-    if (dispyoff + disphoff < dispy + disph) // bottom of screen
+                       dispx, dispy, dispw, dispyoff + boboff - dispy);
+    if (dispyoff + disphoff < dispy + disph + boboff) // bottom of screen
         XFillRectangle(data->XJ_disp, data->XJ_curwin, data->XJ_gc, 
-                       dispx, dispyoff + disphoff, 
-                       dispw, (dispy + disph) - (dispyoff + disphoff));
+                       dispx, dispyoff + disphoff - boboff, 
+                       dispw, (dispy + disph + boboff) - (dispyoff + 
disphoff));
 
     if (sync)
         XSync(data->XJ_disp, false);
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to