changeset 7112:ebedec98b434 libavcodec

Move factor multiplication out of irms()
author vitor
date Mon, 23 Jun 2008 20:35:02 +0000
parents dbe0081e2c01
children fbe727fbd8d1
files ra144.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ra144.c	Mon Jun 23 20:33:31 2008 +0000
+++ b/ra144.c	Mon Jun 23 20:35:02 2008 +0000
@@ -111,7 +111,7 @@
 }
 
 /** inverse root mean square */
-static int irms(const int16_t *data, int factor)
+static int irms(const int16_t *data)
 {
     unsigned int i, sum = 0;
 
@@ -121,7 +121,7 @@
     if (sum == 0)
         return 0; /* OOPS - division by zero */
 
-    return (0x20000000 / (t_sqrt(sum) >> 8)) * factor;
+    return 0x20000000 / (t_sqrt(sum) >> 8);
 }
 
 static void add_wav(int n, int skip_first, int *m, const int16_t *s1,
@@ -217,7 +217,7 @@
     if (cba_idx) {
         cba_idx += BLOCKSIZE/2 - 1;
         copy_and_dup(ractx->adapt_cb, buffer_a, cba_idx);
-        m[0] = irms(buffer_a, gval) >> 12;
+        m[0] = (irms(buffer_a) * gval) >> 12;
     } else {
         m[0] = 0;
     }