Index: webrtc/common_audio/signal_processing/dot_product_with_scale.cc |
diff --git a/webrtc/common_audio/signal_processing/dot_product_with_scale.c b/webrtc/common_audio/signal_processing/dot_product_with_scale.cc |
similarity index 85% |
rename from webrtc/common_audio/signal_processing/dot_product_with_scale.c |
rename to webrtc/common_audio/signal_processing/dot_product_with_scale.cc |
index 1302d62541266fdc45b07576de5ff5026d69032f..4067ab5599614c2ab5bc32ac7cfe17e42b64cfac 100644 |
--- a/webrtc/common_audio/signal_processing/dot_product_with_scale.c |
+++ b/webrtc/common_audio/signal_processing/dot_product_with_scale.cc |
@@ -8,13 +8,15 @@ |
* be found in the AUTHORS file in the root of the source tree. |
*/ |
-#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" |
+#include "webrtc/common_audio/signal_processing/dot_product_with_scale.h" |
+ |
+#include "webrtc/base/safe_conversions.h" |
int32_t WebRtcSpl_DotProductWithScale(const int16_t* vector1, |
const int16_t* vector2, |
size_t length, |
int scaling) { |
- int32_t sum = 0; |
+ int64_t sum = 0; |
size_t i = 0; |
/* Unroll the loop to improve performance. */ |
@@ -28,5 +30,5 @@ int32_t WebRtcSpl_DotProductWithScale(const int16_t* vector1, |
sum += (vector1[i] * vector2[i]) >> scaling; |
} |
- return sum; |
+ return rtc::saturated_cast<int32_t>(sum); |
} |