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 |
index 91e99346bfec2790ef81f031f84751aa78adb9f1..05ab9b10d5787879b3d29154f057d0b767911d0d 100644 |
--- a/webrtc/modules/remote_bitrate_estimator/test/estimators/max_bandwidth_filter.cc |
+++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/max_bandwidth_filter.cc |
@@ -14,10 +14,24 @@ |
namespace webrtc { |
namespace testing { |
namespace bwe { |
-MaxBandwidthFilter::MaxBandwidthFilter() {} |
+MaxBandwidthFilter::MaxBandwidthFilter() |
+ : bandwidth_last_round_(0), |
+ round_bandwidth_updated_(0), |
+ max_bandwidth_estimate_(0), |
+ rounds_without_growth_(0) {} |
MaxBandwidthFilter::~MaxBandwidthFilter() {} |
+void MaxBandwidthFilter::AddBandwidthSample(int64_t sample, |
philipel
2017/07/06 12:15:15
what is sample in this case? bps? kbps?
gnish1
2017/07/07 13:43:34
Done.
|
+ int64_t round, |
philipel
2017/07/06 12:15:15
what is round? rtt_ms?
gnish1
2017/07/07 13:43:34
Done.
philipel
2017/07/10 11:53:35
Is round the same as rtt? If so, change to rtt_ms.
|
+ size_t filter_size) { |
philipel
2017/07/06 12:15:15
bytes? ms?
gnish1
2017/07/07 13:43:34
Done.
philipel
2017/07/10 11:53:35
What does filter_size_round represent?
|
+ if (round - round_bandwidth_updated_ >= filter_size || |
+ sample >= max_bandwidth_estimate_) { |
+ max_bandwidth_estimate_ = sample; |
+ round_bandwidth_updated_ = round; |
+ } |
+} |
+ |
bool MaxBandwidthFilter::FullBandwidthReached(float growth_target, |
int max_rounds_without_growth) { |
// Minimal bandwidth necessary to assume that better bandwidth can still be |
@@ -29,9 +43,7 @@ bool MaxBandwidthFilter::FullBandwidthReached(float growth_target, |
return false; |
} |
rounds_without_growth_++; |
- if (rounds_without_growth_ >= max_rounds_without_growth) |
- return true; |
- return false; |
+ return rounds_without_growth_ >= max_rounds_without_growth; |
} |
} // namespace bwe |
} // namespace testing |