Use doubles instead of api/units for jitter estimation.

For now use doubles as units in api/units have insufficient precision for jitter estimation.

Bug: webrtc:14381
Change-Id: I5a691b6a404b734a5bef11d677b72040bc02ff0f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272367
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37841}
This commit is contained in:
philipel
2022-08-19 13:23:26 +02:00
committed by WebRTC LUCI CQ
parent 79c96ded88
commit 55a9a3de64
5 changed files with 54 additions and 45 deletions

View File

@ -92,12 +92,17 @@ class JitterEstimator {
// a linear Kalman filter.
FrameDelayDeltaKalmanFilter kalman_filter_;
static constexpr DataSize kDefaultAvgAndMaxFrameSize = DataSize::Bytes(500);
DataSize avg_frame_size_ = kDefaultAvgAndMaxFrameSize; // Average frame size
// TODO(bugs.webrtc.org/14381): Update `avg_frame_size_bytes_` to DataSize
// when api/units have sufficient precision.
double avg_frame_size_bytes_; // Average frame size
double var_frame_size_; // Frame size variance. Unit is bytes^2.
// Largest frame size received (descending with a factor kPsi)
DataSize max_frame_size_ = kDefaultAvgAndMaxFrameSize;
DataSize frame_size_sum_ = DataSize::Zero();
// TODO(bugs.webrtc.org/14381): Update `max_frame_size_bytes_` to DataSize
// when api/units have sufficient precision.
double max_frame_size_bytes_;
// TODO(bugs.webrtc.org/14381): Update `frame_size_sum_bytes_` to DataSize
// when api/units have sufficient precision.
double frame_size_sum_bytes_;
uint32_t frame_size_count_;
absl::optional<Timestamp> last_update_time_;