Commit graph

177 commits

Author SHA1 Message Date
Evan Shrubsole
b556b08668 Allow encoders to receive preferred pixel formats from native buffers
Adds a field to EncoderInfo called preferred_pixel_formats which a
software encoder populates with the pixel formats it supports. When a
kNative frame is received for encoding, the VideoStreamEncoder will
first try to get a frame that is accessible by the software encoder in
that pixel format from the kNative frame. If this fails it will fallback
to converting the frame using ToI420.

This minimizes the number of conversions made in the case that the
encoder supports the pixel format of the native buffer or where
conversion can be accelerated. For example, in Chromium, the capturer can
emit an NV12 frame, which can be consumed by libvpx which supports NV12.

Testing: Tested in Chrome with media::VideoFrame adapters.

Bug: webrtc:11977
Change-Id: I9becc4100136b0c0128f4fa06dedf9ee4dc62f37
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187121
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#32353}
2020-10-08 13:47:50 +00:00
Erik Språng
e3c436b16a Adds field trial to set per-layer speed for libvpx vp9.
The trial name WebRTC-VP9-PerLayerSpeed is used to
a) set encoding speed per spatial layer, based on resolution
b) allow explicitly overriding speed per layer, for testing

Additionally, this CL updates the vp9 wrapper in preparation for
injectable trials.

Bug: webrtc:11551, webrtc:11926
Change-Id: I2bb3a664feaef60483ffc241b71070284d3e0172
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186400
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32294}
2020-10-02 14:04:08 +00:00
Evan Shrubsole
c082eba758 When reconfiguring VP9 restore previous input pixel format
Otherwise if the pixel format is not I420, the image buffer will
need to be reallocated on each reconfiguration.

Bug: webrtc:11974
Change-Id: Ib13f1865d7dbba4635f57dc09c7bff846e127585
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186340
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#32281}
2020-10-01 17:03:15 +00:00
Erik Språng
b3d539ef25 Sets VP9 buffer size and speed based on highest active spatial layer.
Before this change the allocated buffer and encoder complexity was set
based on the highest resolution configured regardless if that spatial
layer was active or not.

This should reduce memory pressure and improve visual quality when only
a low resolution is requested. In test, increasing the encoder
complexity has paradoxically also resulted in increased decoder speed.

Bug: webrtc:11551
Change-Id: I3ae47a5856de82ff7d40fddfcb160935b12b1d2b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186301
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32280}
2020-10-01 17:02:13 +00:00
Ilya Nikolaevskiy
b6f002b55f Add NV12 to libvpx wrappers output
Bug: webrtc:11956
Change-Id: Id8734b8f0fd87ac9b849d70b0c5764bf1ffd9c75
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185300
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32225}
2020-09-29 10:26:20 +00:00
Evan Shrubsole
7899e972b6 Accept NV12 frames into VP9
NV12 frames can be encoded by libvpx now, and this change allows for
encoding of them with VP9.

VP9 encode/decode tests now run with NV12 as well as I420.

Manually tested using video loopback with VP9 and NV12 generated frames.
  out/Default/video_loopback.app/Contents/MacOS/video_loopback --clip=GeneratorNV12 --codec="VP9"


Bug: webrtc:11635, webrtc:11974
Change-Id: Ifc5cbf77d2a27821cd5560c253d5d447c7a7cf53
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185123
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#32220}
2020-09-29 07:54:40 +00:00
Niels Möller
d60e32a953 Demote method EncodedImage::capacity() to private.
Bug: webrtc:9378
Change-Id: I83be267334fc778aff4eb2ad128d3ed693f755ff
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185007
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32177}
2020-09-23 13:53:31 +00:00
Danil Chapovalov
2549f174b5 Remove RTPFragmentationHeader creation and propagation through webrtc
Bug: webrtc:6471
Change-Id: I5cb1e10088aaecb5981888082b87ae9957bbaaef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181541
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31955}
2020-08-17 16:37:33 +00:00
Ilya Nikolaevskiy
7a82467d0d Fix vp9 svc singlecast mode and enable quality scaler for vp9
1) Fix several typos and small mistakes which could lead to crashes
2) Adjust bitrates if leading layers are disabled
3) Wire up webrtc quality scaler

