[mythtv] PATCH: More deinterlacing support.

Richard Jones richard at earthmen.com
Mon Mar 24 09:51:14 EST 2003


Attached is a patch to add some more deinterlacing options to mythtv.
To use them cycle through the options by pressing x whilst viewing TV. 
Then exit mythtv and start it up again, the deinterlacer you have chosen
will now be running. I'd rather you didn't need to restart the tv viewer
but its difficult to get around it. The new deinterlacers all have
quality and performance tradeoffs, none of them approach the smoothness
of an application like tvtime which takes great care to deal with timing
issues (and uses a colour space more conducive to interlaced formats),
tvtime also has several more sophisticated deintelacing methods which I
might try and implement in the future.  If you are already happy with
your output (which probably means you are outputting directly to an
interlaced device) or don't want to sacrifice compression artifacts for
less interlacing artifacts then this patch may not interested you. If
you can't watch fast moving content such as sports broadcasts coz they
are unwatchable because of interlacing artifacts and you are willing to
sacrifice some compression quality then this may interest you. (Note
linear blend, the currently available deinterlacer in mythtv is really
only suitable for very static material, fast moving horizontal action
seen in many sports broadcasts look very bad with it).


Deinterlace mode:  
    "None": Default behaviour , recorder works as it did before patch.
    "Field Bob": 
          - Pulls fields out of the interlaced frames provided by v4l,
sends these to the encoder at double frame rate (60fps ntsc/50fps pal).
          - Unfortunately there is no way of telling xvideo which frame
is top and which is bottom so there is a rather nasty shimmer which is
more noticeable on some content than others.  Unfortunately the mpeg4
encode wastes lots of bits trying to encode this shimmer and so produce
lower quality output. Coupled with the fact that the frame is half
height and needs to be scaled up this makes the artifacts even more
visible. I've found increases the quality settings on mpeg4 capture way
up helps but does not completely resolve the issue. However overall,
interlacing artifacts are removed completely and other than the shimmer
the overall motion in fast moving scenes seems to be improved. Deciding
if this mode is worth it really depends on whether your output device
shows interlacing artifacts and how badly they bother you.


    "Line Doubler", 
    "Interpolated"
        - The above two modes blow up the split fields from above into
          full frames. I did this to try and avoid the shimmer problem,
          but it appears there is more than just the fields bobbing up
          and down causing this. My CPU (1800 athlon) is about 20% too
	  slow to deal with these modes anyways but someone else might
  	  have better luck.
    "Discard Top", 
    "Discard Bottom", 
        - Output fields at normal frame rate (30/25 fps for ntsc/pal) by
          dropping either the top or bottom field. These still appear
          to have colour shimmer on my setup, may be useful if you need
          to get rid of interlacing artifacts but don't have much CPU
          to  spare (this mode halves the throughput to the encoders
          that the default mode has, but at the cost of smoothness).
    "Area Based" 
        - The area based deinterlacer from nuppelvideo. Fairly good
          in fast motion scenes, very CPU intensive (my 1800 can JUST
          handle this). Keeps frame rate at 25fps so no smoothness
          advantages.


    If you are using the half height modes (discard and field bob) then
I highly recommend capturing at the full vertical resolution, if you
need to scale down do it horizontally. I'm doing all this on a g400 with
my main display cloned to tv-out, others may see better or worse quality
with this stuff depending on their setup. Hopefully this will just be a
first step and I can move towards better quality deinterlacing in the
future.

Richard.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: deinterlace.diff
Type: text/x-patch
Size: 32450 bytes
Desc: not available
Url : /pipermail/attachments/20030324/21e8ef1f/deinterlace.bin


More information about the mythtv-dev mailing list