Commit graph

783 commits

Author SHA1 Message Date
Henrik Boström
56db9ff1e1 VideoStreamEncoder: Don't map kNative video frame buffers.
Follow-up CL to VP8 and VP9 encoders taking care of mapping.
Context again:
  This CL is part of Optimized Scaling efforts. In Chromium, the native
frame buffer is getting an optimized CropAndScale() implementation. To
support HW accelerated scaling, returning pre-scaled images and skipping
unnecessary intermediate downscales, WebRTC needs to 1) use CropAndScale
instead of libyuv::XXXXScale and 2) only map buffers it actually intends
to encode.

In this CL, VideoStreamEncoder no longer calls GetMappedFrameBuffer() on
behalf of the encoders, since the encoders are now able to either do the
mapping or performs ToI420() anyway.

- Tests for old VSE behaviors are updated to test the new behavior (i.e.
  that native frames are pretty much always forwarded).
- The "having to call ToI420() twice" workaround to Android bug
  https://crbug.com/webrtc/12602 is added to H264 and AV1 encoders.

Bug: webrtc:12469
Change-Id: Ibdc2e138d4782a140f433c8330950e61b9829f43
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211940
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#33548}
2021-03-24 09:43:11 +00:00
Fyodor Kyslov
26abdaf478 AV1: Use Default TX type for encoding
This will further speed up intra frame encoding

Bug: None
Change-Id: I3c836502cdcb1037e3128850a085b92acd8fc7ad
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212821
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Fyodor Kyslov <kyslov@google.com>
Cr-Commit-Position: refs/heads/master@{#33544}
2021-03-23 17:19:27 +00:00
Henrik Boström
3889de1c4c Support native scaling of VideoFrameBuffers in LibvpxVp8Encoder.
This is a follow-up to the VP9, fixing VP8 this time. Context again:

This CL is part of Optimized Scaling efforts. In Chromium, the native
frame buffer is getting an optimized CropAndScale() implementation. To
support HW accelerated scaling, returning pre-scaled images and skipping
unnecessary intermediate downscales, WebRTC needs to 1) use CropAndScale
instead of libyuv::XXXXScale and 2) only map buffers it actually intends
to encode.
- To achieve this, WebRTC encoders are updated to map kNative video
  buffers so that in a follow-up CL VideoStreamEncoder can stop mapping
  intermediate buffer sizes.

Bug: webrtc:12469, chromium:1157072
Change-Id: I026527ae77e36f66d02e149ad6fe304f6a8ccb05
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212600
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#33537}
2021-03-23 09:08:58 +00:00
Henrik Boström
bd9e4a95eb Support native scaling of VideoFrameBuffers in LibvpxVp9Encoder.
This CL is part of Optimized Scaling efforts. In Chromium, the native
frame buffer is getting an optimized CropAndScale() implementation. To
support HW accelerated scaling, returning pre-scaled images and skipping
unnecessary intermediate downscales, WebRTC needs to 1) use CropAndScale
instead of libyuv::XXXXScale and 2) only map buffers it actually intends
to encode.
- To achieve this, WebRTC encoders are updated to map kNative video
  buffers so that in a follow-up CL VideoStreamEncoder can stop mapping
  intermediate buffer sizes.

In this CL LibvpxVp9Encoder is updated to map kNative buffers of pixel
formats it supports and convert ToI420() if the kNative buffer is
something else. A fake native buffer that keeps track of which
resolutions were mapped, MappableNativeBuffer, is added.

Because VP9 is currently an SVC encoder and not a simulcast encoder, it
does not need to invoke CropAndScale.

This CL also fixes MultiplexEncoderAdapter, but because it simply
forwards frames it only cares about the pixel format when
|supports_augmented_data_| is true so this is the only time we map it.
Because this encoder is not used with kNative in practise, we don't care
to make this path optimal.

