| 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 91%
|
| 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..f8b2288b53007235a32e4479a1f651a1c6c9e56a 100644
|
| --- a/webrtc/common_audio/signal_processing/dot_product_with_scale.c
|
| +++ b/webrtc/common_audio/signal_processing/dot_product_with_scale.cc
|
| @@ -10,11 +10,13 @@
|
|
|
| #include "webrtc/common_audio/signal_processing/include/signal_processing_library.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);
|
| }
|
|
|