aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ra144.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-05-21 16:43:33 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-05-21 16:43:33 +0000
commitc32985829a1978e5a7c298a43e55ad7afa341f67 (patch)
tree6be2ca80a1db73897b16bcc4bcaaa5241ed83e77 /libavcodec/ra144.c
parentbf6497e9113918df157bd5789d5326e5ef8bb455 (diff)
downloadffmpeg-c32985829a1978e5a7c298a43e55ad7afa341f67.tar.gz
Simplify irms()
Originally committed as revision 13215 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ra144.c')
-rw-r--r--libavcodec/ra144.c8
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 */