Bug: webrtc:11319
Change-Id: I16e52bdb1c315d64906288e4f2be55fe698d5ceb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177525
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31546}
2020-06-18 21:24:46 +00:00
Zhaoliang Ma
c5c878b8ab vp9_impl: Enable VP9D_SET_LOOP_FILTER_OPT for libvpx vp9 decoder
enable this opt can give 20% performance improvement for video
decoding with 720P video loopback and fake camera on chromebook sarien.

Bug: None
Test: ./modules_tests on chromebook sarien
Change-Id: I8c6487b291b5861e6ba6b6d55b24d7ddb51c341e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177335
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31543}
2020-06-18 08:32:40 +00:00
Erik Språng
969ccf0e12 Reland "VP9 decoder: Sets thread count based on resolution, reinit on change."
This is a reland of d592575698

Patchset 2 is a reland of
https://webrtc-review.googlesource.com/c/src/+/177012

Patchset 3 is a fix for a potential crash when InitDecode()is called from
VideoStreamDecoderImpl::GetDecoder(), where the decoder_settings
parameter is a but surprisingly set to nullptr.

Original change's description:
> VP9 decoder: Sets thread count based on resolution, reinit on change.
>
> Previously, number of decoder threads for VP9 were always set to 8 but
> with a cap at number of cores. This was done since we "can't know" the
> resolution that will be used.
>
> With this change, we now intialize the number of threads based on
> resolution given in InitDecode(). If a resolution change happens in
> flight, it requires a keyframe. We therefore parse the header from
> any key frame and if it has a new resolution, we re-initialize the
> decoder.
>
> The number of threads used is based on pixel count. We set one thread
> as target for 1280x720, and scale up lineraly from there. The 8-thread
> cap is gone, but still limit it core count.
>
> This means for instance: 1 <= 720p, 2 for 1080p, 4 for 1440p, 9 for 4K.
>
> Bug: webrtc:11551
> Change-Id: I14c169a6c651c50bd1b870c4b22bc4495c8448fd
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174460
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31507}

Bug: webrtc:11551
Change-Id: I2b4b146d0b8319f07ce1660202d6aa4b374eb015
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177246
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31527}
2020-06-15 19:14:52 +00:00
Erik Språng
ef377ec6d5 Revert "VP9 decoder: Sets thread count based on resolution, reinit on change."
This reverts commit d592575698.

Reason for revert: May cause crashes.

Original change's description:
> VP9 decoder: Sets thread count based on resolution, reinit on change.
> 
> Previously, number of decoder threads for VP9 were always set to 8 but
> with a cap at number of cores. This was done since we "can't know" the
> resolution that will be used.
> 
> With this change, we now intialize the number of threads based on
> resolution given in InitDecode(). If a resolution change happens in
> flight, it requires a keyframe. We therefore parse the header from
> any key frame and if it has a new resolution, we re-initialize the
> decoder.
> 
> The number of threads used is based on pixel count. We set one thread
> as target for 1280x720, and scale up lineraly from there. The 8-thread
> cap is gone, but still limit it core count.
> 
> This means for instance: 1 <= 720p, 2 for 1080p, 4 for 1440p, 9 for 4K.
> 
> Bug: webrtc:11551
> Change-Id: I14c169a6c651c50bd1b870c4b22bc4495c8448fd
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174460
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31507}

TBR=ilnik@webrtc.org,sprang@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:11551
Change-Id: Id235c8ded83b3e1fc1d132c8f56c9f20001f6f22
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177242
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31521}
2020-06-15 10:11:09 +00:00
Erik Språng
aa5c1e8fd2 Revert "Adjusts allowable thread count for vp9 decoders."
This reverts commit 26e5046951.

Reason for revert: Part of change that may cause crashes.

Original change's description:
> Adjusts allowable thread count for vp9 decoders.
> 
> Set 2 thread as target for 1280x720 pixel count, and then scale up
> linearly from there - but cap at physical core count.
> For common resolutions this results in:
> 1 for 360p
> 2 for 720p
> 4 for 1080p
> 8 for 1440p
> 18 for 4K
> 
> Bug: webrtc:11551
> Change-Id: I666bd971eccddee096749f20d3b08eb40fe868ad
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177012
> Reviewed-by: Johannes Kron <kron@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31513}

TBR=sprang@webrtc.org,kron@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:11551
Change-Id: I4ea5166efeed3d55255a0243a69deb584a0e19e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177240
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31517}
2020-06-15 08:38:54 +00:00
Erik Språng
26e5046951 Adjusts allowable thread count for vp9 decoders.
Set 2 thread as target for 1280x720 pixel count, and then scale up
linearly from there - but cap at physical core count.
For common resolutions this results in:
1 for 360p
2 for 720p
4 for 1080p
8 for 1440p
18 for 4K

Bug: webrtc:11551
Change-Id: I666bd971eccddee096749f20d3b08eb40fe868ad
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177012
Reviewed-by: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31513}
2020-06-12 13:52:19 +00:00
Johannes Kron
7ff6355b88 Add decoder support for VP9 profile 1 I444
libvpx already supports VP9 profile 1. Add code to enable SDP negotiation of receiving VP9 profile 1.

Bug: webrtc:11555
Change-Id: I35d12d159a1414aac744f202331d3a9c4a84f5af
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176322
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31509}
2020-06-12 05:17:24 +00:00
Erik Språng
d592575698 VP9 decoder: Sets thread count based on resolution, reinit on change.
Previously, number of decoder threads for VP9 were always set to 8 but
with a cap at number of cores. This was done since we "can't know" the
resolution that will be used.

With this change, we now intialize the number of threads based on
resolution given in InitDecode(). If a resolution change happens in
flight, it requires a keyframe. We therefore parse the header from
any key frame and if it has a new resolution, we re-initialize the
decoder.

The number of threads used is based on pixel count. We set one thread
as target for 1280x720, and scale up lineraly from there. The 8-thread
cap is gone, but still limit it core count.

This means for instance: 1 <= 720p, 2 for 1080p, 4 for 1440p, 9 for 4K.

Bug: webrtc:11551
Change-Id: I14c169a6c651c50bd1b870c4b22bc4495c8448fd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174460
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31507}
2020-06-11 17:43:27 +00:00
Ilya Nikolaevskiy
989229d6fc [VP9 SVC] Cleanup external reference control workaround
Bug: chromium:1027108,webrtc:11319
Change-Id: I4d8bb0858204fa4f911e954e32d51537291db5e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175139
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31485}
2020-06-10 12:02:50 +00:00
Ilya Nikolaevskiy
1fb4a05e9e Reland "Launch external ref control for vp9 encoder"
This reverts commit 9665b7d101.

Reason for revert: Fixes are in the PS#2

Original change's description:
> Revert "Launch external ref control for vp9 encoder"
> 
> This reverts commit 9427b51d6f.
> 
> Reason for revert: Breaks downstream tests
> 
> Original change's description:
> > Launch external ref control for vp9 encoder
> > 
> > Change field trial condition to killswitch instead.
> > 
> > Finch trial is going to 100% public today.
> > 
> > Bug: chromium:1027108,webrtc:11319
> > Change-Id: I29494a7c8515a454706983dd15ae444d3f85271f
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173752
> > Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> > Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#31122}
> 
> TBR=ilnik@webrtc.org,ssilkin@webrtc.org
> 
> Change-Id: I44436febb2b646cdd350fa9afee1c3a7ea307d04
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:1027108, webrtc:11319
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173761
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31123}

