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

Unified Diff: webrtc/modules/remote_bitrate_estimator/test/estimators/max_bandwidth_filter.cc

Issue 2924603002: Added implementation of four functions in the BBR congestion controller. (Closed)
Patch Set: Added some comments and declaration of two functions. Created 3 years, 6 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/remote_bitrate_estimator/test/estimators/max_bandwidth_filter.cc
diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/max_bandwidth_filter.cc b/webrtc/modules/remote_bitrate_estimator/test/estimators/max_bandwidth_filter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c5f618e86228665453add9116807f45ef8e5b13a
--- /dev/null
+++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/max_bandwidth_filter.cc
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ *
+ */
+
+#include "webrtc/modules/remote_bitrate_estimator/test/estimators/max_bandwidth_filter.h"
+
+#include <time.h>
philipel 2017/06/07 11:34:31 What do you use time.h for? Can it be removed?
gnish1 2017/06/07 12:30:14 Done.
+#include <algorithm>
+#include <utility>
+
+#include "webrtc/base/logging.h"
+#include "webrtc/modules/congestion_controller/delay_based_bwe.h"
+#include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h"
+
+namespace webrtc {
+namespace testing {
+namespace bwe {
+MaxBandwidthFilter::MaxBandwidthFilter() {}
+
+MaxBandwidthFilter::~MaxBandwidthFilter() {}
+
+bool MaxBandwidthFilter::FullBandwidthReached(float growth_target,
+ int max_rounds_without_growth) {
+ // Minimal bandwidth necessary to assume that
philipel 2017/06/07 11:34:31 char limit
gnish1 2017/06/07 12:30:14 Done.
+ // better bandwidth can still be found and
+ // full bandwidth is not reached.
+ int64_t minimal_bandwidth = bandwidth_last_round_ * growth_target;
+ if (max_bandwidth_estimate_ >= minimal_bandwidth) {
+ bandwidth_last_round_ = max_bandwidth_estimate_;
+ rounds_without_growth_ = 0;
+ return false;
+ }
+ rounds_without_growth_++;
+ if (rounds_without_growth_ >= max_rounds_without_growth)
+ return true;
+ return false;
+}
+} // namespace bwe
+} // namespace testing
+} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698