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

Side by Side Diff: webrtc/modules/congestion_controller/acknowledge_bitrate_estimator.h

Issue 2917873002: Refactored incoming bitrate estimator. (Closed)
Patch Set: Responsed to comments Created 3 years, 6 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
(Empty)
1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_ACKNOWLEDGE_BITRATE_ESTIMATOR_H_
12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_ACKNOWLEDGE_BITRATE_ESTIMATOR_H_
13
14 #include <vector>
15
16 #include "webrtc/base/optional.h"
17 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
18
19 namespace webrtc {
20
21 // Computes a bayesian estimate of the throughput given acks containing
22 // the arrival time and payload size. Samples which are far from the current
23 // estimate or are based on few packets are given a smaller weight, as they
24 // are considered to be more likely to have been caused by, e.g., delay spikes
25 // unrelated to congestion.
26 class AcknowledgedBitrateEstimator {
27 public:
28 AcknowledgedBitrateEstimator();
29 void IncomingPacketFeedbackVector(
30 const std::vector<PacketFeedback>& packet_feedback_vector);
philipel 2017/06/02 12:32:40 Isn't it possible to forward declare PacketFeedbac
tschumi 2017/06/02 13:13:04 Sure. Done
31
32 rtc::Optional<uint32_t> bitrate_bps() const;
33
34 private:
35 void Update(int64_t now_ms, int bytes);
36 float UpdateWindow(int64_t now_ms, int bytes, int rate_window_ms);
37 int sum_;
38 int64_t current_win_ms_;
39 int64_t prev_time_ms_;
40 float bitrate_estimate_;
41 float bitrate_estimate_var_;
42 };
43
44 } // namespace webrtc
45
46 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_ACKNOWLEDGE_BITRATE_ESTIMATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698