Commit fb3f17e3 authored by vitor's avatar vitor

Simplify irms()

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13215 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 50e41b23
...@@ -112,12 +112,10 @@ static void rotate_block(const short *source, short *target, int offset) ...@@ -112,12 +112,10 @@ static void rotate_block(const short *source, short *target, int offset)
/* inverse root mean square */ /* inverse root mean square */
static int irms(const short *data, int factor) static int irms(const short *data, int factor)
{ {
const short *p1, *p2; unsigned int i, sum = 0;
unsigned int sum;
p2 = (p1 = data) + BLOCKSIZE; for (i=0; i < BLOCKSIZE; i++)
for (sum=0; p2 > p1; p1++) sum += data[i] * data[i];
sum += (*p1) * (*p1);
if (sum == 0) if (sum == 0)
return 0; /* OOPS - division by zero */ return 0; /* OOPS - division by zero */
......
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