changeset 7209:da8d843b87cb libavcodec

Another use of scalar_product_float()
author vitor
date Sun, 06 Jul 2008 10:32:29 +0000
parents 297b5219cd31
children 43048f7a1d7c
files ra288.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ra288.c	Sun Jul 06 10:30:21 2008 +0000
+++ b/ra288.c	Sun Jul 06 10:32:29 2008 +0000
@@ -69,13 +69,12 @@
 
     sumsum = exp(sum * 0.1151292546497) * gain;    /* pow(10.0,sum/20)*f */
 
-    sum = 0;
     for (x=0; x < 5; x++) {
         buffer[x] = codetable[cb_coef][x] * sumsum;
-        sum += buffer[x] * buffer[x];
     }
 
-    sum /= 5;
+    sum = scalar_product_float(buffer, buffer, 5) / 5;
+
     if (sum < 1)
         sum = 1;