Commit 3172a979 authored by Rafaël Carré's avatar Rafaël Carré

Remove vlc_memset

parent 68426d37
......@@ -881,9 +881,8 @@ static inline void *vlc_memalign(size_t align, size_t size)
VLC_API void vlc_tdestroy( void *, void (*)(void *) );
/* Fast large memory copy and memory set */
/* Fast large memory copy */
VLC_API void * vlc_memcpy( void *, const void *, size_t );
#define vlc_memset memset
/*****************************************************************************
* I18n stuff
......
......@@ -975,8 +975,8 @@ static int DecodeFrame( demux_t *p_demux )
{
/* For PAL, erase first half of line 23, last half of line 623,
* and line 624 ; no need to erase chrominance */
vlc_memset( p_sys->p_y, 0, p_sys->i_width / 2 );
vlc_memset( p_sys->p_y + p_sys->i_width * 574 + p_sys->i_width / 2,
memset( p_sys->p_y, 0, p_sys->i_width / 2 );
memset( p_sys->p_y + p_sys->i_width * 574 + p_sys->i_width / 2,
0, p_sys->i_width * 3 / 2 );
}
}
......
......@@ -106,7 +106,7 @@ static block_t *DoWork( filter_t * p_filter, block_t *p_in_buf )
SetWLE( p_out + 6, i_frame_size << 4 );
swab( p_in, &p_out[8], i_frame_size * 2 );
}
vlc_memset( p_out + 8 + i_frame_size * 2, 0,
memset( p_out + 8 + i_frame_size * 2, 0,
AOUT_SPDIF_SIZE - i_frame_size * 2 - 8 );
p_out_buf->i_dts = p_in_buf->i_dts;
......
......@@ -205,7 +205,7 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
if( i_fz > i_length + 8 )
{
vlc_memset( p_out + 8 + i_length_padded, 0,
memset( p_out + 8 + i_length_padded, 0,
i_fz - i_length_padded - 8 );
}
}
......
......@@ -186,7 +186,7 @@ void AudioQueueCallback(void * inUserData, AudioQueueRef inAQ, AudioQueueBufferR
inBuffer->mAudioDataByteSize = p_buffer->i_buffer;
block_Release( p_buffer );
} else {
vlc_memset( inBuffer->mAudioData, 0, inBuffer->mAudioDataBytesCapacity );
memset( inBuffer->mAudioData, 0, inBuffer->mAudioDataBytesCapacity );
inBuffer->mAudioDataByteSize = inBuffer->mAudioDataBytesCapacity;
}
AudioQueueEnqueueBuffer(inAQ, inBuffer, 0, NULL);
......
......@@ -1334,7 +1334,7 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout,
}
else
{
vlc_memset( (uint8_t *)ioData->mBuffers[0].mData +i_mData_bytes,
memset( (uint8_t *)ioData->mBuffers[0].mData +i_mData_bytes,
0,ioData->mBuffers[0].mDataByteSize - i_mData_bytes );
i_mData_bytes += ioData->mBuffers[0].mDataByteSize - i_mData_bytes;
}
......@@ -1386,7 +1386,7 @@ static OSStatus RenderCallbackSPDIF( AudioDeviceID inDevice,
}
else
{
vlc_memset( BUFFER.mData, 0, BUFFER.mDataByteSize );
memset( BUFFER.mData, 0, BUFFER.mDataByteSize );
}
#undef BUFFER
......
......@@ -328,7 +328,7 @@ static ULONG APIENTRY KaiCallback( PVOID p_cb_data,
}
else
{
vlc_memset( ( uint8_t * ) p_buffer + i_len, 0, i_buf_size - i_len );
memset( ( uint8_t * ) p_buffer + i_len, 0, i_buf_size - i_len );
i_len = i_buf_size;
}
......
......@@ -270,7 +270,7 @@ static block_t *aout_OutputSlice (audio_output_t *p_aout)
if( unlikely(p_inbuf == NULL) )
{
msg_Err( p_aout, "packetization error" );
vlc_memset( p_out, 0, needed );
memset( p_out, 0, needed );
break;
}
......
......@@ -765,7 +765,7 @@ static int PlayWaveOut( audio_output_t *p_aout, HWAVEOUT h_waveout,
p_aout->sys->i_repeat_counter--;
if(!p_aout->sys->i_repeat_counter)
{
vlc_memset( p_aout->sys->p_silence_buffer,
memset( p_aout->sys->p_silence_buffer,
0x00, p_aout->sys->i_buffer_size );
}
}
......
......@@ -177,6 +177,6 @@ static void I422_YUVA( filter_t *p_filter, picture_t *p_source,
picture_t *p_dest )
{
I422_I420( p_filter, p_source, p_dest );
vlc_memset( p_dest->p[A_PLANE].p_pixels, 0xff,
memset( p_dest->p[A_PLANE].p_pixels, 0xff,
p_dest->p[A_PLANE].i_lines * p_dest->p[A_PLANE].i_pitch );
}
......@@ -209,7 +209,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
}
}
/* Gaussian convolution to make it look cleaner */
vlc_memset( p_a, 0, 2 * i_pitch );
memset( p_a, 0, 2 * i_pitch );
for( i = 2; i < i_lines - 2; i++ )
{
p_a[i*i_pitch] = 0x00;
......
......@@ -266,7 +266,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
p_in += i_ycrop * p_plane->i_pitch;
/* Padd on the top */
vlc_memset( p_out, i_padd_color, i_ypadd * p_outplane->i_pitch );
memset( p_out, i_padd_color, i_ypadd * p_outplane->i_pitch );
p_out += i_ypadd * p_outplane->i_pitch;
int i_line;
......@@ -279,7 +279,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
p_in += i_xcrop * i_pixel_pitch;
/* Padd on the left */
vlc_memset( p_out, i_padd_color, i_xpadd * i_pixel_pitch );
memset( p_out, i_padd_color, i_xpadd * i_pixel_pitch );
p_out += i_xpadd * i_pixel_pitch;
/* Copy the image and crop on the right */
......@@ -288,7 +288,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
p_in += i_width * i_pixel_pitch;
/* Padd on the right */
vlc_memset( p_out, i_padd_color,
memset( p_out, i_padd_color,
( i_outwidth - i_xpadd - i_width ) * i_pixel_pitch );
/* Got to begining of the next line */
......@@ -297,7 +297,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
}
/* Padd on the bottom */
vlc_memset( p_out, i_padd_color,
memset( p_out, i_padd_color,
( i_outheight - i_ypadd - i_height ) * p_outplane->i_pitch );
}
......
......@@ -365,9 +365,9 @@ static void FilterGradient( filter_t *p_filter, picture_t *p_inpic,
}
else
{
vlc_memset( p_outpic->p[U_PLANE].p_pixels, 0x80,
memset( p_outpic->p[U_PLANE].p_pixels, 0x80,
p_outpic->p[U_PLANE].i_lines * p_outpic->p[U_PLANE].i_pitch );
vlc_memset( p_outpic->p[V_PLANE].p_pixels, 0x80,
memset( p_outpic->p[V_PLANE].p_pixels, 0x80,
p_outpic->p[V_PLANE].i_lines * p_outpic->p[V_PLANE].i_pitch );
}
......@@ -505,11 +505,11 @@ static void FilterEdge( filter_t *p_filter, picture_t *p_inpic,
}
else
{
vlc_memset( p_outpic->p[Y_PLANE].p_pixels, 0xff,
memset( p_outpic->p[Y_PLANE].p_pixels, 0xff,
p_outpic->p[Y_PLANE].i_lines * p_outpic->p[Y_PLANE].i_pitch );
vlc_memset( p_outpic->p[U_PLANE].p_pixels, 0x80,
memset( p_outpic->p[U_PLANE].p_pixels, 0x80,
p_outpic->p[U_PLANE].i_lines * p_outpic->p[U_PLANE].i_pitch );
vlc_memset( p_outpic->p[V_PLANE].p_pixels, 0x80,
memset( p_outpic->p[V_PLANE].p_pixels, 0x80,
p_outpic->p[V_PLANE].i_lines * p_outpic->p[V_PLANE].i_pitch );
}
......@@ -677,7 +677,7 @@ static void FilterHough( filter_t *p_filter, picture_t *p_inpic,
msg_Dbg(p_filter, "Precalculation done");
}
vlc_memset( p_hough, 0, i_diag * i_nb_steps * sizeof(int) );
memset( p_hough, 0, i_diag * i_nb_steps * sizeof(int) );
plane_CopyPixels( &p_outpic->p[Y_PLANE], &p_inpic->p[Y_PLANE] );
plane_CopyPixels( &p_outpic->p[U_PLANE], &p_inpic->p[U_PLANE] );
......
......@@ -317,7 +317,7 @@ static void DrawRectangle( uint8_t *pb_dst, int i_pitch, int i_width, int i_heig
return;
/* top line */
vlc_memset( &pb_dst[y * i_pitch + x], 0xff, i_w );
memset( &pb_dst[y * i_pitch + x], 0xff, i_w );
/* left and right */
for( dy = 1; dy < i_h-1; dy++ )
......@@ -327,7 +327,7 @@ static void DrawRectangle( uint8_t *pb_dst, int i_pitch, int i_width, int i_heig
}
/* bottom line */
vlc_memset( &pb_dst[(y+i_h-1) * i_pitch + x], 0xff, i_w );
memset( &pb_dst[(y+i_h-1) * i_pitch + x], 0xff, i_w );
}
static int Mouse( filter_t *p_filter, vlc_mouse_t *p_mouse, const vlc_mouse_t *p_old, const vlc_mouse_t *p_new )
......
......@@ -983,7 +983,7 @@ static void FilterPlanar( uint8_t *p_out, int i_out_pitch,
/* Top black border */
for( int b = 0; b < p_cfg->black.i_top; b++ )
{
vlc_memset( p_out, i_pixel_black, i_out_width );
memset( p_out, i_pixel_black, i_out_width );
p_out += i_out_pitch;
}
......@@ -1036,7 +1036,7 @@ static void FilterPlanar( uint8_t *p_out, int i_out_pitch,
/* Bottom black border */
for( int b = 0; b < p_cfg->black.i_bottom; b++ )
{
vlc_memset( p_out, i_pixel_black, i_out_width );
memset( p_out, i_pixel_black, i_out_width );
p_out += i_out_pitch;
}
}
......
......@@ -164,10 +164,10 @@ 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++)
{
vlc_memset(
memset(
p_outpic->p[U_PLANE].p_pixels+y*p_outpic->p[U_PLANE].i_pitch,
u, p_outpic->p[U_PLANE].i_pitch );
vlc_memset(
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 )
......
......@@ -185,13 +185,13 @@ 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;
vlc_memset( p_out + i_offset, black_pixel, -i_offset );
memset( p_out + i_offset, black_pixel, -i_offset );
}
else
{
vlc_memcpy( p_out + i_offset, p_in,
p_pic->p[i_index].i_visible_pitch - i_offset );
vlc_memset( p_out, black_pixel, i_offset );
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;
}
......
......@@ -286,10 +286,10 @@ static void PlanarI420Sepia( picture_t *p_pic, picture_t *p_outpic,
&p_pic->p[Y_PLANE].p_pixels[i_dy_line2_start + x + 8],
i_intensity_spread );
/* Copy precomputed values to destination memory location */
vlc_memset(
memset(
&p_outpic->p[U_PLANE].p_pixels[i_du_line_start + (x / 2)],
filling_const_8u, 8 );
vlc_memset(
memset(
&p_outpic->p[V_PLANE].p_pixels[i_dv_line_start + (x / 2)],
filling_const_8v, 8 );
}
......
......@@ -174,13 +174,13 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
i_visible_pitch + i_offset );
p_in += p_pic->p[i_index].i_pitch;
p_out += p_outpic->p[i_index].i_pitch;
vlc_memset( p_out + i_offset, black_pixel, -i_offset );
memset( p_out + i_offset, black_pixel, -i_offset );
}
else
{
vlc_memcpy( p_out + i_offset, p_in,
i_visible_pitch - i_offset );
vlc_memset( p_out, black_pixel, i_offset );
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