TBR=ilnik@webrtc.org,ssilkin@webrtc.org

Change-Id: I8aed0edca2015297da512aa084515812103c6f48
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1027108, webrtc:11319
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173780
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31125}
2020-04-23 13:21:45 +00:00
Ilya Nikolaevskiy
9665b7d101 Revert "Launch external ref control for vp9 encoder"
This reverts commit 9427b51d6f.

Reason for revert: Breaks downstream tests

Original change's description:
> Launch external ref control for vp9 encoder
> 
> Change field trial condition to killswitch instead.
> 
> Finch trial is going to 100% public today.
> 
> Bug: chromium:1027108,webrtc:11319
> Change-Id: I29494a7c8515a454706983dd15ae444d3f85271f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173752
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31122}

TBR=ilnik@webrtc.org,ssilkin@webrtc.org

Change-Id: I44436febb2b646cdd350fa9afee1c3a7ea307d04
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1027108, webrtc:11319
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173761
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31123}
2020-04-23 09:25:19 +00:00
Ilya Nikolaevskiy
9427b51d6f Launch external ref control for vp9 encoder
Change field trial condition to killswitch instead.

Finch trial is going to 100% public today.

Bug: chromium:1027108,webrtc:11319
Change-Id: I29494a7c8515a454706983dd15ae444d3f85271f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173752
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31122}
2020-04-23 09:03:06 +00:00
Ilya Nikolaevskiy
9ce77fda75 Remove redundant Dcheck in vp9 decoder
Bug: chromium:1070146
Change-Id: Ia4a07cfd16c154e2be3478c020c01fbcaf1c5bb0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173743
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31119}
2020-04-22 09:06:26 +00:00
Erik Språng
c8fbd899bd Fixes temporal rate allocation issues.
This CL fixes a few issues where the reported fraction of frames
allocated to various temporal layers could be incorrect:
* In LibvpxVp8Encoder, calling GetEncoderInfo() while not initialized,
  or when first configuring with temporal layers and then without,
  could trigger incorrect fps allocations.
* In VP9 when different spatial layers have different max framerates,
  the layer fps should be compared to the layer with the highest
  configured fps, not codec_.maxFramerate which is updated to the
  current input fps on SetRates().
* In EncoderBitrateAdjuster, just warn and ignore if a layer has
  non-zero bps but zero fps, rather than passing down the chain and
  risk weird behavior or divide by zero.

Bug: b/152040235
Change-Id: I548fb3e099b1ec9f536a7b93313fb40c4d32e596
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171516
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30880}
2020-03-25 11:20:47 +00:00
Ilya Nikolaevskiy
8d1f72852e [VP9 decoder] react to incorrect pixel format in the bitstream
Bug: chromium:1063490
Change-Id: Ibac3b43b42c1b088b6ac94ae327f23b11d3fd259
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171225
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30855}
2020-03-23 11:29:08 +00:00
Jerome Jiang
4a06666325 Only set vp9 config when it's changed.
~3-5% speed up on webrtc_perf_tests of vp9 on linux desktop.

Avoid going thru a lot of unnecessary code checks.

Change-Id: I2cb0d794bcf239c5057dfc04cd07a496f89a5016
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167640
Commit-Queue: Jerome Jiang <jianj@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30586}
2020-02-21 20:09:31 +00:00
Ilya Nikolaevskiy
1dea1ea412 [VP9 encoder] Set temporal id also on disabled spatial layers
Bug: chromium:1051476
Change-Id: Iaf2b6ab6640cd314a620dbdf1547d8f1b2f40693
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168921
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30581}
2020-02-21 12:03:09 +00:00
Ilya Nikolaevskiy
f5d877847f Reland "[VP9] Shift spatial layers on RTP level to always start from 0."
This reverts commit 2181228624.

Reason for revert: Reland without changes as it's not the root cause.

Original change's description:
> Revert "[VP9] Shift spatial layers on RTP level to always start from 0."
> 
> This reverts commit 2e73a3d1e9.
> 
> Reason for revert: Fuzzer found some issues.
> 
> Original change's description:
> > [VP9] Shift spatial layers on RTP level to always start from 0.
> > 
> > This CL uses |width| and |height| in RTPVideoHeaderVP9 to pass information
> > about enabled layers from encoder to packetizer.
> > 
> > Bug: webrtc:11319
> > Change-Id: Idc1c337f8dfb3f7631506acb784d2a634b41b955
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167724
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#30428}
> 
> TBR=danilchap@webrtc.org,ilnik@webrtc.org,nisse@webrtc.org
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: webrtc:11319
> Change-Id: I27a7e82737fa604b8ab769ce6503fa93e46f4e86
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168123
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30448}

TBR=danilchap@webrtc.org,ilnik@webrtc.org,nisse@webrtc.org

Change-Id: Ibcd9b6a075ee08c9402de8b0b9d99d77bf59d0ef
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11319
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168185
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30450}
2020-02-04 10:06:44 +00:00
Ilya Nikolaevskiy
2181228624 Revert "[VP9] Shift spatial layers on RTP level to always start from 0."
This reverts commit 2e73a3d1e9.

Reason for revert: Fuzzer found some issues.

Original change's description:
> [VP9] Shift spatial layers on RTP level to always start from 0.
> 
> This CL uses |width| and |height| in RTPVideoHeaderVP9 to pass information
> about enabled layers from encoder to packetizer.
> 
> Bug: webrtc:11319
> Change-Id: Idc1c337f8dfb3f7631506acb784d2a634b41b955
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167724
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30428}

TBR=danilchap@webrtc.org,ilnik@webrtc.org,nisse@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:11319
Change-Id: I27a7e82737fa604b8ab769ce6503fa93e46f4e86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168123
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30448}
2020-02-03 14:15:44 +00:00
Ilya Nikolaevskiy
2e73a3d1e9 [VP9] Shift spatial layers on RTP level to always start from 0.
This CL uses |width| and |height| in RTPVideoHeaderVP9 to pass information
about enabled layers from encoder to packetizer.

Bug: webrtc:11319
Change-Id: Idc1c337f8dfb3f7631506acb784d2a634b41b955
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167724
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30428}
2020-01-30 16:07:32 +00:00
Jerome Jiang
740ed473dc Add 444 support for vp9 decoder wrapper.
Chromting is trying vp9 444 to have better color. This fix is needed to decode 444 properly.

Bug: webrtc:11326
Change-Id: I4498930591d8876af9f6b7238a8c9fe450ecbfcc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166220
Commit-Queue: Jerome Jiang <jianj@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30410}
2020-01-29 16:32:10 +00:00
Jonas Olsson
b2b2031457 Concatenate string literals at compile time.
This CL was generated by running:
git ls-files | grep ".cc" | xargs perl -i -ne 'BEGIN {undef $/}; s/("[\s\n]*<<[\s\n]*")/" "/g; print;'; git cl format

After that I manually edited modules/audio_processing/gain_controller2.cc to preserve its original
formatting.

This primary benefit of this change is a small reduction in binary size.

Bug: None
Change-Id: I689fa7ba9c717c314bb167e5d592c3c4e0871e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165961
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30251}
2020-01-14 14:47:48 +00:00
Artem Titov
8525a8028a Add ability to resize buffers pool in decoder and use it in IVF generator
Bug: webrtc:10138
Change-Id: I452f08f1d9af57de789bd947a1fcb95536845f80
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162183
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30098}
2019-12-16 14:51:16 +00:00
Ilya Nikolaevskiy
5f2fc41fb5 VP9 decoder: replace DCHECK with error message
Bug: chromium:1016160
Change-Id: I0ef0db2b254829e7c0dff24b7a8da3a4056547ac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157890
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29567}
2019-10-22 09:54:19 +00:00
Kuang-che Wu
f17976d019 Use single thread vp9 decoder for fuzzing
Single thread vp9 decoder is more fuzzer friendly.

Bug: chromium:1009073
Change-Id: I7f98680f1ce227126a62a1beccd8a283c9423aa6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156361
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Kuang-che Wu <kcwu@google.com>
Cr-Commit-Position: refs/heads/master@{#29435}
2019-10-10 13:49:40 +00:00
Niels Möller
2449d7aa78 Refactor legacy FrameBuffer to use EncodedImageBuffer::Realloc
Preparation for deleting VCMEncodedFrame::VerifyAndAllocate and
EncodedImage::Allocate.

Bug: webrtc:9378
Change-Id: If7c16061962bbd58c3e7d5720189854e00a3d7bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154570
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29339}
2019-09-30 09:48:26 +00:00
Ilya Nikolaevskiy
bc8049ef0b Reland "VP9 encoder: handle disabled layers correctly"
Now vp9 screenshare would enable new layers as soon as requested and will force all spatial layers present on the next frame, even if they should be dropped because of frame-rate limiting.

This might cause frame-rate liming to be exceeded if layer is toggling on and off very often, but this situation is bad itself. E.g. in realtime video it will cause too many key-frames.

Now SvcRateAllocator and VP9EncoderImpl are aware that there may be some skipped layers before the first enabled. Key-frames and ss_info triggering logic is also updated.

(This is a reland without changes after updates to downstream projects)
Original-Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153483

Bug: webrtc:10977
Change-Id: I02459c5982da2e0542a837514f5753c5f96401c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154355
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29330}
2019-09-27 09:28:38 +00:00
Ilya Nikolaevskiy
90d6efbd4e Revert "VP9 encoder: handle disabled layers correctly"
This reverts commit 88fe84b7fb.

Reason for revert: Downstream project isn't updated to the latest libvpx roll yet, thus some tests are broken.

Original change's description:
> VP9 encoder: handle disabled layers correctly
> 
> Now vp9 screenshare would enable new layers as soon as requested and will
> force all spatial layers present on the next frame, even if they should be
> dropped because of frame-rate limiting.
> 
> This might cause frame-rate liming to be exceeded if layer is toggling on
> and off very often, but this situation is bad itself. E.g. in realtime video
> it will cause too many key-frames.
> 
> Now SvcRateAllocator and VP9EncoderImpl are aware that there may be some skipped
> layers before the first enabled. Key-frames and ss_info triggering logic is also
> updated.
> 
> Bug: webrtc:10977
> Change-Id: Ie2555210c0368a1d3c51ddf6670d0052e6d679de
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153483
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29296}

TBR=ilnik@webrtc.org,ssilkin@webrtc.org

Change-Id: If33886a5f8a0c3b33168dcadfe45c11a6f4387c1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10977
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154354
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29299}
2019-09-25 09:06:59 +00:00
Ilya Nikolaevskiy
88fe84b7fb VP9 encoder: handle disabled layers correctly
Now vp9 screenshare would enable new layers as soon as requested and will
force all spatial layers present on the next frame, even if they should be
dropped because of frame-rate limiting.

This might cause frame-rate liming to be exceeded if layer is toggling on
and off very often, but this situation is bad itself. E.g. in realtime video
it will cause too many key-frames.

Now SvcRateAllocator and VP9EncoderImpl are aware that there may be some skipped
layers before the first enabled. Key-frames and ss_info triggering logic is also
updated.

Bug: webrtc:10977
Change-Id: Ie2555210c0368a1d3c51ddf6670d0052e6d679de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153483
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29296}
2019-09-25 08:42:19 +00:00
Ilya Nikolaevskiy
1af0f908c8 VP9 screenshare: use CONSTRAINED_FROM_ABOVE_DROP mode
This mode was added by libvpx team specificaly for this usecase: if a
layer is dropped, all lower layers have to be dropped also.

This ensures that higher layers always have higher framerate than the
lower layers and stream is RTP compatible.

This CL also renames full_superframe_drop_ to !layer_buffering, as it
closer reflects the purpose of that flag (in screenshare mode, no
buffering is needed, because the highest layer is always present in the
superframe, yet, it's not a full-superframe dropping mode).

Bug: webrtc:10257
Change-Id: I2589bfd2b9b63de0e410f277a716276234993843
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151764
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29155}
2019-09-11 11:21:39 +00:00
Ilya Nikolaevskiy
30323e2fb2 VP9 screenshare: fix incorrect assumptions on buffer contents
if higher layer is enabled, then disabled, then key-frame is issued, then
the layer is enabled again, the buffer would contain a picture from before
the key-frame and it might have a higher pid than the currently encoded one.
This would trigger the DCHECK. It's safe to remove the DCHECK completely, because
such occasions would cause unsigned overflow and cause the following check for
maximum allowed picture difference to fail and the wrong picture won't
be used as a temporal reference.

This error only caused failures in debug builds and couldn't lead to corruptions
because there're periodical key-frames generated and pid difference can never become so
big that negative value would overflow to something close to 0.

Bug: webrtc:10257
Change-Id: Ie3b3ed0e24421787e3b40a37987ccecb75d04635
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151643
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29099}
2019-09-06 12:30:16 +00:00
Florent Castelli
8bbdb5b9bd Update VideoBitrateAllocator allocate to take a struct with more fields
We want to evaluate more data in order to make better choices in the
bitrate allocators.
In order to freely update the parameter list without
breaking the API many times for projects customizing them, we'll use a
struct instead.

Bug: webrtc:10126
Change-Id: I443f86781c5134950294cdd1e3197a47447cf973
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141418
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28748}
2019-08-02 13:52:54 +00:00
Ilya Nikolaevskiy
a0e2609a08 Partially revert of ColorSpace information copying around decoders
This partially reverts these 2 CLs:
1) Reland "Copy video frames metadata between encoded and plain frames in one place"
https://webrtc.googlesource.com/src/+/2ebf5239782bf6b46d4aa812f34fa9f9e5a02be9

2) Don't copy video frame metadata in each encoder/decoder
https://webrtc.googlesource.com/src/+/ab62b2ee51e622be6d0aade15e87e927fa60e6f2

The problem with them were that ColorSpace was made to always be copied from the
EncodedImage in the GenericDecoder, which overwrote ColorSpace information from
the decoder.

If decoder applied color space transition or bitstream color space information
was different from the WebRTC signaled one, the incorrect color space data were
passed to the renderer.

This CL removes introduced change regarding color space data: GenericDecoder
doesn't copy or store it and software decoders are restored to copy it.
Relevant tests are also removed.

Bug: chromium:982486
Change-Id: I989e01476ff7f7df376c05578ab8f540b95a1dd2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145323
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28556}
2019-07-12 11:27:07 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00
Sergey Silkin
5ee6967c4e Don't reset encoder on max/min bitrate change.
- Don't reset encoder if max/min bitrate changed.
- Removed min/max bitrate DCHECKs from encoder wrappers.
- Reset encoder if start_bitrate changed. Only do this if encoding
  has not yet started.
- Updated ReconfigureBitratesSetsEncoderBitratesCorrectly test.
- Removed EncoderSetupPropagatesCommonEncoderConfigValues test since it
was a subset of ReconfigureBitratesSetsEncoderBitratesCorrectly.

Bug: webrtc:10773
Change-Id: Id9cbb2ea229232fd95967819e2a937b26948de9f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144028
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28446}
2019-07-02 12:52:55 +00:00
Elad Alon
8f01c4e1b6 Define FecControllerOverride and plumb it down to VideoEncoder
The purpose of this interface is to allow VideoEncoder to override
the bandwidth allocation set by FecController in RtpVideoSender.

