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

Side by Side Diff: webrtc/modules/audio_coding/neteq/delay_peak_detector.cc

Issue 2535593002: RTC_[D]CHECK_op: Remove "u" suffix on integer constants (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 return max_height; 59 return max_height;
60 } 60 }
61 61
62 uint64_t DelayPeakDetector::MaxPeakPeriod() const { 62 uint64_t DelayPeakDetector::MaxPeakPeriod() const {
63 auto max_period_element = std::max_element( 63 auto max_period_element = std::max_element(
64 peak_history_.begin(), peak_history_.end(), 64 peak_history_.begin(), peak_history_.end(),
65 [](Peak a, Peak b) { return a.period_ms < b.period_ms; }); 65 [](Peak a, Peak b) { return a.period_ms < b.period_ms; });
66 if (max_period_element == peak_history_.end()) { 66 if (max_period_element == peak_history_.end()) {
67 return 0; // |peak_history_| is empty. 67 return 0; // |peak_history_| is empty.
68 } 68 }
69 RTC_DCHECK_GT(max_period_element->period_ms, 0u); 69 RTC_DCHECK_GT(max_period_element->period_ms, 0);
70 return max_period_element->period_ms; 70 return max_period_element->period_ms;
71 } 71 }
72 72
73 bool DelayPeakDetector::Update(int inter_arrival_time, int target_level) { 73 bool DelayPeakDetector::Update(int inter_arrival_time, int target_level) {
74 if (inter_arrival_time > target_level + peak_detection_threshold_ || 74 if (inter_arrival_time > target_level + peak_detection_threshold_ ||
75 inter_arrival_time > 2 * target_level) { 75 inter_arrival_time > 2 * target_level) {
76 // A delay peak is observed. 76 // A delay peak is observed.
77 if (!peak_period_stopwatch_) { 77 if (!peak_period_stopwatch_) {
78 // This is the first peak. Reset the period counter. 78 // This is the first peak. Reset the period counter.
79 peak_period_stopwatch_ = tick_timer_->GetNewStopwatch(); 79 peak_period_stopwatch_ = tick_timer_->GetNewStopwatch();
(...skipping 29 matching lines...) Expand all
109 size_t s = peak_history_.size(); 109 size_t s = peak_history_.size();
110 if (s >= kMinPeaksToTrigger && 110 if (s >= kMinPeaksToTrigger &&
111 peak_period_stopwatch_->ElapsedMs() <= 2 * MaxPeakPeriod()) { 111 peak_period_stopwatch_->ElapsedMs() <= 2 * MaxPeakPeriod()) {
112 peak_found_ = true; 112 peak_found_ = true;
113 } else { 113 } else {
114 peak_found_ = false; 114 peak_found_ = false;
115 } 115 }
116 return peak_found_; 116 return peak_found_;
117 } 117 }
118 } // namespace webrtc 118 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc ('k') | webrtc/modules/audio_coding/neteq/nack_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698