Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1310)

Unified Diff: webrtc/modules/audio_coding/neteq/expand.cc

Issue 2616363003: Fix for left-shift of potentially negative values in NetEq. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/expand.cc
diff --git a/webrtc/modules/audio_coding/neteq/expand.cc b/webrtc/modules/audio_coding/neteq/expand.cc
index da870d77064c559fcf6d7e5541ca1a50a7a5bf88..40b1cba11fc21a1dfa1c723d1ce7d58dd556fee3 100644
--- a/webrtc/modules/audio_coding/neteq/expand.cc
+++ b/webrtc/modules/audio_coding/neteq/expand.cc
@@ -441,7 +441,7 @@ void Expand::AnalyzeSignal(int16_t* random_vector) {
for (size_t i = 0; i < kNumCorrelationCandidates; ++i) {
int32_t ratio;
if (best_distortion[i] > 0) {
- ratio = (best_correlation[i] << 16) / best_distortion[i];
+ ratio = (best_correlation[i] * 65536) / best_distortion[i];
kwiberg-webrtc 2017/01/09 14:07:13 Since larger powers of two have lots of digits tha
hlundin-webrtc 2017/01/09 14:12:07 Acknowledged.
ivoc 2017/01/09 14:39:53 Good idea, done.
} else if (best_correlation[i] == 0) {
ratio = 0; // No correlation set result to zero.
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698