[MPlayer-dev-eng] Need help with interlaced images and strides

Walter Belhaven wbelhaven at yahoo.com
Sat Apr 1 01:41:54 CEST 2006


Hi,

I'm attempting to implement a slight variation of the 'tinterlace=0'
filter, and it's clear that I just don't "get" the stride
implementation in mplayer, or just how interlaced images are stored.

Can someone point me to some info on this?  I've read everything I can
find, including all of the technical documentation.  I even think I
understand the entire filter interface and most of what's going on in
vf_tinterlace.c, but there's a disconnect somewhere.

Here are the details.  To convert 720p/60Fps HD "video" to 480i/60fps
SD "video" for burning to DVD-Video (capital F's mean Frames, little
f's mean fields), I'd like to take, say, the even lines from Frame 'j',
and, say, the odd lines from Frame 'j+1'.

At a high level this is what the tinterlace=0 filter does, but not
quite.  In order to test the concept and to get things working, I'm
making my changes "in place" to tinterlace=0.  The changes I've made
are as follows:

vf_tinterlace.c::config()
 1. passed 'height' and 'd_height" to next filter, rather than
    height*2 and d_height*2

vf_tinterlace.c::put_image()
 1. requested an image of 'mpi->height' instead of 2x that 
    in vf_get_image
 2. set 'dmpi->fields' to MP_IMGFIELD_INTERLACED.  Also tried
    setting MP_IMGFIELD_TOP_FIRST.
 3. changed all occurrences of dmpi->stride[n] to twice that value, 
    in all calls to memcpy_pic.
 4. changed all height's to height/2 in calls to memcpy_pic.  I get
    core dumps if I don't, and it makes sense to me to make this
    change.
 5. Used a single stride offset when copying the 2nd field

I'm clearly missing something, because the resulting output doesn't
look interlaced, especially with two carefully crafted JPG images I'm
using for testing.  Any help would be appreciated.

Thanks,
WB


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the MPlayer-dev-eng mailing list