[vlc-devel] LINEAR deinterlacing NOT taking care of video field order: wrong order with Bottom Field First

gb.pub gb.pub1 at bastelica.net
Wed Jun 6 17:29:53 CEST 2007


Hi,

I have noticed a repeating problem when playing back MPEG-2 files with 
BOTTOM FIELD FIRST and using LINEAR deinterlacing (and probably others 
using both fields). These kind of video files are very common when 
created from DV sources, and most (all?) DVDs authored from DV videos 
will have BOTTOM field first. But most of MPEG-2 files created from 
other sources or using hardware encoder are Top field first.

For Bottom Field First files/DVDs, resulting displayed video is very 
jerky when there's a quick movement, because fields are obviously 
displayed in the wrong order.

I've tried with a lot of different DVDs authored from DV footage with a 
lot of different authoring software (selfmade or even coming from 
professional authoring companies), or MPEG-2 files encoded with software 
encoders (like TMPGEnc), so i'm really sure that this problem does not 
come from the videos or DVD themselves.

I'm not an expert developer but i've tried to check that problem. May be 
i'm wrong, but i don't think so.

Browsing source code, i've found that in deinterlace.c module:

Linear deinterlacing is done by this function:

static void RenderLinear( vout_thread_t *p_vout,
                          picture_t *p_outpic, picture_t *p_pic, int 
i_field )

and this function is called like this:

        case DEINTERLACE_LINEAR:
            RenderLinear( p_vout, pp_outpic[0], p_pic, 0 );
            vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[0] );
            RenderLinear( p_vout, pp_outpic[1], p_pic, 1 );
            vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[1] );
            break;

So it seems to me that despite each field is treated in turn, there's no 
parameter or control of source file field order, so fields are always 
treated and displayed in the same order: 0 and 1.
Am i wrong with that? For Bottom field first, may be it should be in 
reverse order: 1 then 0?

Since all this part there's no comment in source code, and since i'm not 
a very skilled developper, may be i'm wrong. And if i'm right, i'm 
unfortunately don't think i will be able to add/modify code to take care 
of field order correctly when deinterlacing.

But since DV video cameras are very widely used, i think this problem is 
a major one for anybody that wants to playback such files/DVDs with VLC.

Does anybody skilled enough would like to take care of this?

Thanks in advance for your help, and congratulations for all your 
fantastic work so far.

Best regards,

Gerald.

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list