diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2008-05-21 16:43:33 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2008-05-21 16:43:33 +0000 |
commit | c32985829a1978e5a7c298a43e55ad7afa341f67 (patch) | |
tree | 6be2ca80a1db73897b16bcc4bcaaa5241ed83e77 | |
parent | bf6497e9113918df157bd5789d5326e5ef8bb455 (diff) | |
download | ffmpeg-c32985829a1978e5a7c298a43e55ad7afa341f67.tar.gz |
Simplify irms()
Originally committed as revision 13215 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/ra144.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c index d85d7198e3..b3435bb2e1 100644 --- a/libavcodec/ra144.c +++ b/libavcodec/ra144.c @@ -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 */ |