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

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

Issue 2966403002: Added implementation of three classes in BBR,with unit-tests. (Closed)
Patch Set: Added logic for entering/exiting modes in BBR, added new bandwidth filter. Created 3 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 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 */
11 11
12 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_MAX_BANDWIDTH_FI LTER_H_ 12 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_MAX_BANDWIDTH_FI LTER_H_
13 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_MAX_BANDWIDTH_FI LTER_H_ 13 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_MAX_BANDWIDTH_FI LTER_H_
14 14
15 #include <cstddef> 15 #include <climits>
16 #include <cstdint> 16 #include <list>
17 #include <map>
18 #include <memory>
19 #include <utility>
20 #include <vector>
21
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"
24 #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h"
17 25
18 namespace webrtc { 26 namespace webrtc {
19 namespace testing { 27 namespace testing {
20 namespace bwe { 28 namespace bwe {
21 class MaxBandwidthFilter { 29 class MaxBandwidthFilter {
22 public: 30 public:
23 MaxBandwidthFilter(); 31 MaxBandwidthFilter();
24 32
25 ~MaxBandwidthFilter(); 33 ~MaxBandwidthFilter();
26 int64_t max_bandwidth_estimate_bytes_per_ms() { 34 int64_t max_bandwidth_estimate_bps() { return max_bandwidth_estimate_bps_; }
27 return max_bandwidth_estimate_bytes_per_ms_;
28 }
29 35
30 // Save bandwidth sample for the current round. We save bandwidth samples for 36 // Save bandwidth sample for the current round.
31 // past 10 rounds to provide better bandwidth estimate. 37 // We save bandwidth samples for past 10 rounds to
38 // provide better bandwidth estimate.
39
32 void AddBandwidthSample(int64_t sample, int64_t round, size_t filter_size); 40 void AddBandwidthSample(int64_t sample, int64_t round, size_t filter_size);
33 41
34 // Check if bandwidth has grown by certain multiplier for past x rounds, 42 // Check if bandwidth has grown by certain multiplier for past x rounds,
35 // to decide whether or not full bandwidth was reached. 43 // to decide whether or full bandwidth was reached.
36 bool FullBandwidthReached(float growth_target, int max_rounds_without_growth); 44 bool FullBandwidthReached(float growth_target, int max_rounds_without_growth);
37 45
38 private: 46 private:
39 int64_t bandwidth_last_round_bytes_per_ms_; 47 int64_t bandwidth_last_round_bytes_per_ms_;
40 uint64_t round_bandwidth_updated_; 48 // uint64_t round_bandwidth_updated_ = 0;
41 int64_t max_bandwidth_estimate_bytes_per_ms_; 49 int64_t max_bandwidth_estimate_bps_;
42 int64_t rounds_without_growth_; 50 int64_t rounds_without_growth_;
51 std::pair<int64_t, size_t> bandwidth_samples_[3];
43 }; 52 };
44 } // namespace bwe 53 } // namespace bwe
45 } // namespace testing 54 } // namespace testing
46 } // namespace webrtc 55 } // namespace webrtc
47 56
48 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_MAX_BANDWIDTH _FILTER_H_ 57 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_ESTIMATORS_MAX_BANDWIDTH _FILTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698