Use field order (top/bottom) for correct bob/linear deinterlacing.
authorLaurent Aimar <fenrir@videolan.org>
Fri, 12 Oct 2007 19:49:44 +0000 (19:49 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Fri, 12 Oct 2007 19:49:44 +0000 (19:49 +0000)
(Decoder that does not set this info should be fixed)

modules/video_filter/deinterlace.c

index 27919ce..ad13c4e 100644 (file)
@@ -530,16 +530,16 @@ static void Render ( vout_thread_t *p_vout, picture_t *p_pic )
             break;
 
         case DEINTERLACE_BOB:
             break;
 
         case DEINTERLACE_BOB:
-            RenderBob( p_vout, pp_outpic[0], p_pic, 0 );
+            RenderBob( p_vout, pp_outpic[0], p_pic, p_pic->b_top_field_first ? 0 : 1 );
             vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[0] );
             vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[0] );
-            RenderBob( p_vout, pp_outpic[1], p_pic, 1 );
+            RenderBob( p_vout, pp_outpic[1], p_pic, p_pic->b_top_field_first ? 1 : 0 );
             vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[1] );
             break;
 
         case DEINTERLACE_LINEAR:
             vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[1] );
             break;
 
         case DEINTERLACE_LINEAR:
-            RenderLinear( p_vout, pp_outpic[0], p_pic, 0 );
+            RenderLinear( p_vout, pp_outpic[0], p_pic, p_pic->b_top_field_first ? 0 : 1 );
             vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[0] );
             vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[0] );
-            RenderLinear( p_vout, pp_outpic[1], p_pic, 1 );
+            RenderLinear( p_vout, pp_outpic[1], p_pic, p_pic->b_top_field_first ? 1 : 0 );
             vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[1] );
             break;
 
             vout_DisplayPicture( p_vout->p_sys->p_vout, pp_outpic[1] );
             break;