Commit 9ce72981 authored by Antoine Cellerier's avatar Antoine Cellerier

use pf_mem{set,cpy} when possible

parent 3fada58d
......@@ -169,14 +169,16 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
p_out_v = p_outpic->p[V_PLANE].p_pixels;
/* Create grayscale version of input */
memcpy( p_out_y, p_in_y, p_pic->p[Y_PLANE].i_visible_lines
* p_pic->p[Y_PLANE].i_pitch - 8 );
memset( p_out_u, 0x80, p_pic->p[U_PLANE].i_visible_lines
* p_pic->p[U_PLANE].i_pitch - 8 );
memset( p_out_v, 0x80, p_pic->p[U_PLANE].i_visible_lines
* p_pic->p[U_PLANE].i_pitch - 8 );
p_filter->p_libvlc->
pf_memcpy( p_out_y, p_in_y, p_pic->p[Y_PLANE].i_visible_lines
* p_pic->p[Y_PLANE].i_pitch - 8 );
p_filter->p_libvlc->
pf_memset( p_out_u, 0x80, p_pic->p[U_PLANE].i_visible_lines
* p_pic->p[U_PLANE].i_pitch - 8 );
p_filter->p_libvlc->
pf_memset( p_out_v, 0x80, p_pic->p[U_PLANE].i_visible_lines
* p_pic->p[U_PLANE].i_pitch - 8 );
/*
* Do the U and V planes
*/
......
......@@ -501,7 +501,7 @@ static void FilterEdge( filter_t *p_filter, picture_t *p_inpic,
p_outpic->p[Y_PLANE].i_lines * p_outpic->p[Y_PLANE].i_pitch );
p_filter->p_libvlc->pf_memset( p_outpic->p[U_PLANE].p_pixels, 0x80,
p_outpic->p[U_PLANE].i_lines * p_outpic->p[U_PLANE].i_pitch );
memset( p_outpic->p[V_PLANE].p_pixels, 0x80,
p_filter->p_libvlc->pf_memset( p_outpic->p[V_PLANE].p_pixels, 0x80,
p_outpic->p[V_PLANE].i_lines * p_outpic->p[V_PLANE].i_pitch );
}
......@@ -658,7 +658,8 @@ static void FilterHough( filter_t *p_filter, picture_t *p_inpic,
msg_Dbg(p_filter, "Precalculation done");
}
memset( p_hough, 0, i_diag * i_nb_steps * sizeof(int) );
p_filter->p_libvlc->pf_memset( p_hough, 0,
i_diag * i_nb_steps * sizeof(int) );
p_filter->p_libvlc->pf_memcpy(
p_outpic->p[Y_PLANE].p_pixels, p_inpic->p[Y_PLANE].p_pixels,
......
......@@ -261,7 +261,8 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
else
{
#define copy( plane ) \
memcpy( p_outpic->p[plane].p_pixels, p_pic->p[plane].p_pixels, \
p_vout->p_libvlc-> \
pf_memcpy( p_outpic->p[plane].p_pixels, p_pic->p[plane].p_pixels, \
p_outpic->p[plane].i_lines * p_outpic->p[plane].i_pitch );
copy( Y_PLANE );
copy( U_PLANE );
......@@ -280,7 +281,8 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
#define copyimage( plane ) \
for( y=0; y<p_converted->p[plane].i_visible_lines; y++) \
{ \
memcpy( p_outpic->p[plane].p_pixels+y*p_outpic->p[plane].i_pitch, \
p_vout->p_libvlc->pf_memcpy( \
p_outpic->p[plane].p_pixels+y*p_outpic->p[plane].i_pitch, \
p_converted->p[plane].p_pixels+y*p_converted->p[plane].i_pitch, \
p_converted->p[plane].i_visible_pitch ); \
}
......@@ -294,9 +296,9 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
v_w = p_oyp->i_pitch*ZOOM_FACTOR/(VIS_ZOOM*o_zoom);
v_h = (o_y+p_oyp->i_lines*ZOOM_FACTOR/o_zoom)/VIS_ZOOM;
/* top line */
memset( p_oyp->p_pixels
+ o_y/VIS_ZOOM*p_oyp->i_pitch
+ o_x/VIS_ZOOM, 0xff, v_w+1 );
p_vout->p_libvlc->pf_memset( p_oyp->p_pixels
+ o_y/VIS_ZOOM*p_oyp->i_pitch
+ o_x/VIS_ZOOM, 0xff, v_w+1 );
for( y = o_y/VIS_ZOOM+1; y < v_h; y++ )
{
......@@ -310,9 +312,9 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
] = 0xff;
}
/* bottom line */
memset( p_oyp->p_pixels
+ v_h*p_oyp->i_pitch
+ o_x/VIS_ZOOM, 0xff, v_w+1 );
p_vout->p_libvlc->pf_memset( p_oyp->p_pixels
+ v_h*p_oyp->i_pitch
+ o_x/VIS_ZOOM, 0xff, v_w+1 );
/* */
v_h = p_oyp->i_lines/VIS_ZOOM;
......@@ -353,18 +355,18 @@ o o X o o o X X X X X o o X X X X o o o X X X X X o o X X X o o o X X X o o X o
if( p_vout->p_sys->b_visible )
{
/* zoom gauge */
memset( p_oyp->p_pixels
+ (v_h+9)*p_oyp->i_pitch,
0xff, 41 );
p_vout->p_libvlc->pf_memset( p_oyp->p_pixels
+ (v_h+9)*p_oyp->i_pitch,
0xff, 41 );
for( y = v_h + 10; y < v_h + 90; y++ )
{
int width = v_h + 90 - y;
width = (width*width)/160;
if( (80 - y + v_h)*10 < o_zoom )
{
memset( p_oyp->p_pixels
+ y*p_oyp->i_pitch,
0xff, width );
p_vout->p_libvlc->pf_memset( p_oyp->p_pixels
+ y*p_oyp->i_pitch,
0xff, width );
}
else
{
......
......@@ -699,7 +699,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
}
}
/* Gaussian convolution to make it look cleaner */
memset( p_a, 0, 2 * i_pitch );
p_filter->p_libvlc->pf_memset( p_a, 0, 2 * i_pitch );
for( i = 2; i < i_lines - 2; i++ )
{
p_a[i*i_pitch] = 0x00;
......
......@@ -157,9 +157,11 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
v = p_filter->p_sys->v;
for( y = 0; y<p_outpic->p[U_PLANE].i_lines; y++)
{
memset( p_outpic->p[U_PLANE].p_pixels+y*p_outpic->p[U_PLANE].i_pitch,
p_filter->p_libvlc->pf_memset(
p_outpic->p[U_PLANE].p_pixels+y*p_outpic->p[U_PLANE].i_pitch,
u, p_outpic->p[U_PLANE].i_pitch );
memset( p_outpic->p[V_PLANE].p_pixels+y*p_outpic->p[V_PLANE].i_pitch,
p_filter->p_libvlc->pf_memset(
p_outpic->p[V_PLANE].p_pixels+y*p_outpic->p[V_PLANE].i_pitch,
v, p_outpic->p[V_PLANE].i_pitch );
if( v == 0 && u != 0 )
u --;
......
......@@ -373,20 +373,22 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
uint8_t color = ( i_plane == Y_PLANE ? 0x0 : 0x80 );
for( ; i_row < i_last_row; i_row++, i_orow++ )
{
memset( p_out->p_pixels + i_row * i_pitch
+ i_col * i_pitch / i_cols,
color, i_pitch / i_cols );
p_vout->p_libvlc->
pf_memset( p_out->p_pixels + i_row * i_pitch
+ i_col * i_pitch / i_cols,
color, i_pitch / i_cols );
}
}
else
{
for( ; i_row < i_last_row; i_row++, i_orow++ )
{
memcpy( p_out->p_pixels + i_row * i_pitch
+ i_col * i_pitch / i_cols,
p_in->p_pixels + i_orow * i_pitch
+ i_ocol * i_pitch / i_cols,
i_pitch / i_cols );
p_vout->p_libvlc->
pf_memcpy( p_out->p_pixels + i_row * i_pitch
+ i_col * i_pitch / i_cols,
p_in->p_pixels + i_orow * i_pitch
+ i_ocol * i_pitch / i_cols,
i_pitch / i_cols );
}
}
}
......@@ -403,9 +405,10 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
int i_last_row = i_row + 1;
i_row *= p_in->i_lines / i_rows;
i_last_row *= p_in->i_lines / i_rows;
memset( p_out->p_pixels + i_row * i_pitch
+ i_col * i_pitch / i_cols,
0xff, i_pitch / i_cols );
p_vout->p_libvlc->
pf_memset( p_out->p_pixels + i_row * i_pitch
+ i_col * i_pitch / i_cols,
0xff, i_pitch / i_cols );
for( ; i_row < i_last_row; i_row++ )
{
p_out->p_pixels[ i_row * i_pitch
......@@ -414,9 +417,10 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
+ (i_col+1) * i_pitch / i_cols - 1 ] = 0xff;
}
i_row--;
memset( p_out->p_pixels + i_row * i_pitch
+ i_col * i_pitch / i_cols,
0xff, i_pitch / i_cols );
p_vout->p_libvlc->
pf_memset( p_out->p_pixels + i_row * i_pitch
+ i_col * i_pitch / i_cols,
0xff, i_pitch / i_cols );
}
if( p_vout->p_sys->b_finished == VLC_TRUE )
......
......@@ -176,13 +176,15 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
p_pic->p[i_index].i_visible_pitch + i_offset );
p_in -= p_pic->p[i_index].i_pitch;
p_out += p_outpic->p[i_index].i_pitch;
memset( p_out + i_offset, black_pixel, -i_offset );
p_filter->p_libvlc->pf_memset( p_out + i_offset,
black_pixel, -i_offset );
}
else
{
p_filter->p_libvlc->pf_memcpy( p_out + i_offset, p_in,
p_pic->p[i_index].i_visible_pitch - i_offset );
memset( p_out, black_pixel, i_offset );
p_filter->p_libvlc->pf_memset( p_out, black_pixel,
i_offset );
p_in -= p_pic->p[i_index].i_pitch;
p_out += p_outpic->p[i_index].i_pitch;
}
......
......@@ -164,13 +164,15 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
p_pic->p[i_index].i_visible_pitch + i_offset );
p_in += p_pic->p[i_index].i_pitch;
p_out += p_outpic->p[i_index].i_pitch;
memset( p_out + i_offset, black_pixel, -i_offset );
p_filter->p_libvlc->pf_memset( p_out + i_offset,
black_pixel, -i_offset );
}
else
{
p_filter->p_libvlc->pf_memcpy( p_out + i_offset, p_in,
p_pic->p[i_index].i_visible_pitch - i_offset );
memset( p_out, black_pixel, i_offset );
p_filter->p_libvlc->pf_memset( p_out, black_pixel,
i_offset );
p_in += p_pic->p[i_index].i_pitch;
p_out += p_outpic->p[i_index].i_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