Bug: webrtc:12469, chromium:1157072
Change-Id: I74edf85b18eccd0d250776bbade7a6444478efce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212580
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#33526}
2021-03-22 13:35:35 +00:00
Niels Möller
490c1503d9 Delete unowned buffer in EncodedImage.
Bug: webrtc:9378
Change-Id: Ice48020c0f14905cbc185b52c88bbb9ac3bb4c93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128575
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33510}
2021-03-19 14:12:28 +00:00
Fyodor Kyslov
f8776cba62 Revert "AV1: Use Default TX type for encoding"
This reverts commit b0dc518f82.

Reason for revert: corresponding change  https://chromium-review.googlesource.com/c/chromium/src/+/2765225 from chromium has not been backported to webrtc yet.


Original change's description:
> AV1: Use Default TX type for encoding
>
> This will further speed up intra frame encoding
>
> Bug: None
> Change-Id: I1a105c6d2cdd9dc82f84d0039dbea3f0d090ab93
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212320
> Reviewed-by: Marco Paniconi <marpan@webrtc.org>
> Commit-Queue: Fyodor Kyslov <kyslov@google.com>
> Cr-Commit-Position: refs/heads/master@{#33492}

TBR=jianj@google.com,marpan@webrtc.org,kyslov@google.com

Change-Id: I7ff93537942ab34706db0b71c6b5f8535209619d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212340
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Fyodor Kyslov <kyslov@google.com>
Cr-Commit-Position: refs/heads/master@{#33494}
2021-03-17 19:16:50 +00:00
Fyodor Kyslov
b0dc518f82 AV1: Use Default TX type for encoding
This will further speed up intra frame encoding

Bug: None
Change-Id: I1a105c6d2cdd9dc82f84d0039dbea3f0d090ab93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212320
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Fyodor Kyslov <kyslov@google.com>
Cr-Commit-Position: refs/heads/master@{#33492}
2021-03-17 18:43:28 +00:00
Fyodor Kyslov
bff6489c94 AV1: Disable several intra coding tools.
This will speed up key frame encoding (together with libaom changes)
3x-4x times with ~13% BDRate loss on key frames only

Bug: None
Change-Id: I24332f4f7285811cdc6619ba29844fe564cae95e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212040
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Fyodor Kyslov <kyslov@google.com>
Cr-Commit-Position: refs/heads/master@{#33468}
2021-03-15 23:20:08 +00:00
philipel
b3159517c3 Remove incorrect DCHECKs from LibaomAv1Encoder::SetRates.
Bug: none
Change-Id: I6474418e04538151cfc1588a63e9ffa476e7fd7b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211870
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33465}
2021-03-15 15:20:14 +00:00
Jerome Jiang
662d4c328f AV1 test: change ssim threshold
Bug: webrtc:12519
Change-Id: Ibdcaa08800d03d289f86e14cc7d94b5f2d3b7117
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209480
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#33377}
2021-03-03 18:22:45 +00:00
Sergey Silkin
db0b4a8935 Do not crash if codec is not available
Check if codec was successfully created and exit from RunTest if not
before creating VideoProcessor.

Bug: none
Change-Id: Ia6d7171650dbc9824fb78f4a8e2851f755cfd63b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209362
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33372}
2021-03-03 13:56:17 +00:00
Sergio Garcia Murillo
dac39c5b1e Reland "Add test for odd sizes with spatial layers"
This is a reland of 6fe3fa14c6

Original change's description:
> Add test for odd sizes with spatial layers
>
> Bug: webrtc:12398
> Change-Id: If28f22f8c08913315806d26ad0b355eabda67da6
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203889
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Commit-Queue: Jerome Jiang <jianj@google.com>
> Cr-Commit-Position: refs/heads/master@{#33319}

TBR=philipel@webrtc.org

Bug: webrtc:12398
Change-Id: I0c52a5d2d503180793603c148b3211df3ca035e1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208640
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33336}
2021-02-24 21:10:03 +00:00
Florent Castelli
d0844a80de Revert "Add test for odd sizes with spatial layers"
This reverts commit 6fe3fa14c6.

Reason for revert: Test failures on Android x86

Original change's description:
> Add test for odd sizes with spatial layers
>
> Bug: webrtc:12398
> Change-Id: If28f22f8c08913315806d26ad0b355eabda67da6
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203889
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Commit-Queue: Jerome Jiang <jianj@google.com>
> Cr-Commit-Position: refs/heads/master@{#33319}

Bug: webrtc:12398
Change-Id: I801d2d1d2b27e89e4b6af64d79af80a901708682
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208521
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33323}
2021-02-23 11:45:34 +00:00
Jerome Jiang
90ea0a65f4 AV1: Change multithreading, speed, qp settings
Use 4 threads for 360p and above.
Use tile rows for VGA and 4 threads.
Use speed 8 for 360p.
Change min max qp scaling threshold.

Bug: None
Change-Id: Ib7a5b7e539d26d9fa60aa2c4a75eb6f4b19f7dea
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208340
Commit-Queue: Jerome Jiang <jianj@google.com>
Commit-Queue: Fyodor Kyslov <kyslov@google.com>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33320}
2021-02-22 21:14:30 +00:00
Sergio Garcia Murillo
6fe3fa14c6 Add test for odd sizes with spatial layers
Bug: webrtc:12398
Change-Id: If28f22f8c08913315806d26ad0b355eabda67da6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203889
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#33319}
2021-02-22 19:24:19 +00:00
Danil Chapovalov
e904161cec Replace RTC_DEPRECATED with ABSL_DEPRECATED
This remove webrtc-specific macro that has no reason to be webrtc specific
ABSL_DEPRECATED takes a message parameter encouraging to write text how class or function is deprecated.

Bug: webrtc:12484
Change-Id: I89f1398f91dacadc37f7db469dcd985e3724e444
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208282
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33314}
2021-02-22 12:53:23 +00:00
Jerome Jiang
04a6529c86 AV1: set superblock to 64x64 for 720p 4 threads.
Multithreading is more effective.

