Commit graph

1663 commits

Author SHA1 Message Date
Rasmus Brandt
9a6a087f37 Remove forward declares
This was missed in https://webrtc-review.googlesource.com/c/src/+/275482.

Bug: webrtc:14111
Change-Id: Id5efcc6838fc3ce4745074b8888c733939e4478d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275767
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38101}
2022-09-16 13:33:08 +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
bcf24f5bcd Move TimestampExtrapolator closer to its single user
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}
2022-09-15 13:49:18 +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
Markus Handell
e1a198b41d VideoStreamEncoder: set at target quality based on codec.
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}
2022-09-15 12:15:17 +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
Byoungchan Lee
80ed9b8eb9 Remove unused VP9 TemporalStructureMode
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}
2022-09-14 13:33:59 +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
Mirko Bonadei
307f7f37e0 Fix memcpy nullptr src or dest (UB).
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}
2022-09-12 15:08:47 +00:00
Sergey Silkin
ceb71cd557 Switch encoder on any critical frame encode error (returncode < 0)
Before this change encoder switch was triggered only if encode() returns WEBRTC_VIDEO_CODEC_ENCODER_FAILURE. Android HW encoder wrapper never return this error code. It returns WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE [1, 2] or WEBRTC_VIDEO_CODEC_ERROR [3].

Change value of WEBRTC_VIDEO_CODEC_TARGET_BITRATE_OVERSHOOT from -14 to 5 to avoid it to be interpreted as a critical error.

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/android/src/jni/video_encoder_wrapper.cc;drc=c05a1be5b49f5c03b6955b05bcbf47609e1b0381;l=324

[2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/android/src/jni/video_encoder_wrapper.cc;drc=c05a1be5b49f5c03b6955b05bcbf47609e1b0381;l=335

[3] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/android/src/jni/video_encoder_wrapper.cc;drc=c05a1be5b49f5c03b6955b05bcbf47609e1b0381;l=331

Bug: b/243402636
Change-Id: Iaf0129f3f9d71c07bb06804fe1f92a1f84f6da26
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274402
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38060}
2022-09-12 12:43:17 +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
Danil Chapovalov
9e09a1f327 Replace Thread::Invoke with Thread::BlockingCall
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}
2022-09-09 10:44:17 +00:00
Danil Chapovalov
8bfec7c5bc Speed up per frame debug log in vp9 encoder wrapper
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}
2022-09-08 16:39:40 +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
Joe Downing
59020bd88b Add AV1 profile-1 video decode support to WebRTC
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}
2022-09-06 16:31:40 +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
Åsa Persson
ecfe8da46b Add support for more scalability modes (1.5:1 resolution ratio).
Added modes:
- S2T1h
- S2T2h
- S2T3h
- S3T1h
- S3T2h
- S3T3h

Bug: webrtc:13960
Change-Id: I618a30c68b0ce1609847ee33a2298fe8fa0720c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273664
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37968}
2022-08-31 11:01:16 +00:00
Florent Castelli
33155d763c svc: Remove references to bogus modes
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}
2022-08-30 14:03:21 +00:00
Åsa Persson
319531efa6 Add support for more scalability modes (1.5:1 resolution ratio).
Added modes:
- L2T2h
- L2T3h
- L3T1h
- L3T2h
- L3T3h

