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}
The `TimestampExtrapolator` is only used by the `VCMTiming`
class, despite there being references to it from both
`modules/rtp_rtcp/BUILD.gn` and `modules/video_coding/BUILD.gn`.
Bug: webrtc:14111
Change-Id: If1a02a56a0c83b13d619ca08dc76c884fa829369
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275482
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38093}
The Chromium RTCVideoEncoder unfortunately doesn't set if the
result is at target quality, and the definition of the threshold
is buried in libvpx_vp8_encoder.h.
This change
* Updates VideoStreamEncoder to postprocess an incoming EncodedImage
by interpreting the incoming QP information instead.
* Updates the related VideoStreamEncoder test to simulate an encoder
producing images around the QP threshold.
* Updates the steady state VP8 screencast QP threshold to a central
include file.
* Moves this and previously existing EncodedImage post-processing to a
new method AugmentEncodedImage.
Bug: b/245029833
Change-Id: I69ae29ffe501e84f28908f7d9a8cfd066ba82b43
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275380
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38091}
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}
* 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}
kTemporalStructureMode4 is not used anywhere in the code.
Bug: None
Change-Id: I9a396f6706d26940fae68d1318942b5f31afa3bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274380
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#38079}
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}
Detected by the new UBSan configurations (crbug.com/1352721):
[ RUN ] TestDecodingState.FrameContinuity
../../modules/video_coding/session_info.cc:250:10: runtime error: null pointer passed as argument 1, which is declared to never be null
../../build/linux/debian_bullseye_amd64-sysroot/usr/include/string.h:44:28: note: nonnull attribute specified here
No-Try: True
Bug: None
Change-Id: Ib4fb20d948b41da1a35dacb8abe944eb24f806f5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275200
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38063}
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}
BlockingCall doesn't take rtc::Location parameter and thus most of the dependencies on location can be removed
Bug: webrtc:11318
Change-Id: I91a17e342dd9a9e3e2c8f7fbe267474c98a8d0e5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274620
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38045}
For the linked test case that speeds up chromium fuzzer by ~13%
Run time decrease from ~50 seconds to ~44 seconds
Bug: chromium:1357929
Change-Id: I702edf4fda7afd31a5288621220dac063f764ced
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274601
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38038}
The Chrome Remote Desktop team is looking to support AV1 profile-1
w/ I444 for screen sharing however only I420 is currently supported.
This CL adds I444 support for the Dav1dDecoder, which appears to be
the preferred decoder and adds profile-1 to the
InternalDecoderFactory when the Dav1dDecoder is being used.
I've tested this CL using a CRD host w/ I444 enabled and it seems to
work as expected, though I've only tested on a debug build so I plan
to do some perf testing once this is available in a release build.
Bug: chromium:1329660
Change-Id: I2b8b7b7fd530727456ac5c46e694e7dbad6deff2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273986
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Joe Downing <joedow@google.com>
Cr-Commit-Position: refs/heads/main@{#38022}
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}
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}
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}
Those never existed, were likely a copy-paste error in the spec
that we somehow inherited.
Bug: webrtc:11607
Change-Id: Ib4a038f061123e879f1099656273f6392f092213
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273485
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37953}
This reverts commit bc8a62b244.
Reason for revert: reverting per
https://bugs.chromium.org/p/webrtc/issues/detail?id=14368#c5
This needs more careful consideration and should be put behind a finch flag or origin trial
Original change's description:
> Enable Multithreaded H264 Encoding For OpenH264
>
> Re-enabled multithreaded encoding using OpenH264, as the issue described in crbug.com/583348 no longer applies.
>
> Bug: webrtc:14368
> Change-Id: I5ae768a6edf3b40d99c13fb4ee4662626c993a66
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271820
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37837}
Bug: webrtc:14368
Change-Id: Icebedfe4eb8e3901670b9f90e229379fca95206b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272600
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37878}
This moves the ownership away from VideoReceiveStream2 and closer to
VCMDecoderDataBase. That facilitates unregistration (upcoming change)
without recreating receive streams.
Bug: none
Change-Id: I812175134730a0ffbf7077fd149c8489481c73d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272481
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37866}
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}
Now Configure(), Decode() and Release() calls to the decoders should
all happen on the decoder thread. Added thread checkers to verify.
Bug: None
Change-Id: I2a1cf2cf7f3c3c7c50e382d82a3638e916ed9c34
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272368
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37840}
Re-enabled multithreaded encoding using OpenH264, as the issue described in crbug.com/583348 no longer applies.
Bug: webrtc:14368
Change-Id: I5ae768a6edf3b40d99c13fb4ee4662626c993a66
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271820
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37837}
As mentioned in https://crbug.com/webrtc/11956, the results did not show
any performance improvments.
Bug: webrtc:11956
Change-Id: Ie050aa5a6083fcf0c776fb8d03e7d18644b37f97
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272280
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37833}
This was only set to nullptr in non-test environments and was thusly
unused. With this change, the stats callbacks are gaurenteed to only
come from the VideoStreamBufferController and so the thread checks can
be removed.
Bug: webrtc:14003
Change-Id: Iaf0e77aa7c45a317e38ae27739edcefd3123d832
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272021
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37816}
Moves FrameBuffer2 to its own GN target to reduce the binary size of the
video target.
Bug: None
Change-Id: I40e86a1eabc0c9e8e6fada3dcdb4e3a043c61c6c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271286
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37803}
- Move existing check on `max_frame_size` to the top.
By doing this early, the filter will not end up in an
inconsistent state (predicted but not updated) when
called with a tiny `max_frame_size`.
- Add sanity check on noise variance.
This will avoid sqrt of a negative number.
Bug: webrtc:14151
Change-Id: I2507a9114655d3c3ae35bf5ed83f3f1154c42ad3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271281
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37798}
This CL reorders the update steps physically, to make them
easier to comprehend. It renames variables to be more verbose,
but also adds succinct mathematical descriptions (using Wikipedia
notation) to all steps.
No functional changes are intended with this change.
Bug: webrtc:14151
Change-Id: I6a4642e89e2b73639f0b4c928e07b317c14d5884
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271546
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37784}
This class is never overridden.
Bug: webrtc:14151
Change-Id: I3b70e927ee0eafd71ce4bdb8f6e8d6330c1a3f08
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271501
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37781}
* Update naming of data members.
* Start reordering code blocks in `PredictAndUpdate`.
(The "predict" step is done in this C:. The "update"
step will be improved in another cl.)
Bug: webrtc:14151
Change-Id: Idea1e8e786bd672dadedbcb3cd5598f4a033e81e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271023
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37767}
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}
that rtc::Location parameter was used only as extra information for the
RTC_CHECKs directly in the function, thus call stack of the crash should
provide all the information about the caller.
Bug: webrtc:11318
Change-Id: Iec6dd2c5de547f3e1601647a614be7ce57a55734
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270920
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37748}
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}
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}
* Add test to Generic decoder unittests to ensure drop behaviour is covered.
* Use simulated time in the generic decoder unittests.
Bug: webrtc:14324
Change-Id: I10b28b45c434f92d5344683fb9ca6676efe0e08c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270662
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37710}
follow-up from https://webrtc-review.googlesource.com/c/src/+/262810
* replace Time::Millis(0) and TimeDelta::Millis(0) with ::Zero()
* drop unnecessary webrtc namespace from some TimeDeltas
* make TimeDelta do the unit conversion for stats
BUG=webrtc:13756
Change-Id: Ic60625ae0fc7959a47a6be9f5051851feaf76373
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265875
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37664}
Some of the timestamps input into UpdateCurrentDelay are not truncated
to milliseconds and thus a small negative delay can result. This means
the delay will not update when it should have.
Bug: webrtc:14168
Change-Id: I5293339b6a39201c680854e9596b717025ee8dc1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266370
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37657}