Change-Id: Ic850de4ee6affe3c0f623deb0318f991675c4351
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208300
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#33306}
2021-02-19 18:51:14 +00:00
Danil Chapovalov
735e33fae0 Add S3T3 video scalability structure
Bug: None
Change-Id: I93760b501ff712ca2f7a9dfa3cba6ed5245e4f4b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208080
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33297}
2021-02-18 17:46:29 +00:00
Niels Möller
f4e3e2b83f Delete rtc::Callback0 and friends.
Replaced with std::function.

Bug: webrtc:6424
Change-Id: Iacc43822cb854ddde3cb1e5ddd863676cb07510a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205005
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33281}
2021-02-16 12:41:35 +00:00
Danil Chapovalov
f91f8b517a Consolidate full svc structures in one source file
Keeping structures in the same file makes it clearer which are missing
and makes it easier to see if structures are consistent with one another.

No-Try: True
Bug: None
Change-Id: I4e5e6971054dd28dd326c68369ee57b6df62725e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206987
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33256}
2021-02-13 16:17:54 +00:00
Åsa Persson
bc1cdef4e8 EncoderInfoSettings: Add common string which applies to all encoders.
Change "-LibvpxVp9Encoder-" to "-VP9-" for consistency.

Bug: none
Change-Id: I7a73759db00e92286fe9a4bbed8512baf91decdb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206982
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33249}
2021-02-12 14:49:28 +00:00
Jerome Jiang
de7ee3a53d Reland "AV1: change update freq and disable denoiser explicitly."
This is a reland of abf5701c37

