changeset 8094:36671e6689c7 libavcodec

Use ff_dot_productf() in ra288.c
author vitor
date Thu, 30 Oct 2008 22:24:40 +0000
parents 408d200a6179
children b9678ea8e5fb
files Makefile ra288.c
diffstat 2 files changed, 4 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Oct 30 22:12:43 2008 +0000
+++ b/Makefile	Thu Oct 30 22:24:40 2008 +0000
@@ -160,7 +160,7 @@
 OBJS-$(CONFIG_QTRLE_DECODER)           += qtrle.o
 OBJS-$(CONFIG_QTRLE_ENCODER)           += qtrleenc.o
 OBJS-$(CONFIG_RA_144_DECODER)          += ra144.o celp_filters.o
-OBJS-$(CONFIG_RA_288_DECODER)          += ra288.o
+OBJS-$(CONFIG_RA_288_DECODER)          += ra288.o celp_math.o
 OBJS-$(CONFIG_RAWVIDEO_DECODER)        += rawdec.o
 OBJS-$(CONFIG_RAWVIDEO_ENCODER)        += rawenc.o
 OBJS-$(CONFIG_RL2_DECODER)             += rl2.o
--- a/ra288.c	Thu Oct 30 22:12:43 2008 +0000
+++ b/ra288.c	Thu Oct 30 22:24:40 2008 +0000
@@ -24,6 +24,7 @@
 #include "bitstream.h"
 #include "ra288.h"
 #include "lpc.h"
+#include "celp_math.h"
 
 typedef struct {
     float sp_lpc[36];      ///< LPC coefficients for speech data (spec: A)
@@ -52,17 +53,6 @@
     return 0;
 }
 
-static inline float scalar_product_float(const float * v1, const float * v2,
-                                         int size)
-{
-    float res = 0.;
-
-    while (size--)
-        res += *v1++ * *v2++;
-
-    return res;
-}
-
 static void apply_window(float *tgt, const float *m1, const float *m2, int n)
 {
     while (n--)
@@ -72,7 +62,7 @@
 static void convolve(float *tgt, const float *src, int len, int n)
 {
     for (; n >= 0; n--)
-        tgt[n] = scalar_product_float(src, src - n, len);
+        tgt[n] = ff_dot_productf(src, src - n, len);
 
 }
 
@@ -101,7 +91,7 @@
     for (i=0; i < 5; i++)
         buffer[i] = codetable[cb_coef][i] * sumsum;
 
-    sum = scalar_product_float(buffer, buffer, 5) * ((1<<24)/5.);
+    sum = ff_dot_productf(buffer, buffer, 5) * ((1<<24)/5.);
 
     sum = FFMAX(sum, 1);