Commit 00a30b7b authored by Sam Hocevar's avatar Sam Hocevar

* ./modules/video_filter/*.c: all filters now properly use i_visible_pitch

    instead of i_pitch for pixel access (Closes: #30).
parent b7529857
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* adjust.c : Contrast/Hue/Saturation/Brightness video plugin for vlc * adjust.c : Contrast/Hue/Saturation/Brightness video plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: adjust.c,v 1.7 2003/01/09 16:26:14 sam Exp $ * $Id: adjust.c,v 1.8 2003/01/09 17:47:05 sam Exp $
* *
* Authors: Simon Latapie <garf@via.ecp.fr>, Samuel Hocevar <sam@zoy.org> * Authors: Simon Latapie <garf@via.ecp.fr>, Samuel Hocevar <sam@zoy.org>
* *
...@@ -195,8 +195,8 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -195,8 +195,8 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
int pi_luma[256]; int pi_luma[256];
picture_t *p_outpic; picture_t *p_outpic;
uint8_t *p_in, *p_in_u, *p_in_v, *p_in_end, *p_line_end; uint8_t *p_in, *p_in_v, *p_in_end, *p_line_end;
uint8_t *p_out, *p_out_u, *p_out_v; uint8_t *p_out, *p_out_v;
double f_hue; double f_hue;
int32_t i_cont, i_lum; int32_t i_cont, i_lum;
...@@ -263,17 +263,18 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -263,17 +263,18 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
} }
p_in += p_pic->p[0].i_pitch - p_pic->p[0].i_visible_pitch; p_in += p_pic->p[0].i_pitch - p_pic->p[0].i_visible_pitch;
p_out += p_outpic->p[0].i_pitch - p_outpic->p[0].i_visible_pitch;
} }
/* /*
* Do the U and V planes * Do the U and V planes
*/ */
p_in_u = p_pic->p[1].p_pixels; p_in = p_pic->p[1].p_pixels;
p_in_v = p_pic->p[2].p_pixels; p_in_v = p_pic->p[2].p_pixels;
p_in_end = p_in_u + p_pic->p[1].i_lines * p_pic->p[1].i_pitch - 8; p_in_end = p_in + p_pic->p[1].i_lines * p_pic->p[1].i_pitch - 8;
p_out_u = p_outpic->p[1].p_pixels; p_out = p_outpic->p[1].p_pixels;
p_out_v = p_outpic->p[2].p_pixels; p_out_v = p_outpic->p[2].p_pixels;
i_sin = sin(f_hue) * 256; i_sin = sin(f_hue) * 256;
...@@ -285,19 +286,19 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -285,19 +286,19 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
if ( i_sat > 256 ) if ( i_sat > 256 )
{ {
#define WRITE_UV_CLIP() \ #define WRITE_UV_CLIP() \
i_u = *p_in_u++ ; i_v = *p_in_v++ ; \ i_u = *p_in++ ; i_v = *p_in_v++ ; \
*p_out_u++ = clip( (( ((i_u * i_cos + i_v * i_sin - i_x) >> 8) \ *p_out++ = clip( (( ((i_u * i_cos + i_v * i_sin - i_x) >> 8) \
* i_sat) >> 8) + 128); \ * i_sat) >> 8) + 128); \
*p_out_v++ = clip( (( ((i_v * i_cos - i_u * i_sin - i_y) >> 8) \ *p_out_v++ = clip( (( ((i_v * i_cos - i_u * i_sin - i_y) >> 8) \
* i_sat) >> 8) + 128) * i_sat) >> 8) + 128)
uint8_t i_u, i_v; uint8_t i_u, i_v;
for( ; p_in_u < p_in_end ; ) for( ; p_in < p_in_end ; )
{ {
p_line_end = p_in_u + p_pic->p[1].i_visible_pitch - 8; p_line_end = p_in + p_pic->p[1].i_visible_pitch - 8;
for( ; p_in_u < p_line_end ; ) for( ; p_in < p_line_end ; )
{ {
/* Do 8 pixels at a time */ /* Do 8 pixels at a time */
WRITE_UV_CLIP(); WRITE_UV_CLIP(); WRITE_UV_CLIP(); WRITE_UV_CLIP();
...@@ -308,33 +309,33 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -308,33 +309,33 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
p_line_end += 8; p_line_end += 8;
for( ; p_in_u < p_line_end ; ) for( ; p_in < p_line_end ; )
{ {
WRITE_UV_CLIP(); WRITE_UV_CLIP();
} }
p_in_u += p_pic->p[1].i_pitch - p_pic->p[1].i_visible_pitch; p_in += p_pic->p[1].i_pitch - p_pic->p[1].i_visible_pitch;
p_in_v += p_pic->p[2].i_pitch - p_pic->p[2].i_visible_pitch; p_in_v += p_pic->p[2].i_pitch - p_pic->p[2].i_visible_pitch;
p_out_u += p_pic->p[1].i_pitch - p_pic->p[1].i_visible_pitch; p_out += p_outpic->p[1].i_pitch - p_outpic->p[1].i_visible_pitch;
p_out_v += p_pic->p[2].i_pitch - p_pic->p[2].i_visible_pitch; p_out_v += p_outpic->p[2].i_pitch - p_outpic->p[2].i_visible_pitch;
} }
} }
else else
{ {
#define WRITE_UV() \ #define WRITE_UV() \
i_u = *p_in_u++ ; i_v = *p_in_v++ ; \ i_u = *p_in++ ; i_v = *p_in_v++ ; \
*p_out_u++ = (( ((i_u * i_cos + i_v * i_sin - i_x) >> 8) \ *p_out++ = (( ((i_u * i_cos + i_v * i_sin - i_x) >> 8) \
* i_sat) >> 8) + 128; \ * i_sat) >> 8) + 128; \
*p_out_v++ = (( ((i_v * i_cos - i_u * i_sin - i_y) >> 8) \ *p_out_v++ = (( ((i_v * i_cos - i_u * i_sin - i_y) >> 8) \
* i_sat) >> 8) + 128 * i_sat) >> 8) + 128
uint8_t i_u, i_v; uint8_t i_u, i_v;
for( ; p_in_u < p_in_end ; ) for( ; p_in < p_in_end ; )
{ {
p_line_end = p_in + p_pic->p[1].i_visible_pitch - 8; p_line_end = p_in + p_pic->p[1].i_visible_pitch - 8;
for( ; p_in_u < p_line_end ; ) for( ; p_in < p_line_end ; )
{ {
/* Do 8 pixels at a time */ /* Do 8 pixels at a time */
WRITE_UV(); WRITE_UV(); WRITE_UV(); WRITE_UV(); WRITE_UV(); WRITE_UV(); WRITE_UV(); WRITE_UV();
...@@ -343,15 +344,15 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -343,15 +344,15 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
p_line_end += 8; p_line_end += 8;
for( ; p_in_u < p_line_end ; ) for( ; p_in < p_line_end ; )
{ {
WRITE_UV(); WRITE_UV();
} }
p_in_u += p_pic->p[1].i_pitch - p_pic->p[1].i_visible_pitch; p_in += p_pic->p[1].i_pitch - p_pic->p[1].i_visible_pitch;
p_in_v += p_pic->p[2].i_pitch - p_pic->p[2].i_visible_pitch; p_in_v += p_pic->p[2].i_pitch - p_pic->p[2].i_visible_pitch;
p_out_u += p_pic->p[1].i_pitch - p_pic->p[1].i_visible_pitch; p_out += p_outpic->p[1].i_pitch - p_outpic->p[1].i_visible_pitch;
p_out_v += p_pic->p[2].i_pitch - p_pic->p[2].i_visible_pitch; p_out_v += p_outpic->p[2].i_pitch - p_outpic->p[2].i_visible_pitch;
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* clone.c : Clone video plugin for vlc * clone.c : Clone video plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: clone.c,v 1.3 2002/11/28 17:35:00 sam Exp $ * $Id: clone.c,v 1.4 2003/01/09 17:47:05 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -217,24 +217,32 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -217,24 +217,32 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ ) for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
{ {
u8 *p_in, *p_in_end, *p_out; uint8_t *p_in, *p_in_end, *p_out;
int i_in_pitch = p_pic->p[i_plane].i_pitch; int i_in_pitch = p_pic->p[i_plane].i_pitch;
const int i_out_pitch = p_outpic->p[i_plane].i_pitch; const int i_out_pitch = p_outpic->p[i_plane].i_pitch;
const int i_copy_pitch = p_outpic->p[i_plane].i_visible_pitch;
p_in = p_pic->p[i_plane].p_pixels; p_in = p_pic->p[i_plane].p_pixels;
p_in_end = p_in + p_outpic->p[i_plane].i_lines
* p_pic->p[i_plane].i_pitch;
p_out = p_outpic->p[i_plane].p_pixels; p_out = p_outpic->p[i_plane].p_pixels;
if( i_in_pitch == i_copy_pitch
&& i_out_pitch == i_copy_pitch )
{
p_vout->p_vlc->pf_memcpy( p_out, p_in, i_in_pitch
* p_outpic->p[i_plane].i_lines );
}
else
{
p_in_end = p_in + i_in_pitch * p_outpic->p[i_plane].i_lines;
while( p_in < p_in_end ) while( p_in < p_in_end )
{ {
p_vout->p_vlc->pf_memcpy( p_out, p_in, i_out_pitch ); p_vout->p_vlc->pf_memcpy( p_out, p_in, i_copy_pitch );
p_in += i_in_pitch; p_in += i_in_pitch;
p_out += i_out_pitch; p_out += i_out_pitch;
} }
} }
}
vout_UnlinkPicture( p_vout->p_sys->pp_vout[ i_vout ], p_outpic ); vout_UnlinkPicture( p_vout->p_sys->pp_vout[ i_vout ], p_outpic );
vout_DisplayPicture( p_vout->p_sys->pp_vout[ i_vout ], p_outpic ); vout_DisplayPicture( p_vout->p_sys->pp_vout[ i_vout ], p_outpic );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* crop.c : Crop video plugin for vlc * crop.c : Crop video plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: crop.c,v 1.5 2002/12/06 16:34:07 sam Exp $ * $Id: crop.c,v 1.6 2003/01/09 17:47:05 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -98,7 +98,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -98,7 +98,7 @@ static int Create( vlc_object_t *p_this )
if( p_vout->p_sys == NULL ) if( p_vout->p_sys == NULL )
{ {
msg_Err( p_vout, "out of memory" ); msg_Err( p_vout, "out of memory" );
return 1; return VLC_ENOMEM;
} }
p_vout->pf_init = Init; p_vout->pf_init = Init;
...@@ -107,7 +107,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -107,7 +107,7 @@ static int Create( vlc_object_t *p_this )
p_vout->pf_render = Render; p_vout->pf_render = Render;
p_vout->pf_display = NULL; p_vout->pf_display = NULL;
return 0; return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
...@@ -122,7 +122,7 @@ static int Init( vout_thread_t *p_vout ) ...@@ -122,7 +122,7 @@ static int Init( vout_thread_t *p_vout )
I_OUTPUTPICTURES = 0; I_OUTPUTPICTURES = 0;
p_vout->p_sys->i_lastchange = 0; p_vout->p_sys->i_lastchange = 0;
p_vout->p_sys->b_changed = 0; p_vout->p_sys->b_changed = VLC_FALSE;
/* Initialize the output structure */ /* Initialize the output structure */
p_vout->output.i_chroma = p_vout->render.i_chroma; p_vout->output.i_chroma = p_vout->render.i_chroma;
...@@ -238,12 +238,12 @@ static int Init( vout_thread_t *p_vout ) ...@@ -238,12 +238,12 @@ static int Init( vout_thread_t *p_vout )
if( p_vout->p_sys->p_vout == NULL ) if( p_vout->p_sys->p_vout == NULL )
{ {
msg_Err( p_vout, "failed to create vout" ); msg_Err( p_vout, "failed to create vout" );
return 0; return VLC_EGENERIC;
} }
ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES ); ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
return 0; return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
...@@ -284,7 +284,7 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -284,7 +284,7 @@ static int Manage( vout_thread_t *p_vout )
{ {
if( !p_vout->p_sys->b_changed ) if( !p_vout->p_sys->b_changed )
{ {
return 0; return VLC_SUCCESS;
} }
vout_Destroy( p_vout->p_sys->p_vout ); vout_Destroy( p_vout->p_sys->p_vout );
...@@ -295,13 +295,13 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -295,13 +295,13 @@ static int Manage( vout_thread_t *p_vout )
if( p_vout->p_sys->p_vout == NULL ) if( p_vout->p_sys->p_vout == NULL )
{ {
msg_Err( p_vout, "failed to create vout" ); msg_Err( p_vout, "failed to create vout" );
return 1; return VLC_EGENERIC;
} }
p_vout->p_sys->b_changed = 0; p_vout->p_sys->b_changed = VLC_FALSE;
p_vout->p_sys->i_lastchange = 0; p_vout->p_sys->i_lastchange = 0;
return 0; return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
...@@ -339,9 +339,10 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -339,9 +339,10 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ ) for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
{ {
u8 *p_in, *p_out, *p_out_end; uint8_t *p_in, *p_out, *p_out_end;
int i_in_pitch = p_pic->p[i_plane].i_pitch; int i_in_pitch = p_pic->p[i_plane].i_pitch;
const int i_out_pitch = p_outpic->p[i_plane].i_pitch; const int i_out_pitch = p_outpic->p[i_plane].i_pitch;
const int i_copy_pitch = p_outpic->p[i_plane].i_visible_pitch;
p_in = p_pic->p[i_plane].p_pixels p_in = p_pic->p[i_plane].p_pixels
/* Skip the right amount of lines */ /* Skip the right amount of lines */
...@@ -355,7 +356,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -355,7 +356,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
while( p_out < p_out_end ) while( p_out < p_out_end )
{ {
p_vout->p_vlc->pf_memcpy( p_out, p_in, i_out_pitch ); p_vout->p_vlc->pf_memcpy( p_out, p_in, i_copy_pitch );
p_in += i_in_pitch; p_in += i_in_pitch;
p_out += i_out_pitch; p_out += i_out_pitch;
} }
...@@ -365,18 +366,17 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -365,18 +366,17 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic ); vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic );
/* The source image may still be in the cache ... parse it! */ /* The source image may still be in the cache ... parse it! */
if( !p_vout->p_sys->b_autocrop ) if( p_vout->p_sys->b_autocrop )
{ {
return;
}
UpdateStats( p_vout, p_pic ); UpdateStats( p_vout, p_pic );
}
} }
static void UpdateStats( vout_thread_t *p_vout, picture_t *p_pic ) static void UpdateStats( vout_thread_t *p_vout, picture_t *p_pic )
{ {
uint8_t *p_in = p_pic->p[0].p_pixels; uint8_t *p_in = p_pic->p[0].p_pixels;
int i_pitch = p_pic->p[0].i_pitch; int i_pitch = p_pic->p[0].i_pitch;
int i_visible_pitch = p_pic->p[0].i_visible_pitch;
int i_lines = p_pic->p[0].i_lines; int i_lines = p_pic->p[0].i_lines;
int i_firstwhite = -1, i_lastwhite = -1, i; int i_firstwhite = -1, i_lastwhite = -1, i;
...@@ -391,8 +391,8 @@ static void UpdateStats( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -391,8 +391,8 @@ static void UpdateStats( vout_thread_t *p_vout, picture_t *p_pic )
const int i_col = i * i_pitch / i_lines; const int i_col = i * i_pitch / i_lines;
if( p_in[i_col/2] > 40 if( p_in[i_col/2] > 40
&& p_in[i_pitch / 2] > 40 && p_in[i_visible_pitch/2] > 40
&& p_in[i_pitch/2 + i_col/2] > 40 ) && p_in[i_visible_pitch/2 + i_col/2] > 40 )
{ {
if( i_lastwhite == -1 ) if( i_lastwhite == -1 )
{ {
...@@ -457,5 +457,6 @@ static void UpdateStats( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -457,5 +457,6 @@ static void UpdateStats( vout_thread_t *p_vout, picture_t *p_pic )
* p_vout->output.i_height / p_vout->p_sys->i_height * p_vout->output.i_height / p_vout->p_sys->i_height
* p_vout->p_sys->i_width / p_vout->output.i_width; * p_vout->p_sys->i_width / p_vout->output.i_width;
p_vout->p_sys->b_changed = 1; p_vout->p_sys->b_changed = VLC_TRUE;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* distort.c : Misc video effects plugin for vlc * distort.c : Misc video effects plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: distort.c,v 1.4 2002/11/28 17:35:00 sam Exp $ * $Id: distort.c,v 1.5 2003/01/09 17:47:05 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -99,7 +99,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -99,7 +99,7 @@ static int Create( vlc_object_t *p_this )
if( p_vout->p_sys == NULL ) if( p_vout->p_sys == NULL )
{ {
msg_Err( p_vout, "out of memory" ); msg_Err( p_vout, "out of memory" );
return( 1 ); return VLC_ENOMEM;
} }
p_vout->pf_init = Init; p_vout->pf_init = Init;
...@@ -113,7 +113,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -113,7 +113,7 @@ static int Create( vlc_object_t *p_this )
if( !(psz_method = psz_method_tmp = config_GetPsz( p_vout, "filter" )) ) if( !(psz_method = psz_method_tmp = config_GetPsz( p_vout, "filter" )) )
{ {
msg_Err( p_vout, "configuration variable %s empty", "filter" ); msg_Err( p_vout, "configuration variable %s empty", "filter" );
return( 1 ); return VLC_EGENERIC;
} }
while( *psz_method && *psz_method != ':' ) while( *psz_method && *psz_method != ':' )
{ {
...@@ -150,7 +150,6 @@ static int Create( vlc_object_t *p_this ) ...@@ -150,7 +150,6 @@ static int Create( vlc_object_t *p_this )
{ {
p_vout->p_sys->i_mode = DISTORT_MODE_RIPPLE; p_vout->p_sys->i_mode = DISTORT_MODE_RIPPLE;
} }
else else
{ {
msg_Err( p_vout, "no valid distort mode provided, " msg_Err( p_vout, "no valid distort mode provided, "
...@@ -161,7 +160,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -161,7 +160,7 @@ static int Create( vlc_object_t *p_this )
} }
free( psz_method_tmp ); free( psz_method_tmp );
return( 0 ); return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
...@@ -192,7 +191,7 @@ static int Init( vout_thread_t *p_vout ) ...@@ -192,7 +191,7 @@ static int Init( vout_thread_t *p_vout )
{ {
msg_Err( p_vout, "cannot open vout, aborting" ); msg_Err( p_vout, "cannot open vout, aborting" );
return( 0 ); return VLC_EGENERIC;
} }
ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES ); ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
...@@ -200,7 +199,7 @@ static int Init( vout_thread_t *p_vout ) ...@@ -200,7 +199,7 @@ static int Init( vout_thread_t *p_vout )
p_vout->p_sys->f_angle = 0.0; p_vout->p_sys->f_angle = 0.0;
p_vout->p_sys->last_date = 0; p_vout->p_sys->last_date = 0;
return( 0 ); return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
...@@ -290,8 +289,8 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic, ...@@ -290,8 +289,8 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
for( i_index = 0 ; i_index < p_inpic->i_planes ; i_index++ ) for( i_index = 0 ; i_index < p_inpic->i_planes ; i_index++ )
{ {
int i_line, i_num_lines, i_offset; int i_line, i_num_lines, i_offset;
u8 black_pixel; uint8_t black_pixel;
u8 *p_in, *p_out; uint8_t *p_in, *p_out;
p_in = p_inpic->p[i_index].p_pixels; p_in = p_inpic->p[i_index].p_pixels;
p_out = p_outpic->p[i_index].p_pixels; p_out = p_outpic->p[i_index].p_pixels;
...@@ -304,7 +303,7 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic, ...@@ -304,7 +303,7 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
for( i_line = 0 ; i_line < i_num_lines ; i_line++ ) for( i_line = 0 ; i_line < i_num_lines ; i_line++ )
{ {
/* Calculate today's offset, don't go above 1/20th of the screen */ /* Calculate today's offset, don't go above 1/20th of the screen */
i_offset = (int)( (double)(p_inpic->p[i_index].i_pitch) i_offset = (int)( (double)(p_inpic->p[i_index].i_visible_pitch)
* sin( f_angle + 10.0 * (double)i_line * sin( f_angle + 10.0 * (double)i_line
/ (double)i_num_lines ) / (double)i_num_lines )
/ 20.0 ); / 20.0 );
...@@ -314,7 +313,7 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic, ...@@ -314,7 +313,7 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
if( i_offset < 0 ) if( i_offset < 0 )
{ {
p_vout->p_vlc->pf_memcpy( p_out, p_in - i_offset, p_vout->p_vlc->pf_memcpy( p_out, p_in - i_offset,
p_inpic->p[i_index].i_pitch + i_offset ); p_inpic->p[i_index].i_visible_pitch + i_offset );
p_in += p_inpic->p[i_index].i_pitch; p_in += p_inpic->p[i_index].i_pitch;
p_out += p_outpic->p[i_index].i_pitch; p_out += p_outpic->p[i_index].i_pitch;
memset( p_out + i_offset, black_pixel, -i_offset ); memset( p_out + i_offset, black_pixel, -i_offset );
...@@ -322,7 +321,7 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic, ...@@ -322,7 +321,7 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
else else
{ {
p_vout->p_vlc->pf_memcpy( p_out + i_offset, p_in, p_vout->p_vlc->pf_memcpy( p_out + i_offset, p_in,
p_inpic->p[i_index].i_pitch - i_offset ); p_inpic->p[i_index].i_visible_pitch - i_offset );
memset( p_out, black_pixel, i_offset ); memset( p_out, black_pixel, i_offset );
p_in += p_inpic->p[i_index].i_pitch; p_in += p_inpic->p[i_index].i_pitch;
p_out += p_outpic->p[i_index].i_pitch; p_out += p_outpic->p[i_index].i_pitch;
...@@ -331,7 +330,7 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic, ...@@ -331,7 +330,7 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
else else
{ {
p_vout->p_vlc->pf_memcpy( p_out, p_in, p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_inpic->p[i_index].i_pitch ); p_inpic->p[i_index].i_visible_pitch );
p_in += p_inpic->p[i_index].i_pitch; p_in += p_inpic->p[i_index].i_pitch;
p_out += p_outpic->p[i_index].i_pitch; p_out += p_outpic->p[i_index].i_pitch;
} }
...@@ -357,8 +356,8 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic, ...@@ -357,8 +356,8 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic,
for( i_index = 0 ; i_index < p_inpic->i_planes ; i_index++ ) for( i_index = 0 ; i_index < p_inpic->i_planes ; i_index++ )
{ {
int i_line, i_first_line, i_num_lines, i_offset; int i_line, i_first_line, i_num_lines, i_offset;
u8 black_pixel; uint8_t black_pixel;
u8 *p_in, *p_out; uint8_t *p_in, *p_out;
black_pixel = ( i_index == Y_PLANE ) ? 0x00 : 0x80; black_pixel = ( i_index == Y_PLANE ) ? 0x00 : 0x80;
...@@ -369,11 +368,13 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic, ...@@ -369,11 +368,13 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic,
p_in = p_inpic->p[i_index].p_pixels; p_in = p_inpic->p[i_index].p_pixels;
p_out = p_outpic->p[i_index].p_pixels; p_out = p_outpic->p[i_index].p_pixels;
for( i_line = 0 ; i_line < i_first_line ; i_line++ )
{
p_vout->p_vlc->pf_memcpy( p_out, p_in, p_vout->p_vlc->pf_memcpy( p_out, p_in,
i_first_line * p_inpic->p[i_index].i_pitch ); p_inpic->p[i_index].i_visible_pitch );
p_in += p_inpic->p[i_index].i_pitch;
p_in += i_first_line * p_inpic->p[i_index].i_pitch; p_out += p_outpic->p[i_index].i_pitch;
p_out += i_first_line * p_outpic->p[i_index].i_pitch; }
/* Ok, we do 3 times the sin() calculation for each line. So what ? */ /* Ok, we do 3 times the sin() calculation for each line. So what ? */
for( i_line = i_first_line ; i_line < i_num_lines ; i_line++ ) for( i_line = i_first_line ; i_line < i_num_lines ; i_line++ )
...@@ -392,7 +393,7 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic, ...@@ -392,7 +393,7 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic,
if( i_offset < 0 ) if( i_offset < 0 )
{ {
p_vout->p_vlc->pf_memcpy( p_out, p_in - i_offset, p_vout->p_vlc->pf_memcpy( p_out, p_in - i_offset,
p_inpic->p[i_index].i_pitch + i_offset ); p_inpic->p[i_index].i_visible_pitch + i_offset );
p_in -= p_inpic->p[i_index].i_pitch; p_in -= p_inpic->p[i_index].i_pitch;
p_out += p_outpic->p[i_index].i_pitch; p_out += p_outpic->p[i_index].i_pitch;
memset( p_out + i_offset, black_pixel, -i_offset ); memset( p_out + i_offset, black_pixel, -i_offset );
...@@ -400,7 +401,7 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic, ...@@ -400,7 +401,7 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic,
else else
{ {
p_vout->p_vlc->pf_memcpy( p_out + i_offset, p_in, p_vout->p_vlc->pf_memcpy( p_out + i_offset, p_in,
p_inpic->p[i_index].i_pitch - i_offset ); p_inpic->p[i_index].i_visible_pitch - i_offset );
memset( p_out, black_pixel, i_offset ); memset( p_out, black_pixel, i_offset );
p_in -= p_inpic->p[i_index].i_pitch; p_in -= p_inpic->p[i_index].i_pitch;
p_out += p_outpic->p[i_index].i_pitch; p_out += p_outpic->p[i_index].i_pitch;
...@@ -409,7 +410,7 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic, ...@@ -409,7 +410,7 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic,
else else
{ {
p_vout->p_vlc->pf_memcpy( p_out, p_in, p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_inpic->p[i_index].i_pitch ); p_inpic->p[i_index].i_visible_pitch );
p_in -= p_inpic->p[i_index].i_pitch; p_in -= p_inpic->p[i_index].i_pitch;
p_out += p_outpic->p[i_index].i_pitch; p_out += p_outpic->p[i_index].i_pitch;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* invert.c : Invert video plugin for vlc * invert.c : Invert video plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: invert.c,v 1.3 2002/11/28 17:35:00 sam Exp $ * $Id: invert.c,v 1.4 2003/01/09 17:47:05 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -182,34 +182,43 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -182,34 +182,43 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ ) for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
{ {
u8 *p_in, *p_in_end, *p_out; uint8_t *p_in, *p_in_end, *p_line_end, *p_out;
p_in = p_pic->p[i_index].p_pixels; p_in = p_pic->p[i_index].p_pixels;
p_in_end = p_in - 64 + p_pic->p[i_index].i_lines p_in_end = p_in + p_pic->p[i_index].i_lines
* p_pic->p[i_index].i_pitch; * p_pic->p[i_index].i_pitch;
p_out = p_outpic->p[i_index].p_pixels; p_out = p_outpic->p[i_index].p_pixels;
for( ; p_in < p_in_end ; ) for( ; p_in < p_in_end ; )
{
p_line_end = p_in + p_pic->p[i_index].i_visible_pitch - 64;
for( ; p_in < p_line_end ; )
{ {
/* Do 64 pixels at a time */ /* Do 64 pixels at a time */
*((u64*)p_out)++ = ~( *((u64*)p_in)++ ); *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ );
*((u64*)p_out)++ = ~( *((u64*)p_in)++ ); *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ );
*((u64*)p_out)++ = ~( *((u64*)p_in)++ ); *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ );
*((u64*)p_out)++ = ~( *((u64*)p_in)++ ); *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ );
*((u64*)p_out)++ = ~( *((u64*)p_in)++ ); *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ );
*((u64*)p_out)++ = ~( *((u64*)p_in)++ ); *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ );
*((u64*)p_out)++ = ~( *((u64*)p_in)++ ); *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ );
*((u64*)p_out)++ = ~( *((u64*)p_in)++ ); *((uint64_t*)p_out)++ = ~( *((uint64_t*)p_in)++ );
} }
p_in_end += 64; p_line_end += 64;
for( ; p_in < p_in_end ; ) for( ; p_in < p_line_end ; )
{ {
/* Do 1 pixel at a time */
*p_out++ = ~( *p_in++ ); *p_out++ = ~( *p_in++ );
} }
p_in += p_pic->p[i_index].i_pitch
- p_pic->p[i_index].i_visible_pitch;
p_out += p_outpic->p[i_index].i_pitch
- p_outpic->p[i_index].i_visible_pitch;
}
} }
vout_UnlinkPicture( p_vout->p_sys->p_vout, p_outpic ); vout_UnlinkPicture( p_vout->p_sys->p_vout, p_outpic );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* motion_blur.c : motion blur filter for vlc * motion_blur.c : motion blur filter for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: motionblur.c,v 1.4 2002/11/28 17:35:00 sam Exp $ * $Id: motionblur.c,v 1.5 2003/01/09 17:47:05 sam Exp $
* *
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* *
...@@ -91,7 +91,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -91,7 +91,7 @@ static int Create( vlc_object_t *p_this )
if( p_vout->p_sys == NULL ) if( p_vout->p_sys == NULL )
{ {
msg_Err( p_vout, "out of memory" ); msg_Err( p_vout, "out of memory" );
return 1; return VLC_ENOMEM;
} }
p_vout->pf_init = Init; p_vout->pf_init = Init;
...@@ -105,7 +105,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -105,7 +105,7 @@ static int Create( vlc_object_t *p_this )
p_vout->p_sys->last_date = 0; p_vout->p_sys->last_date = 0;
p_vout->p_sys->p_lastpic = NULL; p_vout->p_sys->p_lastpic = NULL;
return 0; return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
...@@ -133,7 +133,7 @@ static int Init( vout_thread_t *p_vout ) ...@@ -133,7 +133,7 @@ static int Init( vout_thread_t *p_vout )
break; break;
default: default:
return 0; /* unknown chroma */ return VLC_EGENERIC; /* unknown chroma */
break; break;
} }
...@@ -157,12 +157,12 @@ static int Init( vout_thread_t *p_vout ) ...@@ -157,12 +157,12 @@ static int Init( vout_thread_t *p_vout )
{ {
msg_Err( p_vout, "cannot open vout, aborting" ); msg_Err( p_vout, "cannot open vout, aborting" );
return 0; return VLC_EGENERIC;
} }
ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES ); ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
return 0; return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
...@@ -252,28 +252,44 @@ static void Render ( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -252,28 +252,44 @@ static void Render ( vout_thread_t *p_vout, picture_t *p_pic )
} }
CopyPicture( p_vout, p_vout->p_sys->p_lastpic, p_outpic ); CopyPicture( p_vout, p_vout->p_sys->p_lastpic, p_outpic );
vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic ); vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic );
} }
static void CopyPicture( vout_thread_t *p_vout, /* FIXME: this is a verbatim copy from src/video_output/vout_pictures.c */
picture_t *p_dest, picture_t *p_source) /* XXX: the order is fucked up!! */
static void CopyPicture( vout_thread_t * p_vout,
picture_t *p_dest, picture_t *p_src )
{ {
int i_plane; int i;
for( i_plane = 0 ; i_plane < p_dest->i_planes ; i_plane++ ) for( i = 0; i < p_src->i_planes ; i++ )
{ {
u8 *p_in, *p_out; if( p_src->p[i].i_pitch == p_dest->p[i].i_pitch )
{
p_in = p_source->p[i_plane].p_pixels; /* There are margins, but with the same width : perfect ! */
p_vout->p_vlc->pf_memcpy(
p_dest->p[i].p_pixels, p_src->p[i].p_pixels,
p_src->p[i].i_pitch * p_src->p[i].i_lines );
}
else
{
/* We need to proceed line by line */
uint8_t *p_in = p_src->p[i].p_pixels;
uint8_t *p_out = p_dest->p[i].p_pixels;
int i_line;
p_out = p_dest->p[i_plane].p_pixels; for( i_line = p_src->p[i].i_lines; i_line--; )
{
p_vout->p_vlc->pf_memcpy( p_out, p_in, p_vout->p_vlc->pf_memcpy( p_out, p_in,
p_dest->p[i_plane].i_pitch * p_src->p[i].i_visible_pitch );
p_dest->p[i_plane].i_lines); p_in += p_src->p[i].i_pitch;
p_out += p_dest->p[i].i_pitch;
}
}
} }
} }
/***************************************************************************** /*****************************************************************************
* RenderBob: renders a bob picture * RenderBlur: renders a blurred picture
*****************************************************************************/ *****************************************************************************/
static void RenderBlur( vout_thread_t *p_vout, picture_t *p_oldpic, static void RenderBlur( vout_thread_t *p_vout, picture_t *p_oldpic,
picture_t *p_newpic, picture_t *p_outpic ) picture_t *p_newpic, picture_t *p_outpic )
...@@ -283,19 +299,31 @@ static void RenderBlur( vout_thread_t *p_vout, picture_t *p_oldpic, ...@@ -283,19 +299,31 @@ static void RenderBlur( vout_thread_t *p_vout, picture_t *p_oldpic,
int i_newfactor = 128 - p_vout->p_sys->i_factor; int i_newfactor = 128 - p_vout->p_sys->i_factor;
for( i_plane = 0; i_plane < p_outpic->i_planes; i_plane++ ) for( i_plane = 0; i_plane < p_outpic->i_planes; i_plane++ )
{ {
u8 *p_old, *p_new, *p_out, *p_out_end; uint8_t *p_old, *p_new, *p_out, *p_out_end, *p_out_line_end;
p_out = p_outpic->p[i_plane].p_pixels; p_out = p_outpic->p[i_plane].p_pixels;
p_new = p_newpic->p[i_plane].p_pixels; p_new = p_newpic->p[i_plane].p_pixels;
p_old = p_oldpic->p[i_plane].p_pixels; p_old = p_oldpic->p[i_plane].p_pixels;
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;
while ( p_out < p_out_end ) while ( p_out < p_out_end )
{
p_out_line_end = p_out + p_outpic->p[i_plane].i_visible_pitch;
while ( p_out < p_out_line_end )
{ {
*p_out++ = (((*p_old++) * i_oldfactor) + *p_out++ = (((*p_old++) * i_oldfactor) +
((*p_new++) * i_newfactor)) >> 7; ((*p_new++) * i_newfactor)) >> 7;
// *p_out++ = (*p_old++ >> 1) + (*p_new++ >> 1); // *p_out++ = (*p_old++ >> 1) + (*p_new++ >> 1);
}
p_old += p_oldpic->p[i_plane].i_pitch
- p_oldpic->p[i_plane].i_visible_pitch;
p_new += p_newpic->p[i_plane].i_pitch
- p_newpic->p[i_plane].i_visible_pitch;
p_out += p_outpic->p[i_plane].i_pitch
- p_outpic->p[i_plane].i_visible_pitch;
} }
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* transform.c : transform image plugin for vlc * transform.c : transform image plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: transform.c,v 1.5 2003/01/09 14:00:00 sam Exp $ * $Id: transform.c,v 1.6 2003/01/09 17:47:05 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -288,7 +288,6 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -288,7 +288,6 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
break; break;
case TRANSFORM_MODE_180: case TRANSFORM_MODE_180:
/* FIXME: we should use i_visible_pitch here */
for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ ) for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
{ {
uint8_t *p_in = p_pic->p[i_index].p_pixels; uint8_t *p_in = p_pic->p[i_index].p_pixels;
...@@ -298,9 +297,19 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -298,9 +297,19 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
uint8_t *p_out = p_outpic->p[i_index].p_pixels; uint8_t *p_out = p_outpic->p[i_index].p_pixels;
for( ; p_in < p_in_end ; ) for( ; p_in < p_in_end ; )
{
uint8_t *p_line_start = p_in - p_pic->p[i_index].i_pitch;
p_in_end -= p_pic->p[i_index].i_pitch
- p_pic->p[i_index].i_visible_pitch;
for( ; p_line_start < p_in_end ; )
{ {
*p_out++ = *(--p_in_end); *p_out++ = *(--p_in_end);
} }
p_out += p_outpic->p[i_index].i_pitch
- p_outpic->p[i_index].i_visible_pitch;
}
} }
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wall.c : Wall video plugin for vlc * wall.c : Wall video plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: wall.c,v 1.4 2002/11/28 17:35:00 sam Exp $ * $Id: wall.c,v 1.5 2003/01/09 17:47:05 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -106,7 +106,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -106,7 +106,7 @@ static int Create( vlc_object_t *p_this )
if( p_vout->p_sys == NULL ) if( p_vout->p_sys == NULL )
{ {
msg_Err( p_vout, "out of memory" ); msg_Err( p_vout, "out of memory" );
return( 1 ); return VLC_ENOMEM;
} }
p_vout->pf_init = Init; p_vout->pf_init = Init;
...@@ -132,7 +132,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -132,7 +132,7 @@ static int Create( vlc_object_t *p_this )
{ {
msg_Err( p_vout, "out of memory" ); msg_Err( p_vout, "out of memory" );
free( p_vout->p_sys ); free( p_vout->p_sys );
return( 1 ); return VLC_ENOMEM;
} }
psz_method_tmp = psz_method = config_GetPsz( p_vout, "wall-active" ); psz_method_tmp = psz_method = config_GetPsz( p_vout, "wall-active" );
...@@ -185,7 +185,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -185,7 +185,7 @@ static int Create( vlc_object_t *p_this )
free( psz_method_tmp ); free( psz_method_tmp );
return( 0 ); return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
...@@ -258,7 +258,7 @@ static int Init( vout_thread_t *p_vout ) ...@@ -258,7 +258,7 @@ static int Init( vout_thread_t *p_vout )
msg_Err( p_vout, "failed to get %ix%i vout threads", msg_Err( p_vout, "failed to get %ix%i vout threads",
p_vout->p_sys->i_col, p_vout->p_sys->i_row ); p_vout->p_sys->i_col, p_vout->p_sys->i_row );
RemoveAllVout( p_vout ); RemoveAllVout( p_vout );
return 0; return VLC_EGENERIC;
} }
p_vout->p_sys->i_vout++; p_vout->p_sys->i_vout++;
...@@ -267,7 +267,7 @@ static int Init( vout_thread_t *p_vout ) ...@@ -267,7 +267,7 @@ static int Init( vout_thread_t *p_vout )
ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES ); ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
return( 0 ); return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
...@@ -363,9 +363,10 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -363,9 +363,10 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ ) for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
{ {
u8 *p_in, *p_in_end, *p_out; uint8_t *p_in, *p_in_end, *p_out;
int i_in_pitch = p_pic->p[i_plane].i_pitch; int i_in_pitch = p_pic->p[i_plane].i_pitch;
int i_out_pitch = p_outpic->p[i_plane].i_pitch; int i_out_pitch = p_outpic->p[i_plane].i_pitch;
int i_copy_pitch = p_outpic->p[i_plane].i_visible_pitch;
p_in = p_pic->p[i_plane].p_pixels p_in = p_pic->p[i_plane].p_pixels
+ pi_top_skip[i_plane] + pi_left_skip[i_plane]; + pi_top_skip[i_plane] + pi_left_skip[i_plane];
...@@ -377,7 +378,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -377,7 +378,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
while( p_in < p_in_end ) while( p_in < p_in_end )
{ {
p_vout->p_vlc->pf_memcpy( p_out, p_in, i_out_pitch ); p_vout->p_vlc->pf_memcpy( p_out, p_in, i_copy_pitch );
p_in += i_in_pitch; p_in += i_in_pitch;
p_out += i_out_pitch; p_out += i_out_pitch;
} }
......
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