Browse Source

pow(x, 2) => x * x

pull/18/head
Rafaël Carré 12 years ago
parent
commit
4958368bea
  1. 2
      modules/audio_filter/audiobargraph_a.c
  2. 3
      modules/audio_filter/normvol.c

2
modules/audio_filter/audiobargraph_a.c

@ -167,7 +167,7 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
max = ch;
}
}
max = powf( max, 2 );
max *= max;
if (p_sys->silence) {
/* 2 - store the new value */

3
modules/audio_filter/normvol.c

@ -156,8 +156,7 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
for( i_chan = 0; i_chan < i_channels; i_chan++ )
{
float f_sample = p_in[i_chan];
float f_square = pow( f_sample, 2 );
pf_sum[i_chan] += f_square;
pf_sum[i_chan] += f_sample * f_sample;
}
p_in += i_channels;
}

Loading…
Cancel
Save