This CL adds support for I410 buffers (444 10 bits) and modify vp9 and h264 for being able to convert input buffer to it when appropiate.
Bug: webrtc:14818
Change-Id: I2fb3dc9d80c5338944c6df74dd6217a0454180d9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290721
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39123}
Fallback to a default value if the scalability mode is unset or not supported by the codec.
The fallback logic is only enabled if the scalability mode is configured for any of the encodings for now (i.e. initial default values are not set).
Bug: webrtc:11607
Change-Id: Ie632767b627a1dbbef71c59f9340573daf386c14
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/287600
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39074}
We found that the legacy assumption for H264 which assumed that
simulcast streams would use 2x width ratios in unnecessary as the
encoder has since been fixed to handle multiple ratios.
H264 encoder still works even if this assumption is invalid
Bug: None
Change-Id: I9caacf78d26c8215b94858a2d8674ec4cd64e96e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/286940
Reviewed-by: Mirta Dvornicic <mirtad@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39072}
Keeping the headers to allow compatibility with current users
that expect the headers to be in that target before they are
also updated.
Bug: webrtc:9838
Change-Id: I8b1e88850958e92c043686587a37791f01860220
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290569
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39031}
This is in prep for the migration of all unwrappers to
SequenceNumberUnwrapper as a standard implementation.
This moves the SeqNumUnwapper to its own header and adds 2 methods to
SeqNumUnwrapper which are defined by other unwrappers:
* PeekUnwrap
* Reset
It also adds two implementations for RtpTimestamps and
RtpSequenceNumbers.
Bug: webrtc:13982
Change-Id: I5baefb2de1db92fe1bb600760bd63b71e9310eb5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288742
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39030}
This helps in figuring out which dependencies exist, and gets closer
to obeying the "one target per .cc file" rule.
Test failures seem unrelated, so using No-Try.
No-Try: true
Bug: webrtc:14775
Change-Id: Id25466c8b8fe628d05c819cf7c69ae6d8421c6cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288020
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38910}
This tester is an improved version of VideoProcessor and VideoCodecTestFixture and will eventually replace them.
The tester provides better separation between codecs and testing logic. Its knowledge about codecs is limited to frame encode/decode calls and frame ready callbacks. Instantiation and configuration of codecs are the test responsibilities.
Other differences:
- Run encoding and decoding in separate threads
- Run quality analysis in a separate thread
- Reference frame buffering is moved into video source (which re-read frames from the file).
- Make it possible to run decode-only tests
This CL is MVP implementation: it adds only 1 test (video_codec_test.cc, ConstantRate/EncodeDecodeTest) and the test is disabled for now.
Bug: b/261160916
Change-Id: Ida24a2fca1b1496237fa695c812084877c76379f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283525
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38901}
At the same time, proper names of some parameters are refactored in SimulcastEncoderAdapter.
Bug: None
Change-Id: Ia036e3f362d1394e90aa26b79953c1ffe75e2fe0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284961
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Chunbo Hua <chunbo.hua@intel.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38870}
This is in the webrtc-stats spec at
https://www.w3.org/TR/webrtc-stats/#dom-rtcoutboundrtpstreamstats-scalabilitymode.
This adds the scalability mode to CodecSpecificInfo which is used to
plumb the modes for each simulcast layer.
TBR=orphis@webrtc.org
Tested: Compiled into Chrome and confirmed the scalability mode set for AV1, VP9, VP8 and H264 software encoders in chrome://webrtc-internals.
Bug: webrtc:14730
Change-Id: I71ceba8f6485a4f4a73e0856031b8d5f16f913f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285085
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38847}
Purposes of this refactoring:
1. Add functionality for reading a specified frame.
2. Change resolution and frame rate on per-frame basis.
Both features are needed for https://webrtc-review.googlesource.com/c/src/+/283525
Bug: b/261160916
Change-Id: I6d60e62dbc3913c43b5c1b491690f5cb4a8632dd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285483
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38829}
Passes frame_types to the underlying encoder in bypass mode.
For libvpx this has no effect, for H264 this changes the behavior
to allow generating keyframes on a per-layer basis.
BUG=chromium:1354101
Change-Id: I26fc22d9e2ec4681a57ce591e9eafd0b1ec962b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285083
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#38821}
in the case of separate encoders.
drive-by: add helper function to expect per-layer keyframes
BUG=chromium:1354101
Change-Id: Ib645a621add899f035bea319f035dcb0b2617510
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281002
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#38734}
Cache target bit- and framerate in a frame_num -> rates map and fetch
the rates accociated with the current frame when needed. This solves
the issue when wrong target rates may be used due to frames buffering
in encoder.
Bug: b/254447893
Change-Id: I369c8d8e71234c957dc2362b055061d12cec818f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283841
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38673}
Openh264 switched from api/svc to api/wels as the location for some
codec header files. During the transition it was necessary to
conditionally from either the old or new location, but now that the
switch is completed and has settled for about two weeks the conditionals
can be removed. This finishes the #include transition started by
webrtc-review.googlesource.com/c/280800
Bug: chromium:1218384
Change-Id: Ic0847428d134687908cc26fec1fdec0c612674b2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38622}
This should be landed after https://chromium-review.googlesource.com/c/chromium/src/+/3986032
Bug: chromium:1218384
Change-Id: Id4104d2914f811e722a083021f515fd06b69b910
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280800
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Bruce Dawson <brucedawson@google.com>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38515}
This CL adds #includes to header files in order to make them
self contained after the preprocessor pass.
Bug: b/251890128
Change-Id: I81c3ba38fb8ab8a2bbd151ba99aa871fae9f1b1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278422
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38327}
This is to keep the deprecated VideoReceiver separate from the
implementation used by VideoReceiver2 before updating
VCMDecoderDatabase to have ownership of the registered decoders.
Fixing typo (DataBase->Database) in the name of the remaining class.
Bug: webrtc:14486, webrtc:14497
Change-Id: I5ee755921454b0831b3af6d0161f5b48c7c60540
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276781
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38247}
This updates VideoReceiveStream2::Stop() to symmetrically tear down
state that's built up in VideoReceiveStream2::Start().
Bug: webrtc:11993, webrtc:14486
Change-Id: I41f4feea5584e5baaeed2143432136f8b9761321
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272537
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38244}
This cl move VideoEncoderConfig from api/ to video/config.
VideoStreamEncoderInterface and VideoStreamEncoderObserver
are moved as collateral.
brandt@ think that the reason these were in api/ in the
first place had to downstream project.
Functionality wise, this is a NOP, but it makes it easier
to modify the encoder (config).
Bug: webrtc:14451
Change-Id: I2610d815aeb186298498e7102cac773ecac8cd36
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277002
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38242}
This cl/ is a NOP refactoring,
moving the EncoderStreamFactory from within webrtc_video_engine.cc
into own file in video/. simulcast.cc is collateral.
Bug: webrtc:14451
Change-Id: Ia69b9241d8cd8a12be6628d887701f2e244c07cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276861
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38224}
This CL wraps the |Dav1dPicture| data directly for |VideoFrame| using
instead of copy data out to new buffer.
Bug: None
Change-Id: I21ceffb5cac7dda4a44eafbd0ed221974b8d45ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276526
Commit-Queue: Zhaoliang Ma <zhaoliang.ma@intel.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38194}
Reporting timeouts is useful for native hw backed codec implementations.
The value is in sync with VideoCodecStatus.java in the Android sdk.
Bug: b/185740707
Change-Id: I9a08a1303586c677be53aaa4f39455f42e519996
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276042
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Auto-Submit: Linus Nilsson <lnilsson@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38168}
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}
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}