[MPlayer-dev-eng] [PATCH] New mode for 'tinterlace' filter

Walter Belhaven wbelhaven at yahoo.com
Sat Apr 1 23:28:35 CEST 2006


Hi,

Here's a patch to libmpcodecs/vf_tinterlace.c which adds a new
mode (-vf tinterlace=4).  The new mode interleaves the even
lines from Frame 'j' with the odd lines of Frame 'j+1', halving
the Frame rate in the process while preserving the overall image
height.  In ASCII art:

   Original        Original             New Frame
   Frame 'j'      Frame 'j+1'         (tinterlace=4)
  ==========      ===========       ==================
    Line 0  -------------------->    Frame 'j' Line 0
    Line 1          Line 1  ---->   Frame 'j+1' Line 1
    Line 2 --------------------->    Frame 'j' Line 2
    Line 3          Line 3  ---->   Frame 'j+1' Line 3
     ...              ...                   ...

I'll use the following notation to explain this new option and
why I need it:

 o Capital 'F' means 'F'rames (typically progressive)
 o lower-case 'f' means 'f'ields (interlaced)
 o "film" means ~24 *unique* Fps (regardless of how transmitted)
 o "video" means ~60 *unique* Fps or fps (NTSC)

My application for this filter is transcoding 720p HD "video"
sources (specifically, 720p/60Fps) to SD NTSC "video", at
480i/60fps (30Fps interlaced) for ultimate authoring to an NTSC
DVD-Video.  Here's how it would be used in practice:

  mencoder ... -vf tinterlace=4,scale=720:480:1 ...

or

  mencoder ... -vf scale=720:480,tinterlace=4 ...

Please see the "@@ Need help" comments I included in the
implementation of the new case for tinterlace.  I need to know
whether I should set dmpi->fields to indicate that the (output)
Frame is interlaced.

Thanks for your review.  I'll be glad to incorporate this into
the documentation if you folks approve and if someone can tell me
how to do that. :)

Cheers,
WB

P.S.  This filter MIGHT also be useful -- in conjunction with
'pullup' et. al. -- to recover the original "film" cadence in a
720p/60Fps transmission of a "film", in which the broadcaster
simply duplicates the original "film" Frames in a 2:3:2:3
pattern.  The 'tinterlace=4' filter can make the 720p/60Fps look
like hard telecined 720i/30Fps (i.e., 720i/60fps) which is what
'pullup' expects to see.  I haven't tested this application yet,
so I don't know if it works.  It probably doesn't work, unless it
just magically happens to be at the correct phase of the 2:3:2:3
pattern.



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-tinterlace.patch.gz
Type: application/x-gzip
Size: 1103 bytes
Desc: 1796104801-mplayer-tinterlace.patch.gz
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060401/c239ca9e/attachment.bin>


More information about the MPlayer-dev-eng mailing list