Chromium Code Reviews| Index: webrtc/common_audio/signal_processing/dot_product_with_scale.c |
| diff --git a/webrtc/common_audio/signal_processing/dot_product_with_scale.c b/webrtc/common_audio/signal_processing/dot_product_with_scale.c |
| index 1302d62541266fdc45b07576de5ff5026d69032f..202d0ccd6c93890bd4cf8e5ef6583235c7b33a7d 100644 |
| --- a/webrtc/common_audio/signal_processing/dot_product_with_scale.c |
| +++ b/webrtc/common_audio/signal_processing/dot_product_with_scale.c |
| @@ -14,7 +14,7 @@ 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 +28,5 @@ int32_t WebRtcSpl_DotProductWithScale(const int16_t* vector1, |
| sum += (vector1[i] * vector2[i]) >> scaling; |
| } |
| - return sum; |
| + return (int32_t) sum; |
|
kwiberg-webrtc
2017/02/28 10:07:47
You'll get garbage if this cast truncates. And was
hlundin-webrtc
2017/02/28 11:58:45
Done.
|
| } |