Original change's description:
> AV1: change update freq and disable denoiser explicitly.
>
> Change speed/thread settings for faster encoding.
>
> Change-Id: I74d93eac26ae8700a48c437fe235643810de1ca0
> Bug: None
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206480
> Reviewed-by: Marco Paniconi <marpan@webrtc.org>
> Reviewed-by: Marco Paniconi <marpan@google.com>
> Commit-Queue: Jerome Jiang <jianj@google.com>
> Cr-Commit-Position: refs/heads/master@{#33208}

Bug: None
Change-Id: Icc8e064b4af175214a7fdec16f3c8078c0220e50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206900
Reviewed-by: Jerome Jiang <jianj@google.com>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33226}
2021-02-11 08:25:27 +00:00
Artem Titov
d15a575ec3 Use SequenceChecker from public API
Bug: webrtc:12419
Change-Id: I00cca16a0ec70246156ba00b97aa7ae5ccbf5364
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205323
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33220}
2021-02-10 15:04:55 +00:00
Mirko Bonadei
fa5ad8c0b5 Revert "AV1: change update freq and disable denoiser explicitly."
This reverts commit abf5701c37.

Reason for revert: Breaks downstream tests.

Original change's description:
> AV1: change update freq and disable denoiser explicitly.
>
> Change speed/thread settings for faster encoding.
>
> Change-Id: I74d93eac26ae8700a48c437fe235643810de1ca0
> Bug: None
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206480
> Reviewed-by: Marco Paniconi <marpan@webrtc.org>
> Reviewed-by: Marco Paniconi <marpan@google.com>
> Commit-Queue: Jerome Jiang <jianj@google.com>
> Cr-Commit-Position: refs/heads/master@{#33208}

TBR=jianj@google.com,marpan@google.com,marpan@webrtc.org

Change-Id: I47b65e1c78ccb055238a44886dac87f8fc2f5330
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206644
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33213}
2021-02-10 09:30:10 +00:00
Jerome Jiang
abf5701c37 AV1: change update freq and disable denoiser explicitly.
Change speed/thread settings for faster encoding.

Change-Id: I74d93eac26ae8700a48c437fe235643810de1ca0
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206480
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Reviewed-by: Marco Paniconi <marpan@google.com>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#33208}
2021-02-09 20:36:37 +00:00
Hua, Chunbo
a0848ddeff Correct SpatialLayer in VP9 unittest.
Bug: None
Change-Id: If8b26c8e7afa380f109d71a93b78bad784da34ad
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205961
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33187}
2021-02-08 10:13:18 +00:00
Danil Chapovalov
b5823055be In VP9 encoder avoid crashing when encoder produce an unexpected frame
Since for such frame SvcController haven't setup how buffer should be
referenced and updated, the frame would likely have unexpected configuration.
Log an error to note resource have been wasted produce it and drop such frame.

Bug: webrtc:11999
Change-Id: I1784403e67b7207092d46016510460738994404e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205140
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33148}
2021-02-03 14:56:09 +00:00
Åsa Persson
9111bd18b1 LibvpxVp8Encoder: add option to configure resolution_bitrate_limits.
Bug: none
Change-Id: Ia01d630fc95e19a4a08cd7a004238c22d823b4dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205521
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33144}
2021-02-03 11:25:32 +00:00
Artem Titov
c8421c4c3e Replace rtc::ThreadChecker with webrtc::SequenceChecker
Bug: webrtc:12419
Change-Id: I825c014cc1c4b1dcba5ef300409d44859e971144
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205002
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33136}
2021-02-02 14:56:27 +00:00
Sergio Garcia Murillo
3faea70d1a allow empty scalability mode in AV1 encoder
Bug: chromium:1170699
Change-Id: I74c633e74c85c3b940d6302cdc8fa319e187b1e5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204221
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33122}
2021-02-01 13:00:09 +00:00
Åsa Persson
c91c4233e3 LibvpxVp9Encoder: add option to configure resolution_bitrate_limits.
Bug: none
Change-Id: Icdd7333296d652b1e0c159226df702084303475c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204701
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33121}
2021-02-01 11:48:00 +00:00
Andrey Logvin
7864600a6e Add absl_deps field for rtc_test and rtc_executable
To be able to build these targets in chromium we need to replace all abseil dependencies with "//third_party/abseil-cpp:absl".

