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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/estimators/max_bandwidth_filter.h

Issue 2990163002: Almost full implementation of BBR's core. (Closed)
Patch Set: fixed patch failure Created 3 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 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 10 matching lines...) Expand all
21 21
22 #include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h" 22 #include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h"
23 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h" 23 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h"
24 #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h" 24 #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h"
25 25
26 namespace webrtc { 26 namespace webrtc {
27 namespace testing { 27 namespace testing {
28 namespace bwe { 28 namespace bwe {
29 class MaxBandwidthFilter { 29 class MaxBandwidthFilter {
30 public: 30 public:
31 // Number of rounds for bandwidth estimate to expire.
32 static const size_t kBandwidthWindowFilterSize = 10;
33
31 MaxBandwidthFilter(); 34 MaxBandwidthFilter();
32
33 ~MaxBandwidthFilter(); 35 ~MaxBandwidthFilter();
34 int64_t max_bandwidth_estimate_bps() { return max_bandwidth_estimate_bps_; } 36 int64_t max_bandwidth_estimate_bps() { return max_bandwidth_estimate_bps_; }
35 37
36 // Adds bandwidth sample to the bandwidth filter. 38 // Adds bandwidth sample to the bandwidth filter.
37 void AddBandwidthSample(int64_t sample, int64_t round, size_t filter_size); 39 void AddBandwidthSample(int64_t sample, int64_t round);
38 40
39 // Checks if bandwidth has grown by certain multiplier for past x rounds, 41 // Checks if bandwidth has grown by certain multiplier for past x rounds,
40 // to decide whether or full bandwidth was reached. 42 // to decide whether or full bandwidth was reached.
41 bool FullBandwidthReached(float growth_target, int max_rounds_without_growth); 43 bool FullBandwidthReached(float growth_target, int max_rounds_without_growth);
42 44
43 private: 45 private:
44 int64_t bandwidth_last_round_bytes_per_ms_; 46 int64_t bandwidth_last_round_bytes_per_ms_;
45 int64_t max_bandwidth_estimate_bps_; 47 int64_t max_bandwidth_estimate_bps_;
46 int64_t rounds_without_growth_; 48 int64_t rounds_without_growth_;
47 std::pair<int64_t, size_t> bandwidth_samples_[3]; 49 std::pair<int64_t, size_t> bandwidth_samples_[3];
48 }; 50 };
49 } // namespace bwe 51 } // namespace bwe
50 } // namespace testing 52 } // namespace testing
51 } // namespace webrtc 53 } // namespace webrtc
52 54
53 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_MAX_BANDWIDTH _FILTER_H_ 55 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_MAX_BANDWIDTH _FILTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698