summaryrefslogtreecommitdiff
path: root/libavcodec/celp_math.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/celp_math.c')
-rw-r--r--libavcodec/celp_math.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/celp_math.c b/libavcodec/celp_math.c
index a9ebef697c..8a788f58ec 100644
--- a/libavcodec/celp_math.c
+++ b/libavcodec/celp_math.c
@@ -26,6 +26,8 @@
#include "avcodec.h"
#include "celp_math.h"
+#include "mathops.h"
+
#include "libavutil/common.h"
static const uint16_t exp2a[]=
@@ -86,3 +88,14 @@ int ff_log2_q15(uint32_t value)
return (power_int << 15) + value;
}
+
+int64_t ff_dot_product(const int16_t *a, const int16_t *b, int length)
+{
+ int i;
+ int64_t sum = 0;
+
+ for (i = 0; i < length; i++)
+ sum += MUL16(a[i], b[i]);
+
+ return sum;
+}