This CL defines the interface and sends it down to VideoSender.
Two upcoming CLs will:
1. Make LibvpxVp8Encoder pass it on to the (injectable)
   FrameBufferController, where it might be put to good use.
2. Modify RtpVideoSender to respond to the message sent to it
   via this API.

TBR=kwiberg@webrtc.org

Bug: webrtc:10769
Change-Id: I2ef82f0ddcde7fd078e32d8aabf6efe43e0f7f8a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/143962
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28416}
2019-06-28 15:57:22 +00:00
Niels Möller
4d504c76cb New interface EncodedImageBufferInterface, replacing use of CopyOnWriteBuffer
Bug: webrtc:9378
Change-Id: I62b7adbd9dd539c545b5b1b1520721482a4623c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138820
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28317}
2019-06-19 07:02:34 +00:00
Elad Alon
370f93a34a Reland "Inform VideoEncoder of negotiated capabilities"
This is a reland of 11dfff0878

Now that I am sure that WebRTC code is not calling the obsolete
versions, I will just remove the NOT_REACHED and call the
new version from the old ones, so as not to trip up downstream
projects.

Original change's description:
> Inform VideoEncoder of negotiated capabilities
>
> After this CL lands, an announcement will be made to
> discuss-webrtc about the deprecation of one version
> of InitEncode().
>
> Bug: webrtc:10720
> Change-Id: Ib992af0272bbb16ae16ef7e69491f365702d179e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140884
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Elad Alon <eladalon@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28224}

TBR=sakal@webrtc.org,kwiberg@webrtc.org,sprang@webrtc.org

Bug: webrtc:10720
Change-Id: I46c69e45c190805c07f7e51acbe277d7eebd1600
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141412
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28236}
2019-06-11 14:49:37 +00:00
Philip Eliasson
49d661a7d3 Revert "Inform VideoEncoder of negotiated capabilities"
This reverts commit 11dfff0878.

Reason for revert: Downstream import failure.

Original change's description:
> Inform VideoEncoder of negotiated capabilities
> 
> After this CL lands, an announcement will be made to
> discuss-webrtc about the deprecation of one version
> of InitEncode().
> 
> Bug: webrtc:10720
> Change-Id: Ib992af0272bbb16ae16ef7e69491f365702d179e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140884
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Elad Alon <eladalon@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28224}

TBR=sakal@webrtc.org,kwiberg@webrtc.org,eladalon@webrtc.org,kthelgason@webrtc.org,sprang@webrtc.org

Change-Id: I7f833055c67f1f879b01dd8c156ba7b8840e8747
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10720
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141411
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28225}
2019-06-11 11:56:04 +00:00
Elad Alon
11dfff0878 Inform VideoEncoder of negotiated capabilities
After this CL lands, an announcement will be made to
discuss-webrtc about the deprecation of one version
of InitEncode().

Bug: webrtc:10720
Change-Id: Ib992af0272bbb16ae16ef7e69491f365702d179e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140884
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28224}
2019-06-11 11:32:13 +00:00
Ilya Nikolaevskiy
ab62b2ee51 Don't copy video frame metadata in each encoder/decoder
As this is handled higher up the pipeline in a single
place for all encoders/decoders

Bug: webrtc:10460
Change-Id: I95b0a69aecaf07283c8776ac0d7e85d097e3576b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/139882
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28172}
2019-06-05 15:33:49 +00:00
Ilya Nikolaevskiy
039a7146ab VP9 screenshare: drop base layer separately
Because of a low bitrate target, base layer has drops much more frequently
than other layers. But it reduces overall framerate, especially then
input framerate is low (5 fps).

This CL allows pre-layer drops and disables droppoing on higher spatial
layers for screenshare, solving the issue.
Additional care have to be taken then new spatial layers are enabled
dynamically to not create non-compatible with RTP references.

Bug: webrtc:10257
Change-Id: Ie056484c99a3f35ff4405ef71337dc2d034db8bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138262
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28063}
2019-05-24 15:28:02 +00:00