changeset 7508:f516e1101167 libavcodec

Simplify rms(): merge a few operations in the same statement
author vitor
date Wed, 06 Aug 2008 05:11:46 +0000
parents 8f89a4d76a71
children 86b6cb5b04d5
files ra144.c
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ra144.c	Wed Aug 06 05:08:48 2008 +0000
+++ b/ra144.c	Wed Aug 06 05:11:46 2008 +0000
@@ -154,7 +154,7 @@
 {
     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 @@
         }
     }
 
-    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,