1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

Simplify irms()

Originally committed as revision 13215 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Vitor Sessak 2008-05-21 16:43:33 +00:00
parent bf6497e911
commit c32985829a

View File

@ -112,12 +112,10 @@ static void rotate_block(const short *source, short *target, int offset)
/* inverse root mean square */
static int irms(const short *data, int factor)
{
const short *p1, *p2;
unsigned int sum;
unsigned int i, sum = 0;
p2 = (p1 = data) + BLOCKSIZE;
for (sum=0; p2 > p1; p1++)
sum += (*p1) * (*p1);
for (i=0; i < BLOCKSIZE; i++)
sum += data[i] * data[i];
if (sum == 0)
return 0; /* OOPS - division by zero */