Bug: webrtc:12404
Change-Id: Ie0f6af73f2abc73e5744520cfd9a6414e2f948e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202762
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33108}
2021-01-29 16:40:49 +00:00
Jerome Jiang
103876f379 av1: turn off a few tools that are not used for rtc
Explicitly turn off obmc, warped motion, global motion and ref frame mv.

Bug: chromium:1095763, chromium:1170346
Change-Id: I19bc4fceef4cd5e35ea6699e6af883af244f8954
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203900
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Reviewed-by: Marco Paniconi <marpan@google.com>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#33075}
2021-01-26 17:49:34 +00:00
Danil Chapovalov
11215febb9 Require scalability mode to initialize av1 encoder.
To make VideoCodec::scalability_mode the only option to set and
change the scalability structure, for easier maintainability.

Bug: webrtc:11404
Change-Id: I6570e9a93ddf2897ff7584c5d20a246346e853e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/192361
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33056}
2021-01-22 09:46:52 +00:00
Erik Språng
03eed7c8d0 Fixes issue triggered by WebRTC-VP9-PerformanceFlags trial.
Using WebRTC-VP9-PerformanceFlags and settings a multi-layer config,
and then configuring the codec in non-svc mode would cause us to not
set the cpu speed in libvpx. For some reason, that could trigger a
crash in the encoder.

This CL fixes that, and adds new test coverage for the code affected
byt the trial.

Bug: chromium:1167353, webrtc:11551
Change-Id: Iddb92fe03fc12bac37717908a8b5df4f3d411bf2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202761
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33051}
2021-01-21 10:29:05 +00:00
Sergio Garcia Murillo
1528e2b3a7 Set AV1E_SET_ERROR_RESILIENT_MODE on T1 and T2 enhanced layers
TBR=marpan@webrtc.org

Bug: webrtc:11404
Change-Id: I21c97861d6df06a0e50641a9fdf26d56e50c2030
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201627
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Marco Paniconi <marpan@google.com>
Cr-Commit-Position: refs/heads/master@{#32997}
2021-01-15 11:14:00 +00:00
Erik Språng
c12f625938 Adds VideoDecoder::GetDecoderInfo()
This adds a new way to poll decoder metadata.
A default implementation still delegates to the old methods.
Root call site is updates to not use the olds methods.

Follow-ups will dismantle usage of the olds methods in wrappers.

Bug: webrtc:12271
Change-Id: Id0fa6863c96ff9e3b849da452d6540e7c5da4512
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196520
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32976}
2021-01-14 13:33:22 +00:00
Danil Chapovalov
b942d45110 Fill fps allocation by LibaomAv1Encoder::GetEncoderInfo
Absent fps allocation imply single layer stream which confuses bitrate adjuster.
As a result bitrate adjuster turned off S0T1 and S0T2 layers for the L3T3 structure.

Bug: webrtc:12148
Change-Id: I5b3a7b44322f347f41dd8858b3d703827e69dd72
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201384
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32952}
2021-01-12 17:26:40 +00:00
Niels Möller
a68bfc5537 Delete KeepBufferRefs helpers, and use of rtc::Bind.
The rtc::Bind usages are replaced with lambdas with copy-capture
of the ref pointers.

Bug: webrtc:11339
Change-Id: I2fb544fcd2780feac3d725993c360df91899b532
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201201
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32946}
2021-01-12 12:35:38 +00:00
Niels Möller
6afa794b6e Delete deprecated H264BitstreamParser methods
Bug: webrtc:10439
Change-Id: I1513907f03f9adfcf5657298e69d60519af764ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/198121
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32934}
2021-01-11 09:31:54 +00:00
Jerome Jiang
39d1f74909 Decide Av1 num of threads on frame size and available cores.
Change-Id: I65c40a123ad848bc175311f9d9e4d2bd28734aa2
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196681
Commit-Queue: Jerome Jiang <jianj@google.com>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32850}
2020-12-17 05:36:48 +00:00
Andrey Logvin
f964dea554 Lower HighBitrateAV1 liabom test quality threshold
Lowering a bit since it is currently failing after one of CLs from https://aomedia.googlesource.com/aom.git/+log/87c414ed32..43927e4611

The error is "error: Expected: (video_stat.min_ssim) > (quality_thresholds->min_min_ssim), actual: 0.919629 vs 0.92"

Bug: None
Change-Id: I35e1e989961c6794a7f5f2015f5a8a786f1e25f8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/197808
Reviewed-by: Jerome Jiang <jianj@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32844}
2020-12-16 09:51:51 +00:00
Erik Språng
ebe5acb27a VideoCodecTextFixture and YuvFrameReader improvements.
Adds ability to specify desired frame size separate from actual clip
resolution, as well as clip and desired fps.
This allows e.g. reading an HD clip but running benchmarks in VGA, and
to specify e.g. 60fps for the clip but 30for encoding where frame
dropping kicks in so that motion is actually correct rather than just
plaing the clip slowly.

Bug: webrtc:12229
Change-Id: I4ad4fcc335611a449dc2723ffafbec6731e89f55
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/195324
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32839}
2020-12-15 23:18:06 +00:00
Erik Språng
cc02721090 Extend LibvpxInterface with VP9 support and use it from LibvpxVp9Encoder
Bug: webrtc:12274
Change-Id: I7a66a91f6a21ba482347af3c8af53544f9eb2269
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196900
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32822}
2020-12-13 18:07:05 +00:00
Erik Språng
0186d2d626 Splits vp9_impl into libvpx_vp9_encoder and libvpx_vp9_decoder.
Also moves the LibvpxVp8Interface from codec/vp8 to codec/interface and
drops vp8 from the name.

Follow-up CLs will wire up actual usage in the new classes through the
interface so that we can unit test them more easily.

Bug: webrtc:12274
Change-Id: I95f66e90245d9320e5fc23cdc845fbeb2648b38b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196522
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32816}
2020-12-10 19:31:11 +00:00
Erik Språng
3931591476 Reland "Adds experimental libvpx VP9 speed settings."
This is a reland of 6e7167456b

Patch set 1 is the original.
Later patch sets fix a parsing bug, and adds a new flag which enables
or disabled the ability to set separate per spatial layer speed
(use_per_layer_speed).

Original change's description:
> Adds experimental libvpx VP9 speed settings.
>
> Using the field trial WebRTC-VP9-PerformanceFlags, this CL allows you to
> configure the libvpx VP9 encoder with a list of flags to affect the
> quality vs speed tradeoff. This CL adds support for:
>
> * Speed (effort), for the temporal base layer frames
> * Speed for higher (non-base) layer frames
> * De-blocking (as part of the loopfilter) enabled for:
>   0 = all frames
>   1 = all but frames from the highest temporal layer
>   2 = no frames
>
> Each entry in the list has a threshold in min number of pixels needed
> for settings in the entry to apply.
>
> Example: Two spatial layers (180p, 360p) with three temporal
> layers are configured. Field trial "WebRTC-VP9-PerformanceFlags" set to:
> "use_per_layer_speed,min_pixel_count:0|129600,base_layer_speed:5|7,high_layer_speed:8|8,deblock_mode:1|2"
> This translates to:
> S0:
>   - TL0: Speed 5, deblocked
>   - TL1: Speed 8, deblocked
>   - TL2: Speed 8, not deblocked
> S1:
>   - TL0: Speed 7, not deblocked
>   - TL1: Speed 8, not deblocked
>   - TL2: Speed 8, not deblocked
>
> Bug: webrtc:11551
> Change-Id: Ieef6816d3e0831ff53348ecc4a90260e2ef10422
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188461
> Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32749}

