Skip to content

Commit

Permalink
video_filter: ripple: use C99 loop declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
tmatth committed Aug 31, 2015
1 parent 55ccb41 commit 0171aa7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions modules/video_filter/ripple.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ static void Destroy( vlc_object_t *p_this )
static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
{
picture_t *p_outpic;
int i_index;
double f_angle;
mtime_t new_date = mdate();

Expand All @@ -136,9 +135,9 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
p_filter->p_sys->last_date = new_date;
f_angle = p_filter->p_sys->f_angle;

for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
for( int i_index = 0; i_index < p_pic->i_planes; i_index++ )
{
int i_line, i_first_line, i_num_lines, i_offset, i_pixel_pitch,
int i_first_line, i_num_lines, i_offset, i_pixel_pitch,
i_visible_pixels;
uint8_t black_pixel;
uint8_t *p_in, *p_out;
Expand All @@ -163,15 +162,15 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
p_in = p_pic->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++ )
for( int i_line = 0; i_line < i_first_line; i_line++ )
{
memcpy( p_out, p_in, p_pic->p[i_index].i_visible_pitch );
p_in += p_pic->p[i_index].i_pitch;
p_out += p_outpic->p[i_index].i_pitch;
}

/* 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( int i_line = i_first_line; i_line < i_num_lines; i_line++ )
{
/* Calculate today's offset, don't go above 1/20th of the screen */
i_offset = (int)( (double)(i_visible_pixels)
Expand Down

0 comments on commit 0171aa7

Please sign in to comment.