Commit 28950fce authored by Damien Lucas's avatar Damien Lucas

. 422 deinterlacing (bob and blend filters)


This work is part of the work done by Anevia for the "Gran Theatro del
Barcelona".
parent ef4c3d63
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* deinterlace.c : deinterlacer plugin for vlc * deinterlace.c : deinterlacer plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001, 2002, 2003 VideoLAN * Copyright (C) 2000, 2001, 2002, 2003 VideoLAN
* $Id: deinterlace.c,v 1.16 2003/11/05 00:39:17 gbazin Exp $ * $Id: deinterlace.c,v 1.17 2003/11/06 16:54:40 nitrox Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -518,36 +518,101 @@ static void RenderBob( vout_thread_t *p_vout, ...@@ -518,36 +518,101 @@ static void RenderBob( vout_thread_t *p_vout,
p_out_end = p_out + p_outpic->p[i_plane].i_pitch p_out_end = p_out + p_outpic->p[i_plane].i_pitch
* p_outpic->p[i_plane].i_lines; * p_outpic->p[i_plane].i_lines;
switch( p_vout->render.i_chroma )
{
case VLC_FOURCC('I','4','2','0'):
case VLC_FOURCC('I','Y','U','V'):
case VLC_FOURCC('Y','V','1','2'):
/* For BOTTOM field we need to add the first line */
if( i_field == 1 )
{
p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_pic->p[i_plane].i_pitch );
p_in += p_pic->p[i_plane].i_pitch;
p_out += p_pic->p[i_plane].i_pitch;
}
p_out_end -= 2 * p_outpic->p[i_plane].i_pitch;
for( ; p_out < p_out_end ; )
{
p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_pic->p[i_plane].i_pitch );
p_out += p_pic->p[i_plane].i_pitch;
p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_pic->p[i_plane].i_pitch );
p_in += 2 * p_pic->p[i_plane].i_pitch;
p_out += p_pic->p[i_plane].i_pitch;
}
p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_pic->p[i_plane].i_pitch );
/* For TOP field we need to add the last line */
if( i_field == 0 )
{
p_in += p_pic->p[i_plane].i_pitch;
p_out += p_pic->p[i_plane].i_pitch;
p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_pic->p[i_plane].i_pitch );
}
break;
case VLC_FOURCC('I','4','2','2'):
/* For BOTTOM field we need to add the first line */ /* For BOTTOM field we need to add the first line */
if( i_field == 1 ) if( i_field == 1 )
{ {
p_vout->p_vlc->pf_memcpy( p_out, p_in, p_pic->p[i_plane].i_pitch ); p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_pic->p[i_plane].i_pitch );
p_in += p_pic->p[i_plane].i_pitch; p_in += p_pic->p[i_plane].i_pitch;
p_out += p_pic->p[i_plane].i_pitch; p_out += p_pic->p[i_plane].i_pitch;
} }
p_out_end -= 2 * p_outpic->p[i_plane].i_pitch; p_out_end -= 2 * p_outpic->p[i_plane].i_pitch;
if( i_plane == Y_PLANE )
{
for( ; p_out < p_out_end ; ) for( ; p_out < p_out_end ; )
{ {
p_vout->p_vlc->pf_memcpy( p_out, p_in, p_pic->p[i_plane].i_pitch ); p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_pic->p[i_plane].i_pitch );
p_out += p_pic->p[i_plane].i_pitch; p_out += p_pic->p[i_plane].i_pitch;
p_vout->p_vlc->pf_memcpy( p_out, p_in, p_pic->p[i_plane].i_pitch ); p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_pic->p[i_plane].i_pitch );
p_in += 2 * p_pic->p[i_plane].i_pitch; p_in += 2 * p_pic->p[i_plane].i_pitch;
p_out += p_pic->p[i_plane].i_pitch; p_out += p_pic->p[i_plane].i_pitch;
} }
}
else
{
for( ; p_out < p_out_end ; )
{
p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_pic->p[i_plane].i_pitch );
p_out += p_pic->p[i_plane].i_pitch;
p_in += 2 * p_pic->p[i_plane].i_pitch;
}
}
p_vout->p_vlc->pf_memcpy( p_out, p_in, p_pic->p[i_plane].i_pitch ); p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_pic->p[i_plane].i_pitch );
/* For TOP field we need to add the last line */ /* For TOP field we need to add the last line */
if( i_field == 0 ) if( i_field == 0 )
{ {
p_in += p_pic->p[i_plane].i_pitch; p_in += p_pic->p[i_plane].i_pitch;
p_out += p_pic->p[i_plane].i_pitch; p_out += p_pic->p[i_plane].i_pitch;
p_vout->p_vlc->pf_memcpy( p_out, p_in, p_pic->p[i_plane].i_pitch ); p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_pic->p[i_plane].i_pitch );
}
break;
} }
} }
} }
...@@ -653,12 +718,36 @@ static void RenderBlend( vout_thread_t *p_vout, ...@@ -653,12 +718,36 @@ static void RenderBlend( vout_thread_t *p_vout,
p_out_end = p_out + p_outpic->p[i_plane].i_pitch p_out_end = p_out + p_outpic->p[i_plane].i_pitch
* p_outpic->p[i_plane].i_lines; * p_outpic->p[i_plane].i_lines;
switch( p_vout->render.i_chroma )
{
case VLC_FOURCC('I','4','2','0'):
case VLC_FOURCC('I','Y','U','V'):
case VLC_FOURCC('Y','V','1','2'):
/* First line: simple copy */
p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_pic->p[i_plane].i_pitch );
p_out += p_pic->p[i_plane].i_pitch;
/* Remaining lines: mean value */
for( ; p_out < p_out_end ; )
{
Merge( p_out, p_in, p_in + p_pic->p[i_plane].i_pitch,
p_pic->p[i_plane].i_pitch );
p_out += p_pic->p[i_plane].i_pitch;
p_in += p_pic->p[i_plane].i_pitch;
}
break;
case VLC_FOURCC('I','4','2','2'):
/* First line: simple copy */ /* First line: simple copy */
p_vout->p_vlc->pf_memcpy( p_out, p_in, p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_pic->p[i_plane].i_pitch ); p_pic->p[i_plane].i_pitch );
p_out += p_pic->p[i_plane].i_pitch; p_out += p_pic->p[i_plane].i_pitch;
/* Remaining lines: mean value */ /* Remaining lines: mean value */
if( i_plane == Y_PLANE )
{
for( ; p_out < p_out_end ; ) for( ; p_out < p_out_end ; )
{ {
Merge( p_out, p_in, p_in + p_pic->p[i_plane].i_pitch, Merge( p_out, p_in, p_in + p_pic->p[i_plane].i_pitch,
...@@ -668,6 +757,21 @@ static void RenderBlend( vout_thread_t *p_vout, ...@@ -668,6 +757,21 @@ static void RenderBlend( vout_thread_t *p_vout,
p_in += p_pic->p[i_plane].i_pitch; p_in += p_pic->p[i_plane].i_pitch;
} }
} }
else
{
for( ; p_out < p_out_end ; )
{
Merge( p_out, p_in, p_in + p_pic->p[i_plane].i_pitch,
p_pic->p[i_plane].i_pitch );
p_out += p_pic->p[i_plane].i_pitch;
p_in += 2*p_pic->p[i_plane].i_pitch;
}
}
break;
}
}
} }
static void Merge( void *_p_dest, const void *_p_s1, static void Merge( void *_p_dest, const void *_p_s1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment