Commit graph

75 commits

Author SHA1 Message Date
Sergey Silkin
e7ce888abe Fix VP9 K-SVC full stack tests.
- Added field trial to force issuing of key frame on deactivation of
spatial layer. This fixes video corruptions in VP9 K-SVC tests where
layers can be activated/deactivated on-fly due to bandwidth change.

- Added 100ms network delay to the test with restricted link capacity.
This fixes rapid drop of available bandwidth which happens when
bandwidth overuse is detected in the very beginning of call and several
feedback packets arrive without any delay. Also, this makes the test
more realistic.

- Disabled filtering of spatial layer in the test with restricted
link capacity. 1) We don't really need filtering in this test.
2) It appeared that in video quality tests filtering is done before
sending packets to network simulator. Filtering of high layers causes
channel underuse which is compensated by increase of sent bitrate.
This is why we got sent/media bitrates about 2Mbps in test where link
was limited to 1Mbps.

Bug: chromium:889017
Change-Id: I33ffcee0274523f6183c3bbd27d3d29395417d52
Reviewed-on: https://webrtc-review.googlesource.com/c/103520
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24988}
2018-10-04 12:15:18 +00:00
Sergey Silkin
390f358344 Configure frame references in VP9 encoder wrapper.
Bug: webrtc:9585
Change-Id: I3f90d8f2b81556cfb5fa9123607ab0a9ade2bf3f
Reviewed-on: https://webrtc-review.googlesource.com/93469
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24915}
2018-10-01 20:02:46 +00:00
Sergey Silkin
b0bd03ba46 Set key frame request in VP9 enc wrapper on init.
Since libvpx VP9 enc always issues key frame after reinit.

Bug: none
Change-Id: I3349a38652af9085c35f8ac9d5b9d3e5549daab9
Reviewed-on: https://webrtc-review.googlesource.com/102660
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24912}
2018-10-01 15:19:09 +00:00
Sergey Silkin
c5f152daa0 Mark all low layer frames as references if inter-layer pred is enabled.
Mark all low spatial layer frames as references (not just frames of
active low spatial layers) if inter-layer prediction is enabled since
these frames are indirect references of high spatial layer, which can
later be enabled without key frame.

Bug: webrtc:9782
Change-Id: Iffa5039fab2673a5582e7cdc9be4a36d9e8deb63
Reviewed-on: https://webrtc-review.googlesource.com/102063
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24849}
2018-09-26 12:46:56 +00:00
Sergey Silkin
f87bb46306 Restrict use of frame rate controller.
VP9 frame rate controller is supposed to be used in screen mode only
but it was partially enabled in normal video mode. This restricts use
of VP9 frame rate controller to screen mode.

Bug: chromium:884164
Change-Id: Ie2eaa31f3364a8abccbc4171007708cf7040fc38
Reviewed-on: https://webrtc-review.googlesource.com/100424
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24769}
2018-09-18 17:25:39 +00:00
Max Morin
221ee3c3ca Revert "Reland Profile 2 to default profiles"
This reverts commit f682624062.

Reason for revert: WebRtcVideoQualityBrowserTests/WebRtcVideoQualityBrowserTest.MANUAL_TestVideoQualityVp9/0 and /1 failing on Linux, Mac, and Windows. E.g. https://ci.chromium.org/buildbot/chromium.webrtc/Mac%20Tester/83189.

Original change's description:
> Reland Profile 2 to default profiles
> 
> This is a reland after chrome browser tests are updated.
> 
> Bug: webrtc:9376
> Change-Id: I1c32ddcd2478e5a92fd3950876c7c19d35c1d79b
> TBR: niklas.enbom@webrtc.org
> Reviewed-on: https://webrtc-review.googlesource.com/88583
> Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
> Reviewed-by: Emircan Uysaler <emircan@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24736}

TBR=emircan@webrtc.org

Change-Id: Ibd072ce01506b481e6300b11e7f7ef85f79daf95
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9376
Reviewed-on: https://webrtc-review.googlesource.com/100421
Reviewed-by: Max Morin <maxmorin@webrtc.org>
Commit-Queue: Max Morin <maxmorin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24739}
2018-09-14 07:50:13 +00:00
Emircan Uysaler
f682624062 Reland Profile 2 to default profiles
This is a reland after chrome browser tests are updated.

