Chromium Code Reviews| Index: webrtc/modules/congestion_controller/probe_bitrate_estimator.cc |
| diff --git a/webrtc/modules/congestion_controller/probe_bitrate_estimator.cc b/webrtc/modules/congestion_controller/probe_bitrate_estimator.cc |
| index 0a48a2ee3883621a494341b2202bda27fd25835d..0ffb9e8cdc85532ad705839d800cc4b7bbdc6ea9 100644 |
| --- a/webrtc/modules/congestion_controller/probe_bitrate_estimator.cc |
| +++ b/webrtc/modules/congestion_controller/probe_bitrate_estimator.cc |
| @@ -17,7 +17,10 @@ |
| namespace { |
| // The minumum number of probes we need for a valid cluster. |
|
Sergey Ulanov
2017/03/08 22:12:20
Update this comment (e.g. "Portion of successful p
philipel
2017/03/09 11:47:41
Done.
|
| -constexpr int kMinNumProbesValidCluster = 4; |
| +constexpr float kMinReceivedProbesRatio = 4.0 / 5.0; |
|
Sergey Ulanov
2017/03/08 22:12:20
0.8?
philipel
2017/03/09 11:47:41
Changed to int instead.
|
| + |
| +// The minumum number of bytes we need for a valid cluster. |
|
Sergey Ulanov
2017/03/08 22:12:20
rephrase this comment as well please. It's a ratio
philipel
2017/03/09 11:47:41
Done.
|
| +constexpr float kMinReceivedBytesRatio = 4.0 / 5.0; |
| // The maximum (receive rate)/(send rate) ratio for a valid estimate. |
| constexpr float kValidRatio = 2.0f; |
| @@ -63,7 +66,15 @@ int ProbeBitrateEstimator::HandleProbeAndEstimateBitrate( |
| cluster->size_total += payload_size_bits; |
| cluster->num_probes += 1; |
| - if (cluster->num_probes < kMinNumProbesValidCluster) |
| + RTC_DCHECK_GT(packet_info.pacing_info.probe_cluster_min_probes, 0); |
| + RTC_DCHECK_GT(packet_info.pacing_info.probe_cluster_min_bytes, 0); |
| + |
| + int min_probes = |
| + static_cast<int>(packet_info.pacing_info.probe_cluster_min_probes * |
|
terelius
2017/03/08 15:55:11
This might not be rounded correctly. kMinReceivedP
Sergey Ulanov
2017/03/08 22:12:20
maybe use integer percentage value (4/5 = 80%)? Th
philipel
2017/03/09 11:47:41
True, switched to int as Sergey suggested.
philipel
2017/03/09 11:47:41
Good idea, implemented!
|
| + kMinReceivedProbesRatio); |
| + int min_bytes = static_cast<int>( |
|
terelius
2017/03/08 15:55:11
This might not be rounded correctly. kMinReceivedB
|
| + packet_info.pacing_info.probe_cluster_min_bytes * kMinReceivedBytesRatio); |
| + if (cluster->num_probes < min_probes || cluster->size_total < min_bytes * 8) |
| return -1; |
| float send_interval_ms = cluster->last_send_ms - cluster->first_send_ms; |