Commit graph

19 commits

Author SHA1 Message Date
Rasmus Brandt
2f650fa822 JitterEstimator: remove unnecessary helper functions
Move functionality to closer where the values are used instead,
as per previous CL comment.

Bug: webrtc:14151
Change-Id: I6b7ca02da197420a1f5da930ba87021e6f557444
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275204
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38148}
2022-09-21 10:42:57 +00:00
Rasmus Brandt
e4bc975a8a JitterEstimator: add field trial for not estimating noise for congested frames
The reason for rejecting the congested frames in the first place, is
that they do not obey a Gaussian distribution around the line from the
Kalman filter. It therefore also does not make sense to include them
in the noise (*) estimation.

(*) noise = variation around the line from the Kalman filter.

Bug: webrtc:14151
Change-Id: Id8a44ba5f13bf9787ab54848109430ef7657f67a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275762
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38100}
2022-09-16 12:40:38 +00:00
Rasmus Brandt
624f2eb1aa JitterEstimator: add field trial for overriding frame delay variation clamping
Bug: webrtc:14151
Change-Id: Ib1f26cfaf92ca56000d5904432901d5db225b05a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275203
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38092}
2022-09-15 12:38:13 +00:00
Rasmus Brandt
7d704739d7 JitterEstimator: add input validation to field trials
This functionality should have been added as part of the original CLs,
but was missed. The purpose of the validation is avoid catastrophic
failures due to misconfiguration (such as RTC_CHECK crashes).
The purpose is not to always provide practically reasonable values.

Bug: webrtc:14151
Change-Id: Icbddade865bd6a868f467a1df7055026935f36f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275560
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38090}
2022-09-15 11:30:37 +00:00
Rasmus Brandt
916648107b Generalize MovingMedianFilter to MovingPercentileFilter
* Make `percentile` configurable and rename class.
* Introduce convenience type `MovingMedianFilter` that
  maintains the behaviour of the old class with that name.
* Move home grown moving 95th percentile filter in
  `JitterEstimator` to this new utility class.

Bug: webrtc:14151
Change-Id: I17d525b6e0bc98c28568c7dfe94b72eeab4a1ca2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275311
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38082}
2022-09-14 15:32:06 +00:00
Rasmus Brandt
0a617882df JitterEstimator: add field trial overrides for avg frame filter
This change adds a median filter that can replace the
IIR filter that is currently used to estimate the
avg frame size (in bytes). It is enabled through a boolean,
and reuses the window length from the max percentile filter.

The median filter is only used by the delay calculation in
`CalculateEstimate()`. It does not replaced the use of the
IIR estimate in the size outlier rejection heuristic.

Bug: webrtc:14151
Change-Id: I519b6b57a8bee3c41a300ed2e92a1981c61cca15
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275121
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38077}
2022-09-14 12:12:27 +00:00
Rasmus Brandt
137f1e681e JitterEstimator: add field trial overrides for max frame filter
This change adds a percentile filter that can replace the
"non-linear IIR" filter that is currently used to estimate the
max frame size (in bytes). The percentile filter is enabled through
the field trial, and it has two tuning parameters: the percentile
that is deemed the "max" frame, and the window length over which
the filter is applied.

Bug: webrtc:14151
Change-Id: I002609edb0a74161aaa6f0934892a1bec2ad8230
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274167
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38047}
2022-09-09 12:48:57 +00:00
Rasmus Brandt
e0dd6cf363 JitterEstimator: add field trial overrides for some constants
Bug: webrtc:14151
Change-Id: Ic7fd87569432810b08f51b65b06279f48db061bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274165
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38035}
2022-09-08 14:33:50 +00:00
Rasmus Brandt
d8479c5b4f JitterEstimator: rename and reorder constants.
The constants are reordered to match the order they are used
when a sample is inserted into the filter. Some of the constants
are renamed to better describe their usage. No functional changes
are intended. Future CLs will add configurability to some of these
constants.

Some basic unit tests are also added.

Bug: webrtc:14151
Change-Id: I731a9cad3d8aeab06ccfa7d212cd160a2d2da27b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274122
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38019}
2022-09-06 13:50:48 +00:00
Rasmus Brandt
8cd8d2292c JitterEstimator: rename some member variables to include unit
This makes it easier to read the code, and to visually verify
that the computations make sense from a dimensional perspective.

No functional changes are intended.

Bug: webrtc:14151
Change-Id: Ic059f3c53618903d63a270b901ac5cec6139d2c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274120
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38006}
2022-09-05 08:09:30 +00:00
Rasmus Brandt
665875b0d8 Rename Kalman filter to match RFC3393
This CL updates the file and class naming, based on the naming discussion in
https://webrtc-review.googlesource.com/c/src/+/265877.
Concretely, that means replacing "delta" with "variation" in the name.

Bug: webrtc:14151
Change-Id: I43e74b1d25f9441015445101f3eb6a7b52f3adba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273960
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37999}
2022-09-02 15:52:28 +00:00
philipel
55a9a3de64 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}
2022-08-19 11:59:58 +00:00
Rasmus Brandt
ae4a832730 Improve FrameDelayDeltaKalmanFilter interface and add more docs.
This CL simplifies and documents the interface of the Kalman filter better. A simple unit test verifying the filter's convergence is
added. No functional changes to the filter are intended.

Future CLs will improve the data member naming and code organization.

Bug: webrtc:14151
Change-Id: I01e60d4b783cabad3ccbdc711c5d746666dd16ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265877
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37766}
2022-08-12 13:42:23 +00:00
Johannes Kron
ef4a2cfc45 Remove condition that will never be active
Remove check if `prev_estimate_` is less than 10 us since it can never
be less than 1 ms.

Bug: None
Change-Id: If151390d22fa0b6ecdc36af64168d3e2049c7b6b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271203
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37745}
2022-08-11 09:41:52 +00:00
Rasmus Brandt
39ae69690e Split out the jitter estimator's Kalman filter into its own class.
The intention of this change is to separate the Kalman filter state
(that prior to this change lived in JitterEstimator) from the
other filter's state, making it easier to see how the different
filters interact.

This move does not include any interface, functional, or
documentation changes. Those will follow in later changes.

A very basic unit test is added, which will also be expanded
later on.

Bug: webrtc:14151
Change-Id: Ifb9b8ce2d9418ea52ccf64a77fd46d1ebba30779
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264984
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37721}
2022-08-09 12:45:08 +00:00
Erik Språng
23370f22c1 Remove unused field trial WebRTC-ReducedJitterDelayKillSwitch.
Bug: None
Change-Id: I8747e63d5c237dce6516b69db95035728ca9965c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269206
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Auto-Submit: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37626}
2022-07-27 13:28:35 +00:00
Erik Språng
93b107d0f0 Remove unused field trial WebRTC-JitterUpperBound
Bug: webrtc:9898
Change-Id: I89f2baca9b96fc00fc73d24086e7c6f5ed8307a8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269401
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Auto-Submit: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37620}
2022-07-26 10:21:04 +00:00
philipel
e1c707c40f Remove unused incomplete_frame argument from JitterEstimator.
Bug: webrtc:14151
Change-Id: I6764315f0c10b304f50e4639a3e49e4ed013c41e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267842
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37443}
2022-07-05 12:53:13 +00:00
Rasmus Brandt
10944e61ac Move JitterEstimator into timing sub-folder
Bug: webrtc:14111
Change-Id: Ic5c66f35e3cedac7a328fbb6613e5cdf13a8005e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263582
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37000}
2022-05-25 09:15:29 +00:00
Renamed from modules/video_coding/jitter_estimator.cc (Browse further)