Bug: webrtc:9376
Change-Id: I1c32ddcd2478e5a92fd3950876c7c19d35c1d79b
TBR: niklas.enbom@webrtc.org
Reviewed-on: https://webrtc-review.googlesource.com/88583
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Reviewed-by: Emircan Uysaler <emircan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24736}
2018-09-14 00:25:39 +00:00
Sergey Silkin
beba1b2766 Fix target frame rate of spatial layer.
Set target frame rate of spatial layer equal to minimum of two: maximum
frame rate of layer (SpatialLayer::maxFramerate) and maximum frame rate
of codec (VideoCodec::maxFramerate).

Bug: webrtc:9740, webrtc:9739, chromium:882358
Change-Id: I34f36e7fd2889f0417474347abab5327fa2d9d7c
Reviewed-on: https://webrtc-review.googlesource.com/99501
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24686}
2018-09-11 13:50:58 +00:00
Sergey Silkin
96f2c97161 Reland "Frame rate controller per spatial layer."
This is a reland of ae9e188e67

Original change's description:
> Frame rate controller per spatial layer.
>
> This allows VP9 encoder wrapper to control frame rate of each spatial
> layer. The wrapper configures encoder to skip encoding spatial layer
> when actual frame rate exceeds the target frame rate of that layer.
> Target frame rate of high spatial layer is expected to be equal or
> higher then that of low spatial layer. For now frame rate controller
> is only enabled in screen sharing mode.
>
> Added unit test which configures encoder to produce 3 spatial layers
> with frame rates 10, 20 and 30fps and verifies that absolute delta of
> final and target rate doesn't exceed 10%.
>
> Bug: webrtc:9682
> Change-Id: I7a7833f63927dd475e7b42d43e4d29061613e64e
> Reviewed-on: https://webrtc-review.googlesource.com/96640
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24593}

TBR=sprang@webrtc.org

Bug: webrtc:9682
Change-Id: Idcce315890c79301da532f9ba4997e9606f73fb0
Reviewed-on: https://webrtc-review.googlesource.com/99340
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24669}
2018-09-11 07:08:36 +00:00
Sergey Silkin
042661b404 Revert "Frame rate controller per spatial layer."
This reverts commit ae9e188e67.

Reason for revert: Verify if this causes chromium:882358.

Original change's description:
> Frame rate controller per spatial layer.
>
> This allows VP9 encoder wrapper to control frame rate of each spatial
> layer. The wrapper configures encoder to skip encoding spatial layer
> when actual frame rate exceeds the target frame rate of that layer.
> Target frame rate of high spatial layer is expected to be equal or
> higher then that of low spatial layer. For now frame rate controller
> is only enabled in screen sharing mode.
>
> Added unit test which configures encoder to produce 3 spatial layers
> with frame rates 10, 20 and 30fps and verifies that absolute delta of
> final and target rate doesn't exceed 10%.
>
> Bug: webrtc:9682
> Change-Id: I7a7833f63927dd475e7b42d43e4d29061613e64e
> Reviewed-on: https://webrtc-review.googlesource.com/96640
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24593}

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

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

Bug: webrtc:9682, chromium:882358
Change-Id: Idc4051eef72104823038ed9139bb9c75018f7d86
Reviewed-on: https://webrtc-review.googlesource.com/99082
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24646}
2018-09-10 11:24:33 +00:00
Sergey Silkin
ae9e188e67 Frame rate controller per spatial layer.
This allows VP9 encoder wrapper to control frame rate of each spatial
layer. The wrapper configures encoder to skip encoding spatial layer
when actual frame rate exceeds the target frame rate of that layer.
Target frame rate of high spatial layer is expected to be equal or
higher then that of low spatial layer. For now frame rate controller
is only enabled in screen sharing mode.

Added unit test which configures encoder to produce 3 spatial layers
with frame rates 10, 20 and 30fps and verifies that absolute delta of
final and target rate doesn't exceed 10%.

Bug: webrtc:9682
Change-Id: I7a7833f63927dd475e7b42d43e4d29061613e64e
Reviewed-on: https://webrtc-review.googlesource.com/96640
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24593}
2018-09-06 07:04:04 +00:00
Niels Möller
d3b8c63b58 Reland "Add spatial index to EncodedImage."
This is a reland of da0898dfae

