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

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

Issue 1235643003: Miscellaneous changes split from https://codereview.webrtc.org/1230503003 . (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 5 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
Index: webrtc/modules/audio_coding/neteq/dsp_helper.cc
diff --git a/webrtc/modules/audio_coding/neteq/dsp_helper.cc b/webrtc/modules/audio_coding/neteq/dsp_helper.cc
index 289e66d17c86a75e847f7c960d0bbf17a6c8f13e..3e5c61d87b559586b889ef0826527c278c677ecd 100644
--- a/webrtc/modules/audio_coding/neteq/dsp_helper.cc
+++ b/webrtc/modules/audio_coding/neteq/dsp_helper.cc
@@ -117,7 +117,7 @@ void DspHelper::PeakDetection(int16_t* data, int data_length,
peak_index[i] = WebRtcSpl_MaxIndexW16(data, data_length - 1);
if (i != num_peaks - 1) {
- min_index = std::max(0, peak_index[i] - 2);
+ min_index = (peak_index[i] > 2) ? (peak_index[i] - 2) : 0;
max_index = std::min(data_length - 1, peak_index[i] + 2);
}
@@ -238,7 +238,7 @@ void DspHelper::ParabolicFit(int16_t* signal_points, int fs_mult,
int DspHelper::MinDistortion(const int16_t* signal, int min_lag,
int max_lag, int length,
int32_t* distortion_value) {
- int best_index = -1;
+ int best_index = 0;
int32_t min_distortion = WEBRTC_SPL_WORD32_MAX;
for (int i = min_lag; i <= max_lag; i++) {
int32_t sum_diff = 0;
« no previous file with comments | « webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc ('k') | webrtc/modules/audio_coding/neteq/expand.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698