The `FrameToRender` function is considered a part of WebRTC's API so it cannot just be removed all at once. Since it is a pure virtual function it needs some preparation for the deprecation. This CL implements a default implementation. It will now be possible to not implement the function, but it will kill the process in that case.
Bug: webrtc:358039777
Change-Id: Ia83c63ab035abda76beb30ba98b23f9cc835a6a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365500
Commit-Queue: Erik Språng <sprang@webrtc.org>
Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43235}
The split shows that some places don't need it at all. Most other
places will depend on both send and receive stream targets.
Bug: webrtc:373151158
Change-Id: I788136a2ee84180c16345a7929b7f7bf3f97507b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365460
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43230}
This is to make the name consistent with the other methods in the
interface and additionally to in the future not have a function that has
the same name as the `FrameToRender` struct.
Bug: webrtc:358039777
Change-Id: Iac727d93ab9e020a073477bd33d0f67f9983a0aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364961
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43195}
This is a reland of commit 01f91c81f7660be842fa44e96bf804a8b2402f47
Original change's description:
> Add a FrameToRender argument struct as input to FrameToRender
>
> This is to make it easier to add new arguments to the method in the
> future. We will remove the already existing method accordingly to WebRTCs deprecation rules.
>
> Bug: webrtc:358039777
> Change-Id: Id0706de5216fbd0182cac80ebfccfc4a6a055ee8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364642
> Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43181}
Bug: webrtc:358039777
Change-Id: I404bb9660d9f4436c0658814fd3ac7d74e483f0f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364900
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43188}
More test coverage for previously fixed bug
https://crbug.com/webrtc/369654168.
Two tests are added:
1. LibvpxVp9Encoder unit test that 4:2:1 720p can be reconfigured to
singlecast (which is what happens for encodings[0] in the bug).
2. Integration test that 4:2:1 720p can change to 180p,360p,540p.
This is the exact same test as was added in [1] but using
requested_resolution instead of scale_resolution_down_by.
[1] https://webrtc-review.googlesource.com/c/src/+/363941
Bug: webrtc:369654168
Change-Id: I83456b9254c1c6f647586d340d0fe5864b5515c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364200
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43185}
This reverts commit 01f91c81f7660be842fa44e96bf804a8b2402f47.
Reason for revert: break downstream projects.
Original change's description:
> Add a FrameToRender argument struct as input to FrameToRender
>
> This is to make it easier to add new arguments to the method in the
> future. We will remove the already existing method accordingly to WebRTCs deprecation rules.
>
> Bug: webrtc:358039777
> Change-Id: Id0706de5216fbd0182cac80ebfccfc4a6a055ee8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364642
> Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43181}
Bug: webrtc:358039777
Change-Id: Id59633023a428fb63aadeb266421b09040e590bb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364841
Owners-Override: Jeremy Leconte <jleconte@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#43184}
This is to make it easier to add new arguments to the method in the
future. We will remove the already existing method accordingly to WebRTCs deprecation rules.
Bug: webrtc:358039777
Change-Id: Id0706de5216fbd0182cac80ebfccfc4a6a055ee8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364642
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Auto-Submit: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43181}
To force SvcRateAllocator use propagated rather than global field trials
Bug: webrtc:42220378
Change-Id: I0ca3186ee2428aafe3d7f093603b708e03ada121
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362722
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43123}
As of [1], a single VP9 encoder instance can produce simulcast 4:2:1.
When it does, the EncodedImage has its simulcast index set (0, 1, 2).
The bug is that if you then go back to a single encoder instance,
either because you're doing singlecast or because you're doing
simulcast with scaling factors that are not power of two (not 4:2:1),
then the simulcast index which was previously set to 2 is not reset due
to the old code path never calling SetSimulcastIndex.
Example repro:
1. Send VP9 simulcast {180p, 360p, 720p}, i.e. 4:2.1.
2. Reconfigure to {180p, 360p, 540p}, i.e. no longer 4:2:1.
What should happen: all three layers are sent.
What actually happened: 180p is not sent and the 540p layer flips flops
between 180p and 540p because the EncodedImage says simulcast index is
2 for both encodings[0] and encodings[2].
The fix is a one-line change: `SetSimulcastIndex(std::nullopt)` in the
case that we don't have a `simulcast_to_svc_converter_` that sets it
(0, 1, 2) for us.
[1] https://webrtc-review.googlesource.com/c/src/+/360280
Bug: chromium:370299916
Change-Id: I52bd4428bd12528f0e98869ec61626c06f589b43
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363941
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43109}
RTCVideoEncoder in chromium use it to generate dependency template
and generic frame info for hw encode accelerators after encoding.
https://chromium-review.googlesource.com/c/chromium/src/+/5849272
Bug: chromium:40763991
Change-Id: I96396ad972bf18790b09508e428c6362aae24a65
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362151
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Yingying Ma <yingying.ma@intel.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43087}
Those trigger new warnings when importing the Chromium roll
Bug: None
Change-Id: Ica71cc83f5bbfd8fec4736185d389b9e82f2276e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363740
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43080}
AV1E_SET_MAX_CONSEC_FRAME_DROP_MS_CBR was added in https://aomedia-review.googlesource.com/c/aom/+/192402. It allows to configure max number of consecutive frame drops using time units. Use it instead of AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR.
Bug: webrtc:351644568
Change-Id: I73265d5258d681926eb5b65e32c2a61b26c310ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360842
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42995}
SvcRateAllocator assumed no temporal layering for screencast content and allocated all bitrate to base temporal layer. Now it distributes bitrate to spatial and temporal layers (if configured) no matter of content type.
Bug: webrtc:351644568, b/364190191
Change-Id: I445f0157d2c14cad033648693dc0564ae97023e9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362080
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42979}
This allows to utilize libvpx optimizations considerably improving performance.
The change happens inside libvpx_vp9_encoder and is invisible to other parts of webrtc.
This CL includes unit tests, an E2E test already exists: StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.Simulcast/VP9 in peerconnection_unittests.
Bug: webrtc:347737882
Change-Id: I03bc27c920787a7305a9775e6341e26904592fb8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360280
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42931}
Delegate control over number of times to encoder using AV1E_SET_AUTO_TILES that was added in https://aomedia-review.googlesource.com/c/aom/+/191102.
Bug: webrtc:351644568
Change-Id: I87ed11734e907c7f6c6508ac7389c84ececf5b21
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361140
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42903}
Based on the results of the experiment (b/335129329).
Bug: webrtc:15827, b/320629637, b/335129329, chromium:329396373
Change-Id: I1599f4c1be79ee3385aac1ff345168982c8278f8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360960
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Auto-Submit: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42895}
This is needed in order to create corruptions (by altering the filter loop params) to test the corruption detection algorithm.
Bug: webrtc:358039777
Change-Id: Ib26e9c0187b79c13b9862898625742def4091b91
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360780
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emil Vardar (xWF) <vardar@google.com>
Cr-Commit-Position: refs/heads/main@{#42890}
The current solution does not work for GFD since GFD is only parsed from the first packet of the frame. As a result, to access the generic information, we have to check every packet when traversing the packet buffer to find the first packet of frame. This fix is necessary to ensure temporal scaling works correctly with GFD.
Bug: webrtc:42225186
Change-Id: Iadda4ec690deab62c32eb6101583e6a6d75cfeaf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/344840
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42836}
Current version of the dav1d decoder does not propagate any QP value to the Decoded callback. This CL updates this such that the base QP gets propagated from the frame header.
Bug: None
Change-Id: Ib7624b7e27d2c973f1821df5688cbb444e4847a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359740
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emil Vardar (xWF) <vardar@google.com>
Cr-Commit-Position: refs/heads/main@{#42790}
e.g all files in the api/test folder not including subdirectories
Bug: webrtc:42226242
Change-Id: I18d74a18f8feec41eb252faa9acfffd1d6f45ce4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359420
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Dor Hen <dorhen@meta.com>
Cr-Commit-Position: refs/heads/main@{#42773}
Libvpx was adjusted to support scenarios test verifies, but WebRTC tests were forgotten.
Bug: webrtc:42223649
Change-Id: I19a10c939d844d00dd564bc0a16fe21844cc7cfb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357680
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42665}
Currently this class assumed that if the same RTP sequence number is unwrapped again result would be the same.
That might not be true when several packets were inserted in between these two calls and unwrapper changed its state
This CL propose instead to unwrap once, and save the result in the intermediate struct.
To minimize the change and the risk, only redundant unwrapping is replaced to use unwrapped sequence number
Bug: webrtc:353565743
Change-Id: I8a18c8c206a0e16010951cabcf81dd9cb1588eda
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357660
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42662}
In preparation for upcoming changes in GetSimulcastConfig(), which will require a vector of stream resolutions instead of just the max resolution as an input, switch tests to use CreateEncoderStreams() instead of calling GetSimulcastConfig() directly.
Bug: webrtc:351644568, b/352504711
Change-Id: I541dd54a21a8b75028cff07a250f858a47898223
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357400
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42648}
This is a cleanup of simulcast.cc. max_qp is not needed to decide simulcast config. Move setting of max QP in VideoStream one level up, to EncoderStreamFactory::CreateEncoderStreams(), where it can be set per stream.
Bug: webrtc:351644568, b/352504711
Change-Id: Ia0e3e9d90032383574dc8867b30d362e9c5df7e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357102
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42634}
This is a cleanup of simulcast.cc. bitrate_priority is not needed to decide simulcast config. Move setting of bitrate priority in VideoStream one level up, to EncoderStreamFactory::CreateEncoderStreams().
Bug: webrtc:351644568
Change-Id: I002d728ccf8d141fe4bbb32b390129ce57c830cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357101
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42629}
Current thresholds were tuned to guarantee no buffer overshoot in an extreme scenario (encoding a high complexity video in a low bitrate).
Bug: b/337757868, webrtc:351644568
Change-Id: I832b2564af6f18f06550338cc9b3618f8acdf831
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356580
Reviewed-by: Dan Tan <dwtan@google.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42620}
* Simplified ctor. Get settings (max_qp, content_type, etc) from encoder_config passed to CreateEncoderStreams().
* Some tests assigned VideoEncoderConfig::video_stream_factory to EncoderStreamFactory they created. That's not really needed. VideoStreamEncoder creates the factory if video_stream_factory is not provided [1]. Removed video_stream_factory initialization in tests.
[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/video_stream_encoder.cc;l=1002;drc=1d7d0e6e2c5002815853be251ce43fe88779ac85
Bug: b/347150850, webrtc:42233936
Change-Id: Ie0322abb6c48e1a9bd10e9ed3879e3ed484fea5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355321
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42608}
For better consistency with the rest codebase (it is min_/max_ for all params in video_encoder.h; only qp is for some reason prefixed with minimum_).
Also fixed constant names in libaom AV1 encoder wrapper (moved min from suffix to prefix, minimum -> min_).
Bug: chromium:328598314
Change-Id: I6d8521a3abff3a0595a5241c02ef4746eb4694df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356600
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42604}
Before this change the AV1 encoder wrapper converted target frame rate from double to integer with rounding to the middle. That approach resulted in a bitrate mismatch caused by rounding error. The mismatch was especially high at low frame rates. For example, at target frame rate 1.4fps the bitrate mismatch reached 40%:
out/debug/video_codec_perf_tests --gtest_also_run_disabled_tests --gtest_filter=*EncodeDecode --framerate_fps=1.4 --width=320 --height=180 --bitrate_kbps=32 --num_frames=600
...
RESULT s0t0_bitrate_mismatch_pct: DISABLED_EncodeDecode= {39.171875,0} n%
After the change the mismatch reduced to ~2% in the same scenario:
RESULT s0t0_bitrate_mismatch_pct: DISABLED_EncodeDecode= {-2.178125,0} n%
Bug: b/337757868
Change-Id: Ia51f92b3dfdce103eed1d04cac0e084b69fa8213
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356500
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42601}
If traffic policing is enforced by dropping packets, RTT can still be low.
If a packet is dropped that is needed to contninue decoding, it make sense that a nack request is sent until the packet is received, or a new key frame is requested. A key frame will be requested after 3s.
For now, this cl only increase the number of times a packet can be requested.
Bug: b/317178411
Change-Id: Iea75d36ed06f346af1dd4e55a9961d5eca45f519
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356482
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42594}
Bitrate limits should have been applied to the spatial layers in ApplySpatialLayerBitrateLimits (and usage is restricted to a single active stream/layer).
Bug: b/299588022
Change-Id: Iaae4ece28b8a95eea7d4bacba292847ba5b4000b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355841
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42588}
Some dependencies still exist but are a bit more complex to remove.
This CL removes either unused or easily replaced with ToString()
instances of ostream usage. In one case, moving the operator<<
implementation to the one test file that requires it.
Bug: webrtc:8982
Change-Id: Ia5c840b12a42893494af401317a3daf2fe50ba9b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356240
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42582}