Original change's description:
> Add spatial index to EncodedImage.
>
> Replaces the VP8 simulcast index and VP9 spatial index formely part of
> CodecSpecificInfo.
>
> Bug: webrtc:9378
> Change-Id: I80eafd63fbdee0a25864338196a690628b4bd3d2
> Reviewed-on: https://webrtc-review.googlesource.com/83161
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24485}

Tbr: magjed@webrtc.org
Bug: webrtc:9378
Change-Id: Iff20b656581ef63317e073833d1a326f7118fdfd
Reviewed-on: https://webrtc-review.googlesource.com/96780
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24507}
2018-08-31 07:35:52 +00:00
Sergey Silkin
ae3144c51f Move VP9 frame rate controller to separate class.
Bug: webrtc:9669
Change-Id: I6f30587778e9783182af11d2410464024918e171
Reviewed-on: https://webrtc-review.googlesource.com/96201
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24487}
2018-08-29 21:05:56 +00:00
Niels Moller
5a998d7246 Revert "Add spatial index to EncodedImage."
This reverts commit da0898dfae.

Reason for revert: Broke downstream tests.

Original change's description:
> Add spatial index to EncodedImage.
> 
> Replaces the VP8 simulcast index and VP9 spatial index formely part of
> CodecSpecificInfo.
> 
> Bug: webrtc:9378
> Change-Id: I80eafd63fbdee0a25864338196a690628b4bd3d2
> Reviewed-on: https://webrtc-review.googlesource.com/83161
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24485}

TBR=brandtr@webrtc.org,magjed@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,philipel@webrtc.org,srte@webrtc.org

Change-Id: Idb4fb9d72e5574d7353c631cb404a1311f3fd148
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9378
Reviewed-on: https://webrtc-review.googlesource.com/96664
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24486}
2018-08-29 14:36:05 +00:00
Niels Möller
da0898dfae Add spatial index to EncodedImage.
Replaces the VP8 simulcast index and VP9 spatial index formely part of
CodecSpecificInfo.

Bug: webrtc:9378
Change-Id: I80eafd63fbdee0a25864338196a690628b4bd3d2
Reviewed-on: https://webrtc-review.googlesource.com/83161
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24485}
2018-08-29 13:50:17 +00:00
Sergey Silkin
8227659075 Prevent duplicates in VP9 RTP p_diff list.
VP9 encoder wrapper duplicated p_diff values in VP9 RTP payload
descriptor for some frames. This confused ref frame finder which
invalidated such frames on receiver.

Bug: webrtc:9657
Change-Id: I5ddfed30d2908c5fbb8bce9d3dac0a519830e978
Reviewed-on: https://webrtc-review.googlesource.com/95701
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24456}
2018-08-27 14:38:59 +00:00
Sergey Silkin
738b7e9c24 Write scalability structure in flexible mode.
Always write scalability structure no matter whether flexible mode
is enabled or not.

Bug: webrtc:9658
Change-Id: I6c3d5c8e46046dfe89e8ec38536d71b195e80593
Reviewed-on: https://webrtc-review.googlesource.com/95723
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24406}
2018-08-23 15:12:09 +00:00
Sergey Silkin
76be29555d Allow VP9 flexible mode.
- Allow use of flexible mode which was blocked in webrtc:9261 since it
only worked together with old screen sharing. Since webrtc:9244 flexible mode
works with both normal and screen coding modes.
- Add unit test that checks that reference list encoder writes into RTP
payload descriptor and the predefined one match.

Bug: webrtc:9585
Change-Id: I4a1bdc51cbf15e7224cc7c271af8b2e3d46657d1
Reviewed-on: https://webrtc-review.googlesource.com/94778
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24355}
2018-08-21 11:10:36 +00:00
Niels Möller
2377588c82 Add accessor methods for RTP timestamp of EncodedImage.
Intention is to make the member private, but downstream callers
must be updated to use the accessor methods first.

Bug: webrtc:9378
Change-Id: I3495bd8d545b7234fbea10abfd14f082caa420b6
Reviewed-on: https://webrtc-review.googlesource.com/82160
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24352}
2018-08-21 09:15:51 +00:00
Sergey Silkin
908689d047 Fix calculation of number of active spatial layers.
It didn't account for implicit bitrate allocation, which is used in
some unit tests, when bitrate distribution is done by the encoder
wrapper.

