This is a followup to cl https://webrtc-review.googlesource.com/71380,
which reworked the way encoder resilience is done, and made the
nack_enabled flag unused.
Bug: webrtc:8830
Change-Id: I3de2508c97bc71e01c8f2232d16cd1f33e57fe4a
Reviewed-on: https://webrtc-review.googlesource.com/69986
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23080}
Fill drops with last decoded frame to make them look like freeze at
playback and to keep decoded spatial layers in sync.
Bug: none
Change-Id: I65f7c21100985c22932a1edd441b6c724833c11e
Reviewed-on: https://webrtc-review.googlesource.com/73685
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23076}
If frame of current layer was dropped, pass base frame to decoder if
non_ref_for_inter_layer_pred is set to true.
Bug: none
Change-Id: If7bf5220b74f424106edf74867c9afa8cc2b1ec5
Reviewed-on: https://webrtc-review.googlesource.com/73440
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23074}
This allows to control inter-layer prediction at encoding VP9 SVC.
There are three options:
1. Disabled.
2. Enabled for all pictures.
3. Enabled for key pictures, disabled for others.
Inter-layer prediction is enabled for all pictures by default.
Bug: none
Change-Id: I49fe43d8744c92bec349d815100ba158519f0664
Reviewed-on: https://webrtc-review.googlesource.com/71500
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23049}
For consistency with the VP9 RTP spec which uses term "picture" for set
of frames which belong to the same time instance.
Bug: none
Change-Id: I30e92d5debb008feb58f770b63fe10c2e0029267
Reviewed-on: https://webrtc-review.googlesource.com/72180
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23040}
This deletes the resilienceOn flag in VideoCodecVP8 and VideoCodecVP9.
Instead, the implementations of VP8 and VP9 set resilience mode
internally, based on the configuration of temporal and spatial layers.
The nack_enabled argument to VideoCodecInitializer::SetupCodec becomes
unused with this cl. In a followup, it will be deleted, together with
the corresponding argument to VideoStreamEncoder methods.
An applications which really wants to configure resilience differently
can do that by injecting an EncoderFactory with encoders behaving
as desired.
Bug: webrtc:8830
Change-Id: I9990faf07d3e95c0fb4a56fcc9a56c2005b4a6fa
Reviewed-on: https://webrtc-review.googlesource.com/71380
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23025}
The goal is to make these injectable, and only VP8 and VP9 specific
targets should depend on them.
Bug: webrtc:7925
Change-Id: Ie9239a54d197fe70c93de0582797211fef6997a2
Reviewed-on: https://webrtc-review.googlesource.com/72082
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23021}
Include dropped frames by the encoder in the frame drop percentage.
To react faster at low framerates:
- Use ExpFilter instead of MovingAverage to filter QP values.
- Reduce sampling interval while waiting for minimum number of needed frames (when not in fast rampup mode).
A separate slower ExpFilter is used for upscaling.
Bug: webrtc:9169
Change-Id: If7ff6c3bd4201fda2da67125889838fe96ce7061
Reviewed-on: https://webrtc-review.googlesource.com/70761
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23014}
This converts the reserved bit in VP9 RTP payload descriptor into the
flag which indicates whether current frame can be used for prediction
of next spatial layer or not.
VP9 encoder wrapper sets non_ref_for_inter_layer_pred=false for all
frames for now.
Bug: none
Change-Id: I32f68868686475905fb09173cffd2b6e1bedcb7c
Reviewed-on: https://webrtc-review.googlesource.com/71080
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23010}
Since the webrtc_common build target does not have visibility set, we
cannot easily use BitrateAllocation in other parts of Chromium.
This is currently blocking parts of chromium:794608, and I know of other
usage outside webrtc already, so moving it to api/ should be warranted.
Also, since there's some naming confusion and this class is video
specific rename it VideoBitrateAllocation. This also fits with the
standard interface for producing these: VideoBitrateAllocator.
Bug: chromium:794608
Change-Id: I4c0fae40f9365e860c605a76a4f67ecc9b9cf9fe
Reviewed-on: https://webrtc-review.googlesource.com/70783
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22986}
We only support on (formely kResilientStream) and off (formely
kResilienceOff). The third mode, kResilientFrames, was not
implemented.
Bug: None
Change-Id: Ida82f6a33eda9d943ea70bc8ae4e6bddb720b0e8
Reviewed-on: https://webrtc-review.googlesource.com/71481
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22984}
Only specially taggged targets may transitively depend on poisonous
targets. We first apply it to audio codecs.
This makes it much clearer exactly what parts of the code still have
dependencies on the audio codecs (and we want to eventually get rid of
pretty much all of them).
Bug: webrtc:8396, webrtc:9121
Change-Id: Iba5c2e806c702b5cfe881022674705f647896d43
Reviewed-on: https://webrtc-review.googlesource.com/69520
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22979}
This fixes misprint in the code which calculates target bitrate of a
VP9 spatial layer where "-" was used instead of "+".
Bug: none
Change-Id: I17d76a84d00e453c055c068968d7b276e9c23f51
Reviewed-on: https://webrtc-review.googlesource.com/71663
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22974}
Most are removed entirely, but RtcErrorType, RtpTransceiverDirection, IPAddress and
SocketAddress are kept behind gtest's #ifdef UNIT_TEST.
Bug: webrtc:8982
Change-Id: I36db19891e7d25aeacb08b9a08aa2b4004765e70
Reviewed-on: https://webrtc-review.googlesource.com/64143
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22916}
With rounding to the nearest the result can exceed the allocated
bitrate.
Bug: none
Change-Id: I0260a1640a1454951ca8e48fd447e047ef0271ee
Reviewed-on: https://webrtc-review.googlesource.com/69982
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22879}
This fixes inconsistency in names of variables and fields which
represent spatial/temporal index of layer:
simulcast_svc_idx -> spatial_idx
spatial_layer_idx -> spatial_idx
temporal_layer_idx -> temporal_idx
Also, this adds printing of spatial/temporal index and target bitrate
to RD report.
Bug: none
Change-Id: Ic4dfdadc57a1577bb3d35d1782a152a9dbef0280
Reviewed-on: https://webrtc-review.googlesource.com/69981
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22869}
Adding SVC rate allocator and layering configurator caused regression
for VP9 non-SVC senders. SVC bitrate limits, which were supposed to
be used only when spatial layering is enabled, are applied when
encoding single spatial layer. E.g. for VP9 360p sender maximum bitrate
is limited to 500kbps.
This fixes the regression. If sender is configured to send VP9 single
layer then codec's bitrate limits are applied to this layer.
Bug: webrtc:9151, chromium:831093
Change-Id: Ia1ae4087155ad7917a3443304a21532f1e68ea65
Reviewed-on: https://webrtc-review.googlesource.com/69813
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22862}
This makes it easier to add new test cases without modifying the actual test class.
Bug: None
Change-Id: I48e4f14e26cd6610678ffb07ce9fd56e6bc1ac4e
Reviewed-on: https://webrtc-review.googlesource.com/69600
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22840}
OnRatesUpdated() is called every time the bitrate estimate, or once per
second. However, since we don't want to reconfigure libvpx too often,
just in case it interferes with the rate controller, so
ScreenshareLayers contains a boolean |bitrate_update_| which indicate
if the configuration should be updated on a call to
UpdateConfiguration().
However, it two rate updates happened between two frames, the first of
which changes the rates and second one does not, |bitrate_update_| will
be reset to false and the encoder won't get the desired config.
This CL makes sure we update the configuration iff the rate has changed
at any time since the last call to UpdateConfiguration().
Bug: webrtc:9012
Change-Id: I62af36cffe20ecb7d3f403b3eb11f23a9692d719
Reviewed-on: https://webrtc-review.googlesource.com/69040
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22826}
Set the flag based on coded length of buffered frame which is reset
after picture is encoded and, thus, is equal to zero when encoder
delivers first frame of next picture.
Before this change first_frame_in_picture was set based on index of
spatial layer of encoded frame. This is not right anymore since encoder
can drop base layer but deliver upper layers.
Bug: chromium:828350
Change-Id: I12c7534240de8bc4905f04ff368cc3704720a70b
Reviewed-on: https://webrtc-review.googlesource.com/68561
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22805}
It takes some time for rate controller to adapt to content. Quality of first
frames is usually worse than quality of following frames. It makes sense to
exclude first frames from analysis and, thus, avoid negative affect of this
interval on overall results.
Bug: none
Change-Id: Ib0a258889750cf794c7d6fdff26af958f7bbe48a
Reviewed-on: https://webrtc-review.googlesource.com/66100
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22782}
more standard optional<T> inlines compares instead of converting second argument to T.
that leads to warnings about comparing unsigned to signed integers.
Bug: webrtc:9078
Change-Id: I43cc729d3b85d789b0c394064dc7e11dc27a37aa
Reviewed-on: https://webrtc-review.googlesource.com/66782
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22779}
The original cl broke some downstream project because some internal source
encoders do not call OnBitrateChanged on GenericEncoder.
Bug: webrtc:9058
Change-Id: I7841c65059fb4fc9e1ab9754bb1d232ce660a990
Reviewed-on: https://webrtc-review.googlesource.com/66342
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22733}
In order to handle per-layer frame dropping both VP9 encoder wrapper
and RTP packetizer were modified.
- Encoder wrapper buffers last encoded frame and passes it to
packetizer after frame of next layer is encoded or encoding of
superframe is finished.
- Encoder wrapper sets end_of_superframe flag on last encoded frame of
superframe before passing it to packetizer.
- If end_of_superframe is True then packetizer sets marker bit on last
packet of frame.
Bug: webrtc:9066
Change-Id: I1d45319fbe6bc63d01721ea67bfb7440d4c29275
Reviewed-on: https://webrtc-review.googlesource.com/65540
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22722}
Measure time spent in frame encode callback, accumulate it for layers
and subtract it from measured encode time of next layer frame.
Bug: none
Change-Id: Ifc3baae2f9a49913a55a7de2de9507102edd0295
Reviewed-on: https://webrtc-review.googlesource.com/65981
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22720}
This reverts commit 04dd176862.
Reason for revert: Regression in ramp up perf tests.
Original change's description:
> Reland "Move rtp-specific config out of EncoderSettings."
>
> This is a reland of bc900cb1d1
>
> Original change's description:
> > Move rtp-specific config out of EncoderSettings.
> >
> > In VideoSendStream::Config, move payload_name and payload_type from
> > EncoderSettings to Rtp.
> >
> > EncoderSettings now contains configuration for VideoStreamEncoder only,
> > and should perhaps be renamed in a follow up cl. It's no longer
> > passed as an argument to VideoCodecInitializer::SetupCodec.
> >
> > The latter then needs a different way to know the codec type,
> > which is provided by a new codec_type member in VideoEncoderConfig.
> >
> > Bug: webrtc:8830
> > Change-Id: Ifcc691aef1ee6a95e43c0452c5e630d92a511cd6
> > Reviewed-on: https://webrtc-review.googlesource.com/62062
> > Commit-Queue: Niels Moller <nisse@webrtc.org>
> > Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22532}
>
> Bug: webrtc:8830
> Change-Id: If88ef7d57cdaa4fae3c7b2a97ea5a6e1b833e019
> Reviewed-on: https://webrtc-review.googlesource.com/63721
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22595}
TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,stefan@webrtc.org
Bug: webrtc:8830,chromium:827080
Change-Id: Iaaf146de91ec5c0d741b8efdf143f7e173084fef
Reviewed-on: https://webrtc-review.googlesource.com/65520
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22677}