summaryrefslogtreecommitdiff
path: root/libavcodec/ra144.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-08-06 05:11:46 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-08-06 05:11:46 +0000
commit2f1cad0e582f6666fc8ff2b676718bda1be4ac57 (patch)
treec341d824db01a621934a4a7aab4d04171897a54e /libavcodec/ra144.c
parentb4d46e8c06b685da0fdce50d445c0bdc720ff406 (diff)
Simplify rms(): merge a few operations in the same statement
Originally committed as revision 14639 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ra144.c')
-rw-r--r--libavcodec/ra144.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c
index dab7b1f807..dcb8526268 100644
--- a/libavcodec/ra144.c
+++ b/libavcodec/ra144.c
@@ -154,7 +154,7 @@ static unsigned int rms(const int *data)
{
int i;
unsigned int res = 0x10000;
- int b = 0;
+ int b = 10;
for (i=0; i < 10; i++) {
res = (((0x1000000 - data[i]*data[i]) >> 12) * res) >> 12;
@@ -168,10 +168,7 @@ static unsigned int rms(const int *data)
}
}
- res = t_sqrt(res);
-
- res >>= (b + 10);
- return res;
+ return t_sqrt(res) >> b;
}
static void do_output_subblock(RA144Context *ractx, const uint16_t *lpc_coefs,