Bug: none
Change-Id: I8fcf28e10f7a6c378580ef917221ad5c8d3869c9
Reviewed-on: https://webrtc-review.googlesource.com/94775
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24343}
2018-08-20 10:25:55 +00:00
Emircan Uysaler
715cc238d2 Refactor VP9 decoder color space code
Bug: webrtc:9522
Change-Id: I4106fd1d1386156e0c5b80f77763643694ead284
Reviewed-on: https://webrtc-review.googlesource.com/90182
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24087}
2018-07-24 18:17:06 +00:00
Emircan Uysaler
800787f03b Add color space information to webrtc::VideoFrame and extract from VP9
This CL is the first step for introducing color space information in webrtc.
- Add ColorSpace class listing color profiles.
- Add ColorSpace as a member of webrtc::VideoFrame.
- Make use of this class by extracting info from VP9 decoder.

Bug: webrtc:9522
Change-Id: I5e2514efee2a193bddb4459261387f2d40e936ad
Reviewed-on: https://webrtc-review.googlesource.com/88540
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23988}
2018-07-16 17:28:17 +00:00
Emircan Uysaler
0823eecc93 Reland "Reland "Add Profile 2 configuration to VP9 Encoder and Decoder""
This is a reland of cb853c8f90

Original change's description:
> Reland "Add Profile 2 configuration to VP9 Encoder and Decoder"
>
> This is a reland of fc9c4e88b5
>
> Original change's description:
> > Add Profile 2 configuration to VP9 Encoder and Decoder
> >
> > Bug: webrtc:9376
> > Change-Id: I4f627fb2b6c146a90cfcaa815da459b09dc00003
> > Reviewed-on: https://webrtc-review.googlesource.com/81980
> > Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
> > Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Reviewed-by: Jerome Jiang <jianj@google.com>
> > Cr-Commit-Position: refs/heads/master@{#23917}
>
> Bug: webrtc:9376
> Change-Id: I21fc44865af4e381f99dbc5ae2baf4a53ce834ca
> TBR: niklas.enbom@webrtc.org
> Reviewed-on: https://webrtc-review.googlesource.com/88341
> Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
> Reviewed-by: Emircan Uysaler <emircan@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23974}

TBR: niklas.enbom@webrtc.org
Bug: webrtc:9376
Change-Id: I90d7ebc2110b82901656df7f9331ae82ee010baf
Reviewed-on: https://webrtc-review.googlesource.com/88582
Reviewed-by: Emircan Uysaler <emircan@webrtc.org>
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23977}
2018-07-14 06:51:20 +00:00
Emircan Uysaler
c528c0a07f Revert "Reland "Add Profile 2 configuration to VP9 Encoder and Decoder""
This reverts commit cb853c8f90.

Reason for revert: 
Broke Linux tester on FYI bots, https://ci.chromium.org/buildbot/chromium.webrtc.fyi/Linux%20Tester/46636 .

Original change's description:
> Reland "Add Profile 2 configuration to VP9 Encoder and Decoder"
> 
> This is a reland of fc9c4e88b5
> 
> Original change's description:
> > Add Profile 2 configuration to VP9 Encoder and Decoder
> >
> > Bug: webrtc:9376
> > Change-Id: I4f627fb2b6c146a90cfcaa815da459b09dc00003
> > Reviewed-on: https://webrtc-review.googlesource.com/81980
> > Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
> > Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Reviewed-by: Jerome Jiang <jianj@google.com>
> > Cr-Commit-Position: refs/heads/master@{#23917}
> 
> Bug: webrtc:9376
> Change-Id: I21fc44865af4e381f99dbc5ae2baf4a53ce834ca
> TBR: niklas.enbom@webrtc.org
> Reviewed-on: https://webrtc-review.googlesource.com/88341
> Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
> Reviewed-by: Emircan Uysaler <emircan@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23974}

TBR=niklase@google.com,jianj@google.com,sprang@webrtc.org,marpan@google.com,niklas.enbom@webrtc.org,emircan@webrtc.org

Change-Id: I23062a0a2e5feafa29fd36e6b1c4a6e2734c4d68
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9376
Reviewed-on: https://webrtc-review.googlesource.com/88600
Reviewed-by: Emircan Uysaler <emircan@webrtc.org>
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23976}
2018-07-13 21:13:27 +00:00
Emircan Uysaler
cb853c8f90 Reland "Add Profile 2 configuration to VP9 Encoder and Decoder"
This is a reland of fc9c4e88b5