Bug: webrtc:11551
Change-Id: Ie7c703eb122197235d8ce77cb72db7a347382468
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196345
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32780}
2020-12-06 19:39:57 +00:00
Erik Språng
ead570c963 Revert "Adds experimental libvpx VP9 speed settings."
This reverts commit 6e7167456b.

Reason for revert: Unexpected perf change

Original change's description:
> Adds experimental libvpx VP9 speed settings.
>
> Using the field trial WebRTC-VP9-PerformanceFlags, this CL allows you to
> configure the libvpx VP9 encoder with a list of flags to affect the
> quality vs speed tradeoff. This CL adds support for:
>
> * Speed (effort), for the temporal base layer frames
> * Speed for higher (non-base) layer frames
> * De-blocking (as part of the loopfilter) enabled for:
>   0 = all frames
>   1 = all but frames from the highest temporal layer
>   2 = no frames
>
> Each entry in the list has a threshold in min number of pixels needed
> for settings in the entry to apply.
>
> Example: Two spatial layers (180p, 360p) with three temporal
> layers are configured. Field trial "WebRTC-VP9-PerformanceFlags" set to:
> "min_pixel_count:0|129600,base_layer_speed:5|8,high_layer_speed:7|8,deblock_mode:1|2"
> This translates to:
> S0:
>   - TL0: Speed 5, deblocked
>   - TL1: Speed 8, deblocked
>   - TL2: Speed 8, not deblocked
> S1:
>   - TL0: Speed 7, not deblocked
>   - TL1: Speed 8, not deblocked
>   - TL2: Speed 8, not deblocked
>
> Bug: webrtc:11551
> Change-Id: Ieef6816d3e0831ff53348ecc4a90260e2ef10422
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188461
> Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32749}

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

Change-Id: If910963441ac1a0e002aac7066791c7cc7764a1a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11551
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196344
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32762}
2020-12-03 16:06:13 +00:00
Erik Språng
6e7167456b Adds experimental libvpx VP9 speed settings.
Using the field trial WebRTC-VP9-PerformanceFlags, this CL allows you to
configure the libvpx VP9 encoder with a list of flags to affect the
quality vs speed tradeoff. This CL adds support for:

* Speed (effort), for the temporal base layer frames
* Speed for higher (non-base) layer frames
* De-blocking (as part of the loopfilter) enabled for:
  0 = all frames
  1 = all but frames from the highest temporal layer
  2 = no frames

Each entry in the list has a threshold in min number of pixels needed
for settings in the entry to apply.

Example: Two spatial layers (180p, 360p) with three temporal
layers are configured. Field trial "WebRTC-VP9-PerformanceFlags" set to:
"min_pixel_count:0|129600,base_layer_speed:5|8,high_layer_speed:7|8,deblock_mode:1|2"
This translates to:
S0:
  - TL0: Speed 5, deblocked
  - TL1: Speed 8, deblocked
  - TL2: Speed 8, not deblocked
S1:
  - TL0: Speed 7, not deblocked
  - TL1: Speed 8, not deblocked
  - TL2: Speed 8, not deblocked

Bug: webrtc:11551
Change-Id: Ieef6816d3e0831ff53348ecc4a90260e2ef10422
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188461
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32749}
2020-12-02 19:20:57 +00:00
Danil Chapovalov
4005e5abb8 Add av1 svc configuration for target bitrates
This configuration mostly copies vp9 configuration for regular video,
but is done separately to allow tune av1 svc bitrates independently of vp9.

Bug: webrtc:12148
Change-Id: Icd11817ada8f9b6135ee2da57204eadb50de3954
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/195329
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32713}
2020-11-27 13:32:05 +00:00
Danil Chapovalov
9a5e21da68 in Vp8 encoder fill resolution into codec agnostic structure
so that it will be filled in the dependency descriptor rtp header extension

Bug: webrtc:10342
Change-Id: Ifaf4963ca84f6d495287959746686ae3dcd176d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168767
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32692}
2020-11-25 12:49:51 +00:00