OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/congestion_control/inter_arrival_bitrate_ramp_up.h" | 5 #include "net/quic/congestion_control/inter_arrival_bitrate_ramp_up.h" |
6 | 6 |
7 #include <algorithm> | |
8 | |
9 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
10 #include "base/logging.h" | 8 #include "base/logging.h" |
11 #include "net/quic/congestion_control/cube_root.h" | 9 #include "net/quic/congestion_control/cube_root.h" |
12 #include "net/quic/quic_protocol.h" | 10 #include "net/quic/quic_protocol.h" |
13 | 11 |
14 namespace { | 12 namespace { |
15 // The following constants are in 2^10 fractions of a second instead of ms to | 13 // The following constants are in 2^10 fractions of a second instead of ms to |
16 // allow a 10 shift right to divide. | 14 // allow a 10 shift right to divide. |
17 const int kCubeScale = 40; // 1024*1024^3 (first 1024 is from 0.100^3) | 15 const int kCubeScale = 40; // 1024*1024^3 (first 1024 is from 0.100^3) |
18 // where 0.100 is 100 ms which is the scaling | 16 // where 0.100 is 100 ms which is the scaling |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 165 } |
168 return current_rate_; | 166 return current_rate_; |
169 } | 167 } |
170 | 168 |
171 uint32 InterArrivalBitrateRampUp::CalcuateTimeToOriginPoint( | 169 uint32 InterArrivalBitrateRampUp::CalcuateTimeToOriginPoint( |
172 QuicBandwidth rate_difference) const { | 170 QuicBandwidth rate_difference) const { |
173 return CubeRoot::Root(kCubeFactor * rate_difference.ToKBytesPerSecond()); | 171 return CubeRoot::Root(kCubeFactor * rate_difference.ToKBytesPerSecond()); |
174 } | 172 } |
175 | 173 |
176 } // namespace net | 174 } // namespace net |
OLD | NEW |