Original change's description:
> Add Profile 2 configuration to VP9 Encoder and Decoder
>
> Bug: webrtc:9376
> Change-Id: I4f627fb2b6c146a90cfcaa815da459b09dc00003
> Reviewed-on: https://webrtc-review.googlesource.com/81980
> Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
> Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Jerome Jiang <jianj@google.com>
> Cr-Commit-Position: refs/heads/master@{#23917}

Bug: webrtc:9376
Change-Id: I21fc44865af4e381f99dbc5ae2baf4a53ce834ca
TBR: niklas.enbom@webrtc.org
Reviewed-on: https://webrtc-review.googlesource.com/88341
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Reviewed-by: Emircan Uysaler <emircan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23974}
2018-07-13 19:30:36 +00:00
Qingsi Wang
2d82adea03 Revert "Add Profile 2 configuration to VP9 Encoder and Decoder"
This reverts commit fc9c4e88b5.

Reason for revert: Speculative revert. I suspect this breaks the internal importing tests. Will reland it if it is not the culprit.

Original change's description:
> Add Profile 2 configuration to VP9 Encoder and Decoder
> 
> Bug: webrtc:9376
> Change-Id: I4f627fb2b6c146a90cfcaa815da459b09dc00003
> Reviewed-on: https://webrtc-review.googlesource.com/81980
> Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
> Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Jerome Jiang <jianj@google.com>
> Cr-Commit-Position: refs/heads/master@{#23917}

TBR=niklase@google.com,jianj@google.com,sprang@webrtc.org,marpan@google.com,niklas.enbom@webrtc.org,emircan@webrtc.org

Change-Id: I6a8c851827707eb861776591087e595de7206ae4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9376
Reviewed-on: https://webrtc-review.googlesource.com/88100
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23920}
2018-07-11 06:04:49 +00:00
Emircan Uysaler
0894214f48 Add Profile 2 to default supported profiles
Bug: webrtc:9376
Change-Id: I7e7dba97bf4e94d24709c71a3131836538fc2229
Reviewed-on: https://webrtc-review.googlesource.com/88085
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23918}
2018-07-11 01:10:05 +00:00
Emircan Uysaler
fc9c4e88b5 Add Profile 2 configuration to VP9 Encoder and Decoder
Bug: webrtc:9376
Change-Id: I4f627fb2b6c146a90cfcaa815da459b09dc00003
Reviewed-on: https://webrtc-review.googlesource.com/81980
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#23917}
2018-07-10 22:47:52 +00:00
Karl Wiberg
918f50c5d1 Use absl::make_unique and absl::WrapUnique directly
Instead of going through our wrappers in ptr_util.h.

This CL was generated by the following script:

  git grep -l ptr_util | xargs perl -pi -e 's,#include "rtc_base/ptr_util.h",#include "absl/memory/memory.h",'
  git grep -l MakeUnique | xargs perl -pi -e 's,\b(rtc::)?MakeUnique\b,absl::make_unique,g'
  git grep -l WrapUnique | xargs perl -pi -e 's,\b(rtc::)?WrapUnique\b,absl::WrapUnique,g'
  git checkout -- rtc_base/ptr_util{.h,_unittest.cc}
  git cl format

Followed by manually adding dependencies on
//third_party/abseil-cpp/absl/memory until `gn check` stopped
complaining.

Bug: webrtc:9473
Change-Id: I89ccd363f070479b8c431eb2c3d404a46eaacc1c
Reviewed-on: https://webrtc-review.googlesource.com/86600
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23850}
2018-07-05 10:59:49 +00:00
Emircan Uysaler
98badbcd9f Add VP9 profile negotiation to SDP
This CL adds VP9 profile information in SDP. It adds the necessary fields and
enums to codec containers.

Additional profiles will be followed.

Bug: webrtc:9376
Change-Id: I78574714f06f8087262a71dd64c01f31a229dd54
Reviewed-on: https://webrtc-review.googlesource.com/81960
Reviewed-by: Taylor (left Google) <deadbeef@webrtc.org>
Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23810}
2018-07-02 23:38:41 +00:00
“Michael
67c8bcf804 Revert two instances of num_active_spatial_layers.
The variable, num_active_spatial_layers, is used to construct ssData.
This CL reverts two instances of num_active_spatial_layers not
related to ssData construction.

Bug: None
Change-Id: I4d90d4578684dfdf8bd5a39c7a2fe778fce4414c
Reviewed-on: https://webrtc-review.googlesource.com/85643
Commit-Queue: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23756}
2018-06-27 10:49:00 +00:00
Rasmus Brandt
58cd385e58 Fix potential division by zero in VP9 VideoCodecTest.
When GetSvcConfig returned fewer spatial layers than the number
statically configured from the test, we would crash on a SIGFPE.

This is not a problem in the production code, since there we
reset the encoder with the correct number of spatial layers
whenever the resolution changes.

Bug: None
Change-Id: I339e4a3c0fa993c7c649533c0eae71e1314194e7
Reviewed-on: https://webrtc-review.googlesource.com/85374
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23741}
2018-06-26 12:58:25 +00:00
“Michael
23c5a99381 Fix for VP9 K-SVC video freeze frame when send bandwidth is restricted.
Added distinction between number of configured and number of actively
encoded spatial layers and include number of actively encoded spatial
layers in ssData.  Modified layer_filtering_transport.cc test to
parse from the RTP header and use the number of actively encoded
spatial layers for filtering spatial video layers.

Bug: webrtc:9425
Change-Id: Ic9f8895ab08b0626f9bb53a75ec33d8e7eb8706e
Reviewed-on: https://webrtc-review.googlesource.com/84243
Commit-Queue: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23716}
2018-06-21 17:53:35 +00:00
Yves Gerey
665174fdbb Reformat the WebRTC code base
Running clang-format with chromium's style guide.

The goal is n-fold:
 * providing consistency and readability (that's what code guidelines are for)
 * preventing noise with presubmit checks and git cl format
 * building on the previous point: making it easier to automatically fix format issues
 * you name it

Please consider using git-hyper-blame to ignore this commit.

Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
2018-06-19 14:00:39 +00:00
Danil Chapovalov
0040b66ad3 Replace rtc::Optional with absl::optional
This is a no-op change because rtc::Optional is an alias to absl::optional

This CL generated by running script from modules with parameters
'pacing video_coding congestion_controller remote_bitrate_estimator':

find $@ -type f \( -name \*.h -o -name \*.cc \) \
-exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \
-exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \
-exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+

find $@ -type f -name BUILD.gn \
-exec sed -r -i 's|"(../)*api:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+;

git cl format

Bug: webrtc:9078
Change-Id: I8ea501d7f1ee36e8d8cd3ed37e6b763c7fe29118
Reviewed-on: https://webrtc-review.googlesource.com/83900
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23640}
2018-06-18 10:24:48 +00:00
Niels Möller
e3cf3d0496 Use enum class for VideoCodecMode and VideoCodecComplexity.
Bug: webrtc:7660
Change-Id: I6a8ef01f8abcc25c8efaf0af387408343a7c8ba3
Reviewed-on: https://webrtc-review.googlesource.com/81240
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23595}
2018-06-13 12:26:09 +00:00
Ilya Nikolaevskiy
b6c462d4e4 Cleanup webrtc:: namespace from leaked TimingFrameFlags
Bug: webrtc:9351
Change-Id: Ifbc0a522bf13ab62a2e490b9f129eacfabe7796f
Reviewed-on: https://webrtc-review.googlesource.com/80961
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23520}
2018-06-05 13:52:04 +00:00
Sergey Silkin
d45b345700 Set max_consec_drop to INT_MAX.
Set recently added max_consec_drop parameter to INT_MAX to keep behavior
of frame dropping logic unchanged.

Bug: none
Change-Id: Ie1d4b428cabc7182ed325c7de4ba8a42cdc826b1
Reviewed-on: https://webrtc-review.googlesource.com/79148
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Marco Paniconi <marpan@google.com>
Cr-Commit-Position: refs/heads/master@{#23482}
2018-06-01 08:30:02 +00:00
Sergey Silkin
ee20336f6e Drop entire superframe if any layer is overshooting.
Use new frame dropping mode - FULL_SUPERFRAME_DROP - in VP9 encoder and
configure it to drop entire superframe if any layer is overshooting.

Bug: none
Change-Id: Ie22ed5c175e530bcce365d40cba0d10cb608ad4f
Reviewed-on: https://webrtc-review.googlesource.com/79622
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23447}
2018-05-30 11:23:15 +00:00
Sergey Silkin
4e6cd5eaeb Get actual list of references from encoder in flexible mode.
In flexible mode, use VP9E_GET_SVC_REF_FRAME_CONFIG to get indices of
reference frame buffers and buffers update by encoded frame.

Set inter_pic_predicted to true only if encoder actually used temporal
prediction.

Bug: webrtc:9244, webrtc:9270
Change-Id: I4e439abeab9e063d50abdcefc59bf58d6596ea6c
Reviewed-on: https://webrtc-review.googlesource.com/74780
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Marco Paniconi <marpan@google.com>
Cr-Commit-Position: refs/heads/master@{#23410}
2018-05-28 11:35:49 +00:00
Jerome Jiang
0c2e8ce212 Initialize svc_drop_frame in vp9 wrapper.
Thus we don't need to initialize new members added to the structure
in the future.

Bug: None
Change-Id: Id9f5b127c224660f3016973261045b4231a617c1
Reviewed-on: https://webrtc-review.googlesource.com/79080
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23404}
2018-05-28 08:23:19 +00:00
Sergey Silkin
d902d58b0a Framerate controller for VP9 screen sharing.
- Limit framerate by dropping frames before encoding.
- The max framerate at screen sharing is set to 5fps.

Bug: webrtc:9261
Change-Id: Icfbbecce33fdce2d746291708db0108e0ba10760
Reviewed-on: https://webrtc-review.googlesource.com/76921
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23316}
2018-05-19 07:14:48 +00:00
Sergey Silkin
be71a1ee08 Replace VP9 screen sharing.
- Remove referencing control from encoder wrapper. Use fixed temporal
prediction structure.
- Remove flexible mode from encoder wrapper. It only worked with
referencing control which this CL removes.
- Remove external framerate/bitrate controller. Keep codec's internal
frame dropping enabled at screen sharing.
- Use GetSvcConfig() to configure layering.

Bug: webrtc:9261
Change-Id: I355baa6aab7b98ac5028b3851d1f8ccc82a308e0
Reviewed-on: https://webrtc-review.googlesource.com/76801
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23311}
2018-05-18 15:11:46 +00:00
Niels Möller
8df3a388a3 Deprecate RTPFragmentationHeader argument to VideoDecoder::Decode
Intend to delete in a later cl.

Bug: webrtc:6471
Change-Id: Icf0fcd40e0d3287dc59b684fae6552b40b47204a
Reviewed-on: https://webrtc-review.googlesource.com/39511
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23162}
2018-05-08 08:09:35 +00:00
“Michael
e8492fee6b Mitigate RTP pic ID errors in VP9 SVC non-flexible mode
The code changes in this CL configure VP9 SVC to drop a superframe when
the spatial base layer is dropped and to not drop upper spatial layers
when the spatial base layer is not dropped. The changes are effective in
non-flexible mode when codec_.mode == kRealtimeVideo and
number of spatial layers > 1.

Bug: none
Change-Id: I27481b78f733cfc6c007d1ad9f45d69263853149
Reviewed-on: https://webrtc-review.googlesource.com/74261
Commit-Queue: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23127}
2018-05-04 16:25:54 +00:00
Sergey Silkin
bd0954e83f Encode key frame when enabling upper layer.
Request key frame when upper spatial layer is enabled dynamically
and inter-layer prediction is disabled or limited to key pictures.

This is needed to force encoder to produce RTP compatible bitstream
where temporal prediction is limited to the same spatial layer.

Bug: webrtc:9217
Change-Id: I4fc1e3f067689ba7b5c6bd1f5af922a0637f03d7
Reviewed-on: https://webrtc-review.googlesource.com/73580
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23102}
2018-05-03 13:22:01 +00:00
Sergey Silkin
6a8f30e5a3 Add control for inter-layer prediction mode.
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}
2018-04-27 06:20:15 +00:00
Sergey Silkin
bc0f0d3ded Rename end_of_superframe to end_of_picture.
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}
2018-04-26 15:47:17 +00:00
Niels Möller
65fb4049c1 Don't expose resilience mode in VP8 and VP9 configuration.
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}
2018-04-25 13:54:33 +00:00
Sergey Silkin
c5a131a5fb Add non_ref_for_inter_layer_pred to VP9 RTP.
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}
2018-04-24 19:20:30 +00:00