[FFmpeg-cvslog] r15753 - in trunk/libavcodec: celp_math.c celp_math.h

vitor subversion
Thu Oct 30 22:04:17 CET 2008


Author: vitor
Date: Thu Oct 30 22:04:17 2008
New Revision: 15753

Log:
Add ff_dot_productf() to celp_math.{c,h}
Part of the QCELP patch by Kenan Gillet, kenan.gillet gmail com


Modified:
   trunk/libavcodec/celp_math.c
   trunk/libavcodec/celp_math.h

Modified: trunk/libavcodec/celp_math.c
==============================================================================
--- trunk/libavcodec/celp_math.c	(original)
+++ trunk/libavcodec/celp_math.c	Thu Oct 30 22:04:17 2008
@@ -195,3 +195,14 @@ int ff_log2(uint32_t value)
 
     return (power_int << 15) + value;
 }
+
+float ff_dot_productf(const float* a, const float* b, int length)
+{
+    float sum = 0;
+    int i;
+
+    for(i=0; i<length; i++)
+        sum += a[i] * b[i];
+
+    return sum;
+}

Modified: trunk/libavcodec/celp_math.h
==============================================================================
--- trunk/libavcodec/celp_math.h	(original)
+++ trunk/libavcodec/celp_math.h	Thu Oct 30 22:04:17 2008
@@ -83,4 +83,14 @@ static inline int bidir_sal(int value, i
     else           return value <<  offset;
 }
 
+/**
+ * returns the dot product.
+ * @param a input data array
+ * @param b input data array
+ * @param length number of elements
+ *
+ * @return dot product = sum of elementwise products
+ */
+extern float ff_dot_productf(const float* a, const float* b, int length);
+
 #endif /* AVCODEC_CELP_MATH_H */




More information about the ffmpeg-cvslog mailing list