Bug: webrtc:13960
Change-Id: I046a9a1f90629f6d4a5a82d4434e7cc0fa983263
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273345
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37951}
2022-08-30 12:33:41 +00:00
Byoungchan Lee
2d7db71fda Add an API to query resolution ratio between spatial layers
Bug: webrtc:13960
Change-Id: I349b08397e1cd1235bb15af1011aaac8383388b8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273122
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#37949}
2022-08-30 11:48:04 +00:00
Åsa Persson
6d0516412e Add support for scalability modes S2T2, S3T1, S3T2.
Bug: webrtc:13960
Change-Id: Icafd3a5a3f8889777d65da5313b24e56a57af4d9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273301
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37943}
2022-08-30 09:51:11 +00:00
Åsa Persson
46f4de5722 Add support for scalability modes L3T1_KEY, L3T2, L3T2_KEY.
Bug: webrtc:13960
Change-Id: Ib5c8309271d83a0fcfdecf7a93fdd61483c7d3e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273105
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37927}
2022-08-29 11:55:52 +00:00
Sergey Silkin
5d80958d5e Name rate adaptation tests
Bug: none
Change-Id: I10f9b2b14b5fa464d5a88d485e8c7ea1be636faf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272680
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37884}
2022-08-24 08:36:39 +00:00
Philipp Hancke
2e61a8fa60 Revert "Enable Multithreaded H264 Encoding For OpenH264"
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}
2022-08-23 11:18:33 +00:00
Tommi
bd02e70629 Move decoder instance ownership to VideoReceiver2
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}
2022-08-22 13:42:47 +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
Erik Språng
79c96ded88 On receive stream shutdown, deregister decoders on decoder thread.
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}
2022-08-19 11:48:48 +00:00
Brett Hebert
bc8a62b244 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}
2022-08-19 10:30:37 +00:00
Markus Handell
2cfc1af78a Update rtc::Event::Wait call sites to use TimeDelta.
Bug: webrtc:14366
Change-Id: I949c1d26f030696b18153afef977633c9a5bd4cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272003
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37835}
2022-08-19 10:07:28 +00:00
Evan Shrubsole
9f1f48bdd8 Remove WebRTC-NV12Decode field trial
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}
2022-08-19 08:57:34 +00:00
Evan Shrubsole
de7ae5755b Remove statistics tracking from FrameBuffer2
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}
2022-08-18 09:13:28 +00:00
Evan Shrubsole
29d7292a34 Clean VideoReceiveStream2 includes
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}
2022-08-16 15:20:14 +00:00
Rasmus Brandt
94b3b5e341 Improve sanity checks
- 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}
2022-08-16 13:37:22 +00:00
Rasmus Brandt
875c9d357b Reorder Kalman filter update steps physically (but not logically)
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}
2022-08-15 14:56:06 +00:00
Rasmus Brandt
24a8e0d161 Remove unnecessary virtual function specifiers
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}
2022-08-15 08:58:46 +00:00
Rasmus Brandt
1856b2ce71 Stop adding zeros for the off-diagonal components
Bug: webrtc:14151
Change-Id: I58017cab911e642f457f665c5f4d1ff6d11d8571
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271545
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37768}
2022-08-12 16:04:34 +00:00
Rasmus Brandt
949530e6aa Improve FrameDelayDeltaKalmanFilter members naming.
* 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}
2022-08-12 14:07:44 +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
Danil Chapovalov
e519f38eaa Remove rtc::Location from SendTask test helper
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}
2022-08-11 12:55:32 +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
Evan Shrubsole
1c51ec4d74 Replace timestamp map with a deque in generic decoder
* 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}
2022-08-08 13:22:57 +00:00
Evan Shrubsole
15b2ca7e77 Clean up VCMFrameInformation
* Removes unused userData
* Switches render time to a timestamp.

Bug: None
Change-Id: If6e055e9f5486081a850691f6c481c89b59d5de2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270580
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37698}
2022-08-05 11:00:37 +00:00
Danil Chapovalov
2ed6fc2217 In Vp9 encoder wrapper force key frame on svc controller request
Bug: chromium:1349761
Change-Id: I865a251ea87b0946ff0247cba5c3bf1e098dffab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270482
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37684}
2022-08-03 19:15:45 +00:00
Philipp Hancke
a204ad210d clean up misc TimeDelta use
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}
2022-08-02 13:52:36 +00:00
Evan Shrubsole
496ad52cb2 UpdateCurrentDelay should update delay with rounding errors
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}
2022-08-02 08:47:54 +00:00
Danil Chapovalov
3f21ba68bc Improve LibvpxVp9Encoder::UpdateReferenceBuffers perfomance
This change speeds up vp9 encoder reference fuzzer

Bug: chromium:1281020
Change-Id: I8def449b2bf7a525c8d4c8179b68d0b89594bdc1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269216
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37642}
2022-07-29 07:50:11 +00:00