]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/celp_math.c
h264: rewrite has_b_frame calculation code,
[ffmpeg] / libavcodec / celp_math.c
index 09111da819f2d1b884f311947e187dec4e889dce..d85277f2097adc32e11e2b79ee2310ae09a7f9e3 100644 (file)
@@ -25,6 +25,7 @@
 #include <assert.h>
 
 #include "avcodec.h"
+#include "mathops.h"
 #include "celp_math.h"
 
 #ifdef G729_BITEXACT
@@ -196,6 +197,17 @@ int ff_log2(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;
+}
+
 float ff_dot_productf(const float* a, const float* b, int length)
 {
     float sum = 0;