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

Unified Diff: webrtc/modules/congestion_controller/median_slope_estimator.h

Issue 2578543002: Avoid precision loss in MedianSlopeEstimator from int64_t -> double conversion (Closed)
Patch Set: Move test function to anonymous namespace Created 4 years 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
« no previous file with comments | « no previous file | webrtc/modules/congestion_controller/median_slope_estimator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/congestion_controller/median_slope_estimator.h
diff --git a/webrtc/modules/congestion_controller/median_slope_estimator.h b/webrtc/modules/congestion_controller/median_slope_estimator.h
index 26d7f6144d76b350ce3bbc9589ba09db840eb73e..76bb60ac81e04f8eb2f26901d7200b8523164979 100644
--- a/webrtc/modules/congestion_controller/median_slope_estimator.h
+++ b/webrtc/modules/congestion_controller/median_slope_estimator.h
@@ -10,13 +10,14 @@
#ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_MEDIAN_SLOPE_ESTIMATOR_H_
#define WEBRTC_MODULES_CONGESTION_CONTROLLER_MEDIAN_SLOPE_ESTIMATOR_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <list>
-#include <utility>
#include <vector>
#include "webrtc/base/analytics/percentile_filter.h"
#include "webrtc/base/constructormagic.h"
-#include "webrtc/common_types.h"
namespace webrtc {
@@ -32,7 +33,9 @@ class MedianSlopeEstimator {
// Update the estimator with a new sample. The deltas should represent deltas
// between timestamp groups as defined by the InterArrival class.
- void Update(double recv_delta_ms, double send_delta_ms, double now_ms);
+ void Update(double recv_delta_ms,
+ double send_delta_ms,
+ int64_t arrival_time_ms);
// Returns the estimated trend k multiplied by some gain.
// 0 < k < 1 -> the delay increases, queues are filling up
@@ -45,11 +48,11 @@ class MedianSlopeEstimator {
private:
struct DelayInfo {
- DelayInfo(double time, double delay, size_t slope_count)
+ DelayInfo(int64_t time, double delay, size_t slope_count)
: time(time), delay(delay) {
slopes.reserve(slope_count);
}
- double time;
+ int64_t time;
double delay;
std::vector<double> slopes;
};
« no previous file with comments | « no previous file | webrtc/modules/congestion_controller/median_slope_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698