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

Unified Diff: webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc

Issue 1376423002: Make overuse estimator one dimensional. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
index f1a1cb66020620fc59ec987791c29824e14abafb..29115b94bb5fd5ae73ad7f33577102030122ec3f 100644
--- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
+++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
@@ -28,14 +28,13 @@ enum { kTimestampGroupLengthMs = 5 };
static const double kTimestampToMs = 1.0 / 90.0;
struct RemoteBitrateEstimatorSingleStream::Detector {
- explicit Detector(int64_t last_packet_time_ms,
- const OverUseDetectorOptions& options,
- bool enable_burst_grouping)
- : last_packet_time_ms(last_packet_time_ms),
- inter_arrival(90 * kTimestampGroupLengthMs, kTimestampToMs,
- enable_burst_grouping),
- estimator(options),
- detector(options) {}
+ explicit Detector(int64_t last_packet_time_ms, bool enable_burst_grouping)
+ : last_packet_time_ms(last_packet_time_ms),
+ inter_arrival(90 * kTimestampGroupLengthMs,
+ kTimestampToMs,
+ enable_burst_grouping),
+ estimator(),
+ detector() {}
int64_t last_packet_time_ms;
InterArrival inter_arrival;
OveruseEstimator estimator;
@@ -82,8 +81,8 @@ void RemoteBitrateEstimatorSingleStream::IncomingPacket(int64_t arrival_time_ms,
// automatically cleaned up when we have one RemoteBitrateEstimator per REMB
// group.
std::pair<SsrcOveruseEstimatorMap::iterator, bool> insert_result =
- overuse_detectors_.insert(std::make_pair(
- ssrc, new Detector(now_ms, OverUseDetectorOptions(), true)));
+ overuse_detectors_.insert(
+ std::make_pair(ssrc, new Detector(now_ms, true)));
it = insert_result.first;
}
Detector* estimator = it->second;
@@ -92,12 +91,10 @@ void RemoteBitrateEstimatorSingleStream::IncomingPacket(int64_t arrival_time_ms,
const BandwidthUsage prior_state = estimator->detector.State();
uint32_t timestamp_delta = 0;
int64_t time_delta = 0;
- int size_delta = 0;
if (estimator->inter_arrival.ComputeDeltas(rtp_timestamp, arrival_time_ms,
- payload_size, &timestamp_delta,
- &time_delta, &size_delta)) {
+ &timestamp_delta, &time_delta)) {
double timestamp_delta_ms = timestamp_delta * kTimestampToMs;
- estimator->estimator.Update(time_delta, timestamp_delta_ms, size_delta,
+ estimator->estimator.Update(time_delta, timestamp_delta_ms,
estimator->detector.State());
estimator->detector.Detect(estimator->estimator.offset(),
timestamp_delta_ms,

Powered by Google App Engine
This is Rietveld 408576698