Commit graph

1111 commits

Author SHA1 Message Date
philipel
09a2848351 Remove LibaomAv1EncoderIfSupported
Bug: webrtc:13573
Change-Id: Ia9a6d1809488d92753527350a61f0a46159ccd8b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262814
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37033}
2022-05-30 09:56:54 +00:00
Peter Kasting
0921d1e5c1 C++20 fixes.
ABSL_CONST_INIT must be on definitions, not just declarations.

Bug: chromium:1284275
Change-Id: If57064ab9417df38f770c59e50be93a104748b72
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263282
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36994}
2022-05-25 06:15:29 +00:00
Åsa Persson
37f7d6c4e1 Update VP9Encoder::SupportsScalabilityMode
Indicate that the scalability mode is supported if the scalability config exists.

Bug: webrtc:13960
Change-Id: I6f42da6c9bbff1322ec5c3e3a68c7e031606da86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262981
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36989}
2022-05-24 15:51:53 +00:00
Niels Möller
be2fb41b32 Delete codec-specific frameDroppingOn settings.
Followup to https://webrtc-review.googlesource.com/c/src/+/262244

Bug: webrtc:6883
Change-Id: Iefac43709f14424c74470aa878ec512b7dacc68a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262258
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36949}
2022-05-20 14:54:31 +00:00
Niels Möller
c0a9f35248 Define SimulcastStream as an alias for SpatialLayer
Step one in making it a separate type, that will be done as a
followup, after downstream code is updated to use the new name.

Bug: webrtc:11607
Change-Id: I6fa664a0729b1cfd71b7f02b6441880beee0e741
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262806
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36946}
2022-05-20 13:12:21 +00:00
Asa Persson
cde992ddad Add support for VP9 configuration through scalability mode.
Bug: webrtc:13960
Change-Id: Ia930647b15f624a4d10d8d335519b69ffdae6636
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260983
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36919}
2022-05-18 08:21:00 +00:00
Danil Chapovalov
c5aa5bea49 Delete deprecated VP8Encoder::Create function
Bug: None
Change-Id: I42e5d846d3d012f8b85eede743202b84239ceef1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262764
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36914}
2022-05-17 13:23:24 +00:00
Niels Möller
059548919b Enable VP8 configuration via scalability mode
Bug: webrtc:13959
Change-Id: I16054506ca4086767323443fb9b1e623224e234d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258791
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36884}
2022-05-13 13:53:44 +00:00
Niels Möller
807328fec7 Move frame drop config to VideoCodec and VideoEncoderConfig.
Intend to delete corresponding codec-specific settings in a followup.

Bug: webrtc:6883
Change-Id: I78ab07729a5aee1055f80d39d8f7289beb6721e1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262244
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36882}
2022-05-13 13:40:14 +00:00
philipel
9437529d4b Determine scalability mode if not explicilty set for AV1.
Bug: none
Change-Id: I86298b8a57300ed1d824cf6ba8f5daeec6af7315
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262242
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36879}
2022-05-13 12:06:44 +00:00
Niels Möller
14d01508be Move VP8 SupportsScalabilityMode utility to its own build target
Intended to let Vp8TemporalLayersFactory (an api/ target) reuse
this function, without depending on the codec implementation, and
without introducing a dependency cycle with the webrtc_vp8 build
target.

Bug: webrtc:11607
Change-Id: I671422e994e1005da8c7d768e8dd8ff795553e51
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261308
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36816}
2022-05-09 13:25:25 +00:00
Niels Möller
3b0481389f Update SupportsScalabilityMode functions to use enum ScalabilityMode.
And add missing values to ScalabilityMode.

Bug: webrtc:11607
Change-Id: I892ac35a3528db11b0901d26902699ecfe8f49a4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260982
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36792}
2022-05-06 07:29:20 +00:00
Peter Kasting
662d7f11d5 Fixes to support building in -std=c++20 mode.
* Structs with user-declared constructors are no longer considered
  aggregates, so remove the declarations when possible
* Types of both arguments to "==" must match to avoid "ambiguous
  function call" warning
* Various types of math involving enums are deprecated, so replace with
  constexprs where necessary
* ABSL_CONST_INIT must be used on definition as well as declaration
* volatile memory may no longer be read from and written to by the same
  operator, so replace e.g. "n++" with "n = n + 1"
* Replace an outdated check for no_unique_address support with
  __has_cpp_attribute
* std::result_of(f(x)) has been removed, replace with
  std::invoke_result(f, x)

Bug: chromium:1284275
Change-Id: I77b366ab1da7eb2c1e4c825b2714417c31ee5903
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261221
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Tomas Gunnarsson <tommi@google.com>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36786}
2022-05-05 17:15:58 +00:00
philipel
30ec725b6e Auxiliary liboam AV1 encoder settings.
Bug: none
Change-Id: I03e01ffbed2ec98953650847600016e4f80fdb50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260861
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36758}
2022-05-04 11:59:29 +00:00
philipel
8c354882f8 Updated libaom AV1 encoder configuration.
New configuration parameters are:
  AV1E_SET_DISABLE_TRELLIS_QUANT = 1
  AV1E_SET_ENABLE_DIST_WTD_COMP = 0
  AV1E_SET_ENABLE_DIFF_WTD_COMP = 0
  AV1E_SET_ENABLE_DUAL_FILTER = 0
  AV1E_SET_ENABLE_INTERINTRA_COMP = 0
  AV1E_SET_ENABLE_INTERINTRA_WEDGE = 0
  AV1E_SET_ENABLE_INTRA_EDGE_FILTER = 0
  AV1E_SET_ENABLE_INTRABC = 0
  AV1E_SET_ENABLE_MASKED_COMP = 0
  AV1E_SET_ENABLE_PAETH_INTRA = 0
  AV1E_SET_ENABLE_QM = 0
  AV1E_SET_ENABLE_RECT_PARTITIONS = 0
  AV1E_SET_ENABLE_RESTORATION = 0
  AV1E_SET_ENABLE_SMOOTH_INTERINTRA = 0
  AV1E_SET_ENABLE_TX64 = 0
  AV1E_SET_MAX_REFERENCE_FRAMES = 3

Also added a SET_ENCODER_PARAM_OR_RETURN_ERROR convenience macro.

Bug: none
Change-Id: I7a683ec4ad36f33e13e669ba25db2ad81b9b5c86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260463
Reviewed-by: Marco Paniconi <marpan@google.com>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36729}
2022-05-02 10:12:52 +00:00
Jerome Jiang
0bb7cbc278 Lower av1 test psnr threshold
AV1 Realtime encoder stats changed

Bug: None
Change-Id: I50a8d36c45a775b3c0127476fb32c3d68d288508
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260480
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Marco Paniconi <marpan@google.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/main@{#36712}
2022-04-29 16:12:32 +00:00
Niels Möller
79d566b0cf New enum ScalabilityMode.
Used instead of string representation in lower-levels of encoder configuration, to avoid string comparisons (with risk of misspelling) in lots of places.

Bug: webrtc:11607
Change-Id: I4d51c2265aac297c29976d2aa601d8ffb33b7326
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259870
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36706}
2022-04-29 12:16:42 +00:00
Niels Möller
c7b690272d Update modules/ to not use implicit conversion from scoped_refptr<T> to T*.
Bug: webrtc:13464
Change-Id: I3906e91906edbf80d558e5c367d6b9429497c021
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259762
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36606}
2022-04-21 14:23:24 +00:00
Björn Terelius
0c68a7aaa7 Use WebRTC's Java VM initialization in tests.
WebRTC should not depend on chromium's //base.

Bug: webrtc:13662
Change-Id: Ie660aa0f2477cc747830bba611aa23ed5e732385
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256364
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36581}
2022-04-20 08:41:48 +00:00
Niels Möller
cc171956f8 Rename scalability mode "NONE" to "L1T1".
Bug: webrtc:11607
Change-Id: I81e8ead4a2cc15de6c21c7ee852e909af38b0567
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258127
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36474}
2022-04-07 07:32:15 +00:00
Erik Språng
e4589cb55e Reduce libvpx VP9 complexity setting on <= 2 core machines.
This CL sets speed 9 for all resolutions when two or less cores are
available, as a heuristic for a "slow" machine.
This gives a large speed bost at a relatively small quality loss.

A field-trial kill-switch is available to override this behavior.

Bug: webrtc:13888
Change-Id: I24278a45de000ad7984d0525c47d9eb6b9ab6b60
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257421
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36466}
2022-04-06 16:08:00 +00:00
Jerome Jiang
a78c949772 Add support for screen content
Bug: webrtc:13929
Change-Id: Ie5463aadcd255bd7c63d4e529030ef85145fd08c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257960
Reviewed-by: Marco Paniconi <marpan@google.com>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/main@{#36451}
2022-04-05 17:35:20 +00:00
Erik Språng
3225385b3e VP9 per layer settings should not force denoising.
In r36379 a change to per-resolution setting of denoising was introduced
that unintentionally enabled denoising on lower resolutions in the case
that VideoCodec::VP9()->denoising was false.
The CL makes sure the per-resolution setting are only allowed to
disable denoising, not enable it.

Bug: webrtc:13888
Change-Id: Ice07a5a7d27798dc2182a40af0ec521bde6210b6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257303
Reviewed-by: Ying Wang <yinwa@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36412}
2022-04-02 22:03:21 +00:00
Erik Språng
3be87e9afd Reduce VP9 complexity for 1080p and up.
This CL changes the default speed settings for TL0/TL[1-2] from
7/8 to 9/9 at 1080p resolutions and up. We also disable the denoiser
at these resolutions.
Settings can be overriden using existing WebRTC-VP9-PerformanceFlags
field trial.

Bug: webrtc:13888
Change-Id: I70f19efdace88d70bbb90bc6dd5149653eb079c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257141
Reviewed-by: Ying Wang <yinwa@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36379}
2022-03-30 14:22:31 +00:00
philipel
ab68a914d6 Don't dereference null buffer in the LibaomAv1Encoder.
No-Try: True
Bug: webrtc:13746
Change-Id: I6e467462c16abc0f3943c6c629d77a7ddaeb682a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257161
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36377}
2022-03-30 12:54:38 +00:00
Jonas Oreland
e62c2f2c77 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 12/inf
rename WebRtcKeyValueConfig to FieldTrialsView

Bug: webrtc:10335
Change-Id: If725bd498c4c3daf144bee638230fa089fdde833
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256965
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36365}
2022-03-29 10:14:00 +00:00
Sergio Garcia Murillo
b63536f5d3 add h264 422 decoding
Bug: webrtc:13826
Change-Id: Ic7296be69157a9aaf5f139a18fdb011b90f4caa1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255380
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36337}
2022-03-25 13:15:34 +00:00
Ilya Nikolaevskiy
1bcdafca0e Reland of remove NV12 to I420 conversion in webrtc AV1 Encoder.
libaom supports for NV12 inputs for encoding av1 stream. It will reduce
unnecessary conversion from NV12 to I420 format.
(https://bugs.chromium.org/p/aomedia/issues/detail?id=3232&q=3232&can=2)

Original CL reviewed at https://webrtc-review.googlesource.com/c/src/+/251920

Bug: webrtc:13746
Change-Id: I96cc99674f315518d98355cb90566e78bead3e55
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254340
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36306}
2022-03-23 16:33:32 +00:00
Jerome Jiang
aaf9d051c7 Lower hd av1 quality threshold
Bug: None
Change-Id: I2b7bfbd8f5a2be13ede11df30272e5b001471453
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255021
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36180}
2022-03-11 20:54:03 +00:00
Andrey Logvin
fef0026f2f Revert "Reland "remove NV12 to I420 conversion in webrtc AV1 Encoder.""
This reverts commit d7031692e3.

Reason for revert: Breaks downstream project

Original change's description:
> Reland "remove NV12 to I420 conversion in webrtc AV1 Encoder."
>
> This reverts commit 66557e1af3.
>
> Reason for revert: Some downstream projects seem to have an old libaom version with no NV12 support yet. It will be updated soon.
>
> Original change's description:
> > Revert "remove NV12 to I420 conversion in webrtc AV1 Encoder."
> >
> > This reverts commit 9558ab41eb.
> >
> > Reason for revert: speculative revert: breaks downstream project
> >
> > Original change's description:
> > > remove NV12 to I420 conversion in webrtc AV1 Encoder.
> > >
> > > libaom supports for NV12 inputs for encoding av1 stream. It will reduce
> > > unnecessary conversion from NV12 to I420 format.
> > > (https://bugs.chromium.org/p/aomedia/issues/detail?id=3232&q=3232&can=2)
> > >
> > > Bug: webrtc:13746
> > > Change-Id: I1407227d1690b3f63cb6581eef5d587e5f418892
> > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251920
> > > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> > > Commit-Queue: Shuhai Peng <shuhai.peng@intel.com>
> > > Cr-Commit-Position: refs/heads/main@{#36111}
> >
> > Bug: webrtc:13746
> > Change-Id: Ie928f7f5b5992337a9d186fa70b7fdec20a33f00
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/253122
> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Commit-Queue: Artem Titov <titovartem@webrtc.org>
> > Owners-Override: Artem Titov <titovartem@webrtc.org>
> > Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#36114}
>
> Bug: webrtc:13746
> Change-Id: Ib26ff6204abceb863b03d55e5953797c9ca27fc2
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/253215
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36156}

Bug: webrtc:13746
Change-Id: Ia9f8024bf70a82f8e26cd7a80d3020ed796c1b40
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254262
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36159}
2022-03-09 11:47:54 +00:00
Shuhai Peng
d7031692e3 Reland "remove NV12 to I420 conversion in webrtc AV1 Encoder."
This reverts commit 66557e1af3.

Reason for revert: Some downstream projects seem to have an old libaom version with no NV12 support yet. It will be updated soon.

Original change's description:
> Revert "remove NV12 to I420 conversion in webrtc AV1 Encoder."
>
> This reverts commit 9558ab41eb.
>
> Reason for revert: speculative revert: breaks downstream project
>
> Original change's description:
> > remove NV12 to I420 conversion in webrtc AV1 Encoder.
> >
> > libaom supports for NV12 inputs for encoding av1 stream. It will reduce
> > unnecessary conversion from NV12 to I420 format.
> > (https://bugs.chromium.org/p/aomedia/issues/detail?id=3232&q=3232&can=2)
> >
> > Bug: webrtc:13746
> > Change-Id: I1407227d1690b3f63cb6581eef5d587e5f418892
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251920
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> > Commit-Queue: Shuhai Peng <shuhai.peng@intel.com>
> > Cr-Commit-Position: refs/heads/main@{#36111}
>
> Bug: webrtc:13746
> Change-Id: Ie928f7f5b5992337a9d186fa70b7fdec20a33f00
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/253122
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Owners-Override: Artem Titov <titovartem@webrtc.org>
> Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36114}

Bug: webrtc:13746
Change-Id: Ib26ff6204abceb863b03d55e5953797c9ca27fc2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/253215
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36156}
2022-03-09 11:15:13 +00:00
Jerome Jiang
ddcfe405d3 Change PSNR threshold for av1 test
Bug: None
Change-Id: I47101a6625c2f1704599ea60ad3f2c05370da66e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254101
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/main@{#36151}
2022-03-08 22:14:51 +00:00
“Michael
15ee87fe0e Use VideoCodec complexity to determine AV1 encoder cpu_speed.
Bug: webrtc:13744
Change-Id: Ib6d62dcdf7346d886c0aca09735c7d5c1f3e2455
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252340
Reviewed-by: Erik Språng <sprang@webrtc.org>
Auto-Submit: Michael Horowitz <mhoro@google.com>
Commit-Queue: Michael Horowitz <mhoro@google.com>
Cr-Commit-Position: refs/heads/main@{#36125}
2022-03-03 19:06:17 +00:00
Artem Titov
66557e1af3 Revert "remove NV12 to I420 conversion in webrtc AV1 Encoder."
This reverts commit 9558ab41eb.

Reason for revert: speculative revert: breaks downstream project

Original change's description:
> remove NV12 to I420 conversion in webrtc AV1 Encoder.
>
> libaom supports for NV12 inputs for encoding av1 stream. It will reduce
> unnecessary conversion from NV12 to I420 format.
> (https://bugs.chromium.org/p/aomedia/issues/detail?id=3232&q=3232&can=2)
>
> Bug: webrtc:13746
> Change-Id: I1407227d1690b3f63cb6581eef5d587e5f418892
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251920
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Shuhai Peng <shuhai.peng@intel.com>
> Cr-Commit-Position: refs/heads/main@{#36111}

Bug: webrtc:13746
Change-Id: Ie928f7f5b5992337a9d186fa70b7fdec20a33f00
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/253122
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Owners-Override: Artem Titov <titovartem@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36114}
2022-03-02 16:01:28 +00:00
Shuhai Peng
9558ab41eb remove NV12 to I420 conversion in webrtc AV1 Encoder.
libaom supports for NV12 inputs for encoding av1 stream. It will reduce
unnecessary conversion from NV12 to I420 format.
(https://bugs.chromium.org/p/aomedia/issues/detail?id=3232&q=3232&can=2)

Bug: webrtc:13746
Change-Id: I1407227d1690b3f63cb6581eef5d587e5f418892
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251920
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Shuhai Peng <shuhai.peng@intel.com>
Cr-Commit-Position: refs/heads/main@{#36111}
2022-03-02 14:18:36 +00:00
“Michael
3147e29c4e Refactor encoder-complexity param in VideoCodec w/backward compatibility
Move complexity parameter to the main VideoCodec class to enable
additional video codecs to use the parameter without creating a new
codec-specific structure.

Bug: webrtc:13694
Change-Id: Icb7cf640b178875d799f39ade8b5084e3222bb1c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251921
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Michael Horowitz <mhoro@google.com>
Cr-Commit-Position: refs/heads/main@{#36040}
2022-02-21 19:40:44 +00:00
Sergey Silkin
454d2309de Add bitrate adaptation tests
Bug: none
Change-Id: I3e2c503efc7a85a3daaa40cd8118c1b02d3b81cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251680
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36013}
2022-02-16 10:25:13 +00:00
Sergey Silkin
0b02d637c0 Calculate max/avg encode/decode latency in codec tests
Bug: none
Change-Id: Ie42461dd06b1764c99308393477921ea25319ab4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251687
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36007}
2022-02-15 18:14:41 +00:00
Sergey Silkin
eb6c6fcf27 Fix delta frame delay calculation
The issue was introduced in https://webrtc-review.googlesource.com/c/src/+/132460.

Bug: webrtc:10412
Change-Id: I92d1bd2be63ea34d150145cec63c282f7aa49ce8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251683
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35989}
2022-02-14 11:15:50 +00:00
Stefan Mitic
ffdc6804bf Reland: Added support for H264 YUV444 (I444) decoding.
PS#1 is a reland of "Added support for H264 YUV444 (I444) decoding." https://webrtc-review.googlesource.com/c/src/+/235340

Bug: chromium:1251096
Change-Id: Icd997c7f7732229954d5494343b4e7a70deb09d1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251303
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35964}
2022-02-09 11:57:55 +00:00
Bohan Li
1f06508350 Update av1 video codec test threshold.
Bug: webrtc:13638
Change-Id: If17ae2519451953ac3e6054cb6cdc376594fe3d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250040
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Reviewed-by: Fyodor Kyslov <kyslov@google.com>
Commit-Queue: Bohan Li <bohanli@google.com>
Cr-Commit-Position: refs/heads/main@{#35874}
2022-02-01 20:43:08 +00:00
Ali Tofigh
1e157a9596 Remove more top-level const from parameters in function declarations
This CL removes even more top-level const from parameters in function
declarations. This change is safe because top-level const in function
declarations (not function definitions) are ignored by the compiler
and so change is just a no-op cleanup.

Bug: webrtc:13610
Change-Id: Icf6868c27b1fdb9d9915b3a7020eb34bdcf07a09
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249989
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35866}
2022-02-01 09:15:50 +00:00
Henrik Boström
3f42fdf19f Revert "Added support for H264 YUV444 (I444) decoding."
This reverts commit 3babb8af23.

Reason for revert:
- Causes regressions to transceivers, see https://crbug.com/1291956 for more information, including tests to reproduce the issue.

This CL is not a pure revert. While it reverts everything else, it does
keep the new enum value (kProfilePredictiveHigh444). This is as to not
break Chromium which already depend on it. It is not listed in the
kProfilePatterns though so the enum value should never be applicable.

Original change's description:
> Added support for H264 YUV444 (I444) decoding.
>
> Added Nutanix Inc. to the AUTHORS file.
>
> PS#1 is a reland of "Added support for H264 YUV444 (I444) decoding." https://webrtc-review.googlesource.com/c/src/+/234540
>
> Bug: chromium:1251096
> Change-Id: I99a1b1e4d8b60192ff96f92334a430240875c66c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235340
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35684}

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

Bug: chromium:1251096, chromium:1291956
Change-Id: Ib4d8ea4898f9832914d88e7076e6b39da0c804ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249791
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35835}
2022-01-29 10:45:39 +00:00
Ali Tofigh
62238097c9 Remove top-level const from parameters in function declarations.
This is a safe cleanup change since top-level const applied to
parameters in function declarations (that are not also
definitions) are ignored by the compiler. Hence, such changes do
not change the type of the declared functions and are simply
no-ops.

Bug: webrtc:13610
Change-Id: Ibafb92c45119a6d8bdb6f9109aa8dad6385163a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249086
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35802}
2022-01-26 11:05:25 +00:00
Byoungchan Lee
604fd2f1ab Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/
Bug: webrtc:13555, webrtc:13082
Change-Id: I2c2cbcbd918f0cfa970c1a964893220ba11d4b41
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247960
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35771}
2022-01-24 11:50:20 +00:00
philipel
95701503f2 Make libaom_av1_encoder always build the libaom encoder.
Currently `CreateLibaomAv1Encoder` will either return an actual libaom AV1 encoder or a nullptr depening on whether the build flag `enable_libaom` was configured to true or not. This CL updates the `libaom_av1_encoder` build target to no longer depend on `enable_libaom` so that `CreateLibaomAv1Encoder` will always return an encoder instance.

Added `CreateLibaomAv1EncoderIfSupported` as a replacement to the old `CreateLibaomAv1Encoder`.

Bug: webrtc:13573
Change-Id: Ibdcd52c609acd79feefa2b86f19d1b4ca3e91d0a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/242360
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35763}
2022-01-21 13:45:47 +00:00
Erik Språng
16cbed4782 Update how VP9 temporal up switch is populated
This CL updates both the static GOF pattern with the correct flags for
temporal_up_switch, as well the flexible mode logic to base the flag
on dependency descriptors instead use reference buffers.

Bug: webrtc:13576
Change-Id: I578f744bec51d1f3531da5f4a89d12f05a16a6c0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247187
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35741}
2022-01-19 15:42:21 +00:00
Erik Språng
4b5caee6b1 VP9 encoder: mark only base spatial layer as keyframe
Bug: webrtc:13576
Change-Id: Ia4173d3aa2c8e546a818eccc5d6c09d1150dcaf4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247188
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35736}
2022-01-19 11:09:34 +00:00
Niels Möller
ac0d18341d Prepare for deleting implicit conversion from raw pointer to scoped_refptr.
Updates all webrtc code, to have a small followup cl to just add the
"explicit" keyword. Patchset #24 passed all webrtc tests, with explicit.

Bug: webrtc:13464
Change-Id: I39863d3752f73209b531120f66916dc9177bf63a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/242363
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35718}
2022-01-18 08:22:15 +00:00
Sergey Silkin
3226e563d8 Reland "Disable frame dropping from codec settings."
This is a reland of 34aba3cefd

Original change's description:
> Disable frame dropping from codec settings.
>
> This was broken in https://webrtc-review.googlesource.com/c/src/+/99062/
>
> Bug: webrtc:9734
> Change-Id: Ibce41a732cb2e943354c87fbb05be0dd218acf27
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/242366
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35568}

Bug: webrtc:9734
Change-Id: I84efcab334b99aa08b07cc5e891681bfd5b2865f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247182
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35712}
2022-01-17 15:08:16 +00:00
Stefan Mitic
3babb8af23 Added support for H264 YUV444 (I444) decoding.
Added Nutanix Inc. to the AUTHORS file.

PS#1 is a reland of "Added support for H264 YUV444 (I444) decoding." https://webrtc-review.googlesource.com/c/src/+/234540

Bug: chromium:1251096
Change-Id: I99a1b1e4d8b60192ff96f92334a430240875c66c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235340
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35684}
2022-01-13 14:06:55 +00:00
Christoffer Jansson
31bd9fadb6 Disable Vp9ImplTest.DisableEnableBaseLayerWithSvcControllerTriggersKeyFrame
- Enable once a forward fix has landed in WebRTC

Bug: webrtc:13442
Change-Id: I0493fbbfbcf96e643d604406b350a3d315b24779
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/245601
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Christoffer Jansson <jansson@google.com>
Cr-Commit-Position: refs/heads/main@{#35670}
2022-01-12 16:43:38 +00:00
Christoffer Jansson
b82193cec8 Disable DisableEnableBaseLayerTriggersKeyFrame
- Enable once a forward fix has landed in WebRTC.

Bug: webrtc:13442
Change-Id: I295383b84a753e8e1f65006cc6a3c00b78033aa4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/245643
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Christoffer Jansson <jansson@google.com>
Cr-Commit-Position: refs/heads/main@{#35659}
2022-01-11 14:59:24 +00:00
Erik Språng
5e180749a1 Revert "Disable frame dropping from codec settings."
This reverts commit 34aba3cefd.

Reason for revert: Has unintended consequences for vp8 simulcast screenshare.

Original change's description:
> Disable frame dropping from codec settings.
>
> This was broken in https://webrtc-review.googlesource.com/c/src/+/99062/
>
> Bug: webrtc:9734
> Change-Id: Ibce41a732cb2e943354c87fbb05be0dd218acf27
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/242366
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35568}

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

Bug: webrtc:9734
Change-Id: I8a4758f6e915f40f89cc45f9530838b6cf6d1a49
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/242964
Reviewed-by: Erik Språng <sprang@webrtc.org>
Auto-Submit: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35591}
2021-12-29 12:22:27 +00:00
Sergey Silkin
34aba3cefd Disable frame dropping from codec settings.
This was broken in https://webrtc-review.googlesource.com/c/src/+/99062/

Bug: webrtc:9734
Change-Id: Ibce41a732cb2e943354c87fbb05be0dd218acf27
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/242366
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35568}
2021-12-22 12:36:17 +00:00
Markus Handell
8d87c463d9 ZeroHertzAdapterMode: slow down repeats on quality convergence.
The frame cadence adapter previously resulted in unconditional
frame repeating at max FPS. Change this to slow down to an idle
rate (1 Hz) when quality convergence in all configured spatial
layers has been achieved.

go/rtc-0hz-present

Bug: chromium:1255737
Change-Id: Ifa593dbf8a61aa29da20ac250da332734ae82791
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/241421
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35547}
2021-12-16 12:01:30 +00:00
Konrad Hofbauer
d2cd8722cd Consider frame orientation for number of spatial layers in VP9.
Addresses case where 540*960 would not get a 135*240 layer.

Bug: webrtc:13469
Change-Id: Icc291c65114fb400cc71659d76a786e359e5996c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239820
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Konrad Hofbauer <hofbauer@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35507}
2021-12-09 09:39:50 +00:00
philipel
0763ccc8e3 Don't configure SVC params without per layer bitrate configured.
Change-Id: Ieb200ce1a710078e380047ed8af73db0c5e0c751
Bug: none
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239442
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35457}
2021-12-02 09:52:32 +00:00
Sergey Silkin
144e5bf87d Use NONE if scalability mode is not specified
Bug: none
Change-Id: I8ffdb7fc41dec3c5b37483a6dcbb8fe7f03b59da
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238984
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35418}
2021-11-25 13:50:14 +00:00
philipel
b09d87232b Reland "Add dav1d decoder to WebRTC."
This reverts commit 8498b7e7f6.

Reason for revert: Updating CL to include conditional build flag.

Original change's description:
> Revert "Add dav1d decoder to WebRTC."
>
> This reverts commit 147858577d.
>
> Reason for revert: High binary size increase
>
> Original change's description:
> > Add dav1d decoder to WebRTC.
> >
> > Bug: none
> > Change-Id: I7642f42e592dcf510679f881f118bc4dab93b31c
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237504
> > Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
> > Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#35394}
>
> TBR=danilchap@webrtc.org,mbonadei@webrtc.org,ilnik@webrtc.org,philipel@webrtc.org,mflodman@webrtc.org,ssilkin@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I00a8acd6ea94ce523c2d5ba705333c9174678180
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: none
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238560
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
> Owners-Override: Artem Titov <titovartem@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35395}

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

Bug: none
Change-Id: Iff51848731646159e87e075c38af7cb6355f5b5b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238661
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35409}
2021-11-23 15:59:58 +00:00
Sergey Silkin
984cf9b837 Explicitly set encoder and decoder format in codec tests.
This allows to differentiate and test codecs of the same type but
different implementations/settings.

Bug: none
Change-Id: I74f799b36411e63387513133ffc19a7f0c45d550
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238165
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35396}
2021-11-22 08:18:25 +00:00
Artem Titov
8498b7e7f6 Revert "Add dav1d decoder to WebRTC."
This reverts commit 147858577d.

Reason for revert: High binary size increase

Original change's description:
> Add dav1d decoder to WebRTC.
>
> Bug: none
> Change-Id: I7642f42e592dcf510679f881f118bc4dab93b31c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237504
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35394}

TBR=danilchap@webrtc.org,mbonadei@webrtc.org,ilnik@webrtc.org,philipel@webrtc.org,mflodman@webrtc.org,ssilkin@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I00a8acd6ea94ce523c2d5ba705333c9174678180
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238560
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35395}
2021-11-19 18:47:42 +00:00
philipel
147858577d Add dav1d decoder to WebRTC.
Bug: none
Change-Id: I7642f42e592dcf510679f881f118bc4dab93b31c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237504
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35394}
2021-11-19 15:03:12 +00:00
Niels Möller
13d163654a Delete support for has_internal_source
Bug: webrtc:12875
Change-Id: I9683e71e1fe5b24802033ffcb32a531ca685fc6f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179220
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35353}
2021-11-16 11:29:40 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
Zhaoliang Ma
528e4898e7 Set correct spatial layer number in FrameEncodeMetadataWriter
This CL set the spatial id in LibaomAv1Encoder and set correct number
of spatial layers for AV1 in FrameEncodeMetadataWriter.

Bug: None
Change-Id: I40092e45be88ec9ab75f228d9ca84c44e3cad326
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237662
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Zhaoliang Ma <zhaoliang.ma@intel.com>
Cr-Commit-Position: refs/heads/main@{#35339}
2021-11-15 03:34:18 +00:00
Niek van der Maas
dfec7a664b Added main profile to supported H264 codecs
This adds the Main 3.1 profile to the list of supported H264 codecs. This unifies the output of WebRTC codecs among macOS/Windows (which both have Main 3.1 codecs) and headless Linux browsers.

Bug: None
Change-Id: Ife2fe8c1827be9368fabccc5f24ba316671b1b8b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236600
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35328}
2021-11-10 10:56:13 +00:00
Harald Alvestrand
97597c0f51 Remove usage of INFO alias for LS_INFO in log messages
Bug: webrtc:13362
Change-Id: Ifda893861a036a85c045cd366f9eab33c62ebde0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237221
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35310}
2021-11-04 13:46:17 +00:00
philipel
d3eb8f1152 libaom AV1 encoder wrapper cleanup.
Bug: none
Change-Id: Ia62ab4653a1c95e7a609d767d76f7e7c64c0e751
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236843
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35292}
2021-11-01 13:58:32 +00:00
philipel
448231d654 Always call aom_codec_encode for every spatial layer in the libaom AV1 encoder wrapper.
Bug: none
Change-Id: I8556c4ba14393b958f4012fe9942af5523aae356
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236341
Reviewed-by: Marco Paniconi <marpan@google.com>
Reviewed-by: Jerome Jiang <jianj@google.com>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35280}
2021-10-29 09:44:00 +00:00
Emil Lundmark
d891c4940a Configure generic temporal layer in VP8 screenshare
This ensures that the payload descriptor and potential generic
descriptors uses the same temporal layer.

Bug: b/200518293
Change-Id: I17e980b47fe6c814cb393fc459064576447aa27a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236520
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35275}
2021-10-28 14:32:49 +00:00
Jerome Jiang
f33fc35277 Set rates for av1 svc tests
Bug: webrtc:11404
Change-Id: I79c4cee99d1bee1cdd3a8e0f901fadc6178a07a6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235602
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/main@{#35250}
2021-10-20 16:52:53 +00:00
Emil Lundmark
823ba0b038 Cleanup WebRTC-Vp9DependencyDescriptor field trial
Bug: chromium:1178444
Change-Id: Ie2ec796e207fa427fdbe00c8ea41a6b4fefea155
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235374
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35241}
2021-10-19 14:29:29 +00:00
Ying Wang
d7dd0aa9ee Move sendtask after decoded frame writer is initialized.
Bug: webrtc:13293
Change-Id: Ic71f92a5204715480e207f908f70ffff63e31279
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235580
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35235}
2021-10-19 11:32:33 +00:00
Ilya Nikolaevskiy
54f377308f Revert "Added support for H264 YUV444 (I444) decoding."
This reverts commit 7d8ed34372.

Reason for revert: Breaks internal builds

Original change's description:
> Added support for H264 YUV444 (I444) decoding.
>
> Added Nutanix Inc. to the AUTHORS file.
>
> Bug: chromium:1251096
> Change-Id: Ib47c2b1f94797afb6c5090f3c46eae6f13110992
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234540
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35200}

TBR=ilnik@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,peterhanspers@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com,stefan.mitic@nutanix.com

Change-Id: I3048c353a2b6b4f3d4e5e53a88f48b456f1ce593
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1251096
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235203
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35207}
2021-10-14 12:59:29 +00:00
Stefan Mitic
7d8ed34372 Added support for H264 YUV444 (I444) decoding.
Added Nutanix Inc. to the AUTHORS file.

Bug: chromium:1251096
Change-Id: Ib47c2b1f94797afb6c5090f3c46eae6f13110992
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234540
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35200}
2021-10-14 11:06:55 +00:00
Jiwon Jung
5a79d28eba Require 16x16 alignment when using HardwareVideoEncoder for encoding.
It seems the Android CTS tests only verify that 16x16 aligned resolutions
are supported.

This change checks the validity of input frame's size when initialing
or encoding processes are about to start using H/W MediaCodec.

This change has additional APIs to retrieve
|requested_resolution_alignment| and |apply_alignment_to_all_simulcast_layers|
from JAVA VideoEncoder class and its inherited classes. HardwareVideoEncoder
using MediaCodec has values of 16 and true for above variables.

Bug: webrtc:13089
Change-Id: I0c4ebf94eb36da29c2e384a3edf85b82e779b7f9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229460
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35169}
2021-10-08 13:15:12 +00:00
Emil Lundmark
7b35b44b52 Zero initialize heap allocations in LibvpxVp9{Decoder,Encoder}
Bug: chromium:1251010
Change-Id: Iffefdc8bee3752f89b0201f56fd06a2253b53200
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232602
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35049}
2021-09-21 09:24:09 +00:00
Emil Lundmark
b01e6457fe Reland "Reland "Enable WebRTC-Vp9DependencyDescriptor by default""
This is a reland of b062829311

> Reland "Enable WebRTC-Vp9DependencyDescriptor by default"
>
> This is a reland of 4727071506
>
> Original change's description:
> > Enable WebRTC-Vp9DependencyDescriptor by default
> >
> > Bug: chromium:1178444
> > Change-Id: I420e1e9b3c557b8b186cb08c15b962a779e1ca17
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226941
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#34584}
>
> Bug: chromium:1178444
> Change-Id: I874412b41e657179be6ffbe399617e18a29ec804
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230121
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#34890}

Bug: chromium:1178444
Change-Id: I5bb3e3bd2da26f9a24d5e8161bd66b447543fc8e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231843
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35004}
2021-09-15 13:48:58 +00:00
Johannes Kron
b26863ed0c Reland "Handle scalability mode in QueryCodecSupport"
This reverts commit 74281bed53.

Reason for revert: Fixed unit test by removing VP9 profile 2 from encoder factory unit test since this is platform dependent.

Original change's description:
> Revert "Handle scalability mode in QueryCodecSupport"
>
> This reverts commit 715a148118.
>
> Reason for revert: Speculative revert. Breaks upstream project http://b/200009579
>
> Original change's description:
> > Handle scalability mode in QueryCodecSupport
> >
> > All valid scalability modes should be supported by the builtin
> > software decoder/encoder.
> >
> > Bug: chromium:1187565
> > Change-Id: If66105d210d5055019f35dae2f80a18ad4a70cdd
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222642
> > Commit-Queue: Johannes Kron <kron@webrtc.org>
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#34998}
>
> TBR=danilchap@webrtc.org,sprang@webrtc.org,kron@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: Ibf40d523c50791d73e2afdc3917892b859d2bcb6
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:1187565
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232020
> Reviewed-by: Andrey Logvin <landrey@webrtc.org>
> Commit-Queue: Andrey Logvin <landrey@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35001}


Bug: chromium:1187565
Change-Id: I598a2a530b8fea22997bbb5910eb3b864d1e28a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232021
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35003}
2021-09-15 13:12:58 +00:00
Andrey Logvin
74281bed53 Revert "Handle scalability mode in QueryCodecSupport"
This reverts commit 715a148118.

Reason for revert: Speculative revert. Breaks upstream project http://b/200009579

Original change's description:
> Handle scalability mode in QueryCodecSupport
>
> All valid scalability modes should be supported by the builtin
> software decoder/encoder.
>
> Bug: chromium:1187565
> Change-Id: If66105d210d5055019f35dae2f80a18ad4a70cdd
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222642
> Commit-Queue: Johannes Kron <kron@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#34998}

TBR=danilchap@webrtc.org,sprang@webrtc.org,kron@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: Ibf40d523c50791d73e2afdc3917892b859d2bcb6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1187565
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232020
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35001}
2021-09-15 10:45:41 +00:00
Johannes Kron
715a148118 Handle scalability mode in QueryCodecSupport
All valid scalability modes should be supported by the builtin
software decoder/encoder.

Bug: chromium:1187565
Change-Id: If66105d210d5055019f35dae2f80a18ad4a70cdd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222642
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34998}
2021-09-15 09:38:12 +00:00
Emil Lundmark
baa6090825 Fix SVC controller's bitrate allocation in VP9 encoder
Unlike libvpx, the VideoBitrateAllocation expects that the bitrate
allocation is separate for each temporal layer. In this instance, if the
bitrates are not separated it will fool the SVC controller into thinking
that all temporal layers are always active.

Bug: webrtc:11999
Change-Id: Ibc33ac00b8b7716c011b94e1ec9c640cedb5274e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231693
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34980}
2021-09-13 15:36:13 +00:00
Danil Chapovalov
32b917ac41 With Svc controller do not produce frame that will be dropped anyway
This cover scenario where target bitrate is changed in a middle of
of group of frame after spatial upswitch.
This change should avoid wasting encoder resources to produce those
frames, reduce number of errors
"Encoder produced a frame for layer that wasn't requested"

Bug: webrtc:11999
Change-Id: I06045259b1cee2c21bfdabbafff3892b57c82a84
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230543
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34969}
2021-09-10 13:57:35 +00:00
Emil Lundmark
5498676edd Revert "Reland "Enable WebRTC-Vp9DependencyDescriptor by default""
This reverts commit b062829311.

Reason for revert: Still causes crashes in perf tests.

Original change's description:
> Reland "Enable WebRTC-Vp9DependencyDescriptor by default"
>
> This is a reland of 4727071506
>
> Original change's description:
> > Enable WebRTC-Vp9DependencyDescriptor by default
> >
> > Bug: chromium:1178444
> > Change-Id: I420e1e9b3c557b8b186cb08c15b962a779e1ca17
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226941
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#34584}
>
> Bug: chromium:1178444
> Change-Id: I874412b41e657179be6ffbe399617e18a29ec804
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230121
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#34890}

Bug: chromium:1178444
Change-Id: I8a789ee60d0cca6db72612ef3660fe595255c537
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231221
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34928}
2021-09-06 13:11:51 +00:00
Emil Lundmark
b062829311 Reland "Enable WebRTC-Vp9DependencyDescriptor by default"
This is a reland of 4727071506

Original change's description:
> Enable WebRTC-Vp9DependencyDescriptor by default
>
> Bug: chromium:1178444
> Change-Id: I420e1e9b3c557b8b186cb08c15b962a779e1ca17
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226941
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34584}

Bug: chromium:1178444
Change-Id: I874412b41e657179be6ffbe399617e18a29ec804
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230121
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34890}
2021-09-01 09:27:39 +00:00
Johannes Kron
3cd7a0ffdd Remove media/base/h264_profile_level_id.* and media/base/vp9_profile.h
The content of these files was moved to api/video_codecs in
https://webrtc.googlesource.com/src.git/+/c3fcee7c3a7714afc3e37d4753b40f4fdbc3653e
but the original files could not be removed due to dependencies
in downstream projects.

Bug: chromium:1187565
Change-Id: I414efa22102bfdea0765fa72a8cf8b0bd5c090db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229303
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34869}
2021-08-30 10:31:08 +00:00
Åsa Persson
062acd9eb4 Move frame drop functionality in VideoAdapter into a separate class.
This class will replace modules/video_coding/utility/framerate_controller.h

Bug: webrtc:13031
Change-Id: I8faa9c3c158b7c5ab0618e3504224c7e00f8e0b1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227350
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34802}
2021-08-19 11:50:41 +00:00
Danil Chapovalov
b6f19d7dfd Reland "Update remaining usage of VideoDecoder::InitDecode to Configure"
This reverts commit d6da4c23cc.

Reason for revert: downstream project adjusted

Original change's description:
> Revert "Update remaining usage of VideoDecoder::InitDecode to Configure"
>
> This reverts commit ca0a08ab60.
>
> Reason for revert: Breaks downstream project.
>
> Original change's description:
> > Update remaining usage of VideoDecoder::InitDecode to Configure
> >
> > Bug: webrtc:13045
> > Change-Id: I5253fddfd613cf0228fc3cd861b91e56558dd34a
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228947
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#34777}
>
> TBR=danilchap@webrtc.org,sprang@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I1868700a43b5aa4b37e9bcba5af233d24526c974
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:13045
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229024
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34780}

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

Bug: webrtc:13045
Change-Id: I5a44e7126f9f2e405f3be6b84698de53b23203a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229183
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34795}
2021-08-18 15:58:40 +00:00
Erik Språng
e57a493301 Reland "Rename vp9::FrameInfo to vp9::UncompressedHeader and add more fields."
This is a reland of 3097008de0

Patchset 1 is a pure reland. Patchset 2 contains a bugfix plus a test
covering that case.

Bug: webrtc:12354, chromium:1230448

Original change's description:
> Rename vp9::FrameInfo to vp9::UncompressedHeader and add more fields.
>
> These fields will be used for bitstream validation in upcoming CLs.
> A new vp9_constants.h file is also added, containing common constants
> defined by the bitstream spec.
>
> Bug: webrtc:12354
> Change-Id: If04256d83409069c8bee43ad41aed41c3707dfd3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226060
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34476}

Bug: webrtc:12354
Change-Id: Ibd301eb458a6104b562cefbc0e616c39b54fb38b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229060
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34789}
2021-08-17 19:42:00 +00:00
Sergey Silkin
1fdafaeb21 Calculate bitrate and frame rate mismatches in video codec tests
Bug: webrtc:10812
Change-Id: I3408c0d7adefc37d088a5c6e10fce4f95aa1b668
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228943
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34782}
2021-08-17 10:33:08 +00:00
Mirko Bonadei
d6da4c23cc Revert "Update remaining usage of VideoDecoder::InitDecode to Configure"
This reverts commit ca0a08ab60.

Reason for revert: Breaks downstream project.

Original change's description:
> Update remaining usage of VideoDecoder::InitDecode to Configure
>
> Bug: webrtc:13045
> Change-Id: I5253fddfd613cf0228fc3cd861b91e56558dd34a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228947
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34777}

TBR=danilchap@webrtc.org,sprang@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I1868700a43b5aa4b37e9bcba5af233d24526c974
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:13045
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229024
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34780}
2021-08-17 09:35:28 +00:00
Danil Chapovalov
ca0a08ab60 Update remaining usage of VideoDecoder::InitDecode to Configure
Bug: webrtc:13045
Change-Id: I5253fddfd613cf0228fc3cd861b91e56558dd34a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228947
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34777}
2021-08-17 08:48:30 +00:00
Philipp Hancke
0c2a9caf8f fix some typos
BUG=None

Change-Id: If793268a5773dfab6a40bbd4ffa760f3d4cb5a46
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228428
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34745}
2021-08-12 18:37:10 +00:00
Danil Chapovalov
53d4be223b Migrate software decoders to new VideoDecoder::Configure
Bug: webrtc:13045
Change-Id: I1fa28a7c2dd59f0889d98c8ec5f58161c0ec9f95
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228380
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34716}
2021-08-11 09:16:22 +00:00
Artem Titov
cfea2182f8 Use backticks not vertical bars to denote variables in comments
Bug: webrtc:12338
Change-Id: I89c8b3a328d04203177522cbdfd9e606fd4bce4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228246
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34696}
2021-08-10 10:40:03 +00:00
‘Michael
37c155088e Reland "Updated the default VP9 per-spatial-temporal layer settings."
This is a reland of 99fb5945b9

Downstream project has been fixed.

Original change's description:
> Updated the default VP9 per-spatial-temporal layer settings.
>
> Bug: webrtc:11551
> Change-Id: If2029df444f576b41bfef302985d6e18d7cdc3b5
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227782
> Commit-Queue: Michael Horowitz <mhoro@google.com>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34668}

Bug: webrtc:11551
Change-Id: I23a87408f1a9df3a9ccb874698ff97f59cfbe791
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228280
Commit-Queue: Michael Horowitz <mhoro@google.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34688}
2021-08-09 17:42:35 +00:00
Artem Titov
dcd7fc7ea8 Use backticks not vertical bars to denote variables in comments for /modules/video_coding
Bug: webrtc:12338
Change-Id: Ia8a9adea291d594e4f59a6a1203a7bfb0758adac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227165
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34684}
2021-08-09 15:26:22 +00:00
Andrey Logvin
3754e7c7ad Revert "Updated the default VP9 per-spatial-temporal layer settings."
This reverts commit 99fb5945b9.

Reason for revert: Speculative revert: breaks upstream project

Original change's description:
> Updated the default VP9 per-spatial-temporal layer settings.
>
> Bug: webrtc:11551
> Change-Id: If2029df444f576b41bfef302985d6e18d7cdc3b5
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227782
> Commit-Queue: Michael Horowitz <mhoro@google.com>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34668}

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

Bug: webrtc:11551
Change-Id: Ief33f98d8a4e0ccf95d7004c2526c99829807d15
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228162
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34673}
2021-08-09 10:14:32 +00:00
‘Michael
99fb5945b9 Updated the default VP9 per-spatial-temporal layer settings.
Bug: webrtc:11551
Change-Id: If2029df444f576b41bfef302985d6e18d7cdc3b5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227782
Commit-Queue: Michael Horowitz <mhoro@google.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34668}
2021-08-06 21:12:20 +00:00
Björn Terelius
53adc7b1c8 Revert "Enable WebRTC-Vp9DependencyDescriptor by default"
This reverts commit 4727071506.

Reason for revert: Suspected cause for crashes in perf tests.

Original change's description:
> Enable WebRTC-Vp9DependencyDescriptor by default
>
> Bug: chromium:1178444
> Change-Id: I420e1e9b3c557b8b186cb08c15b962a779e1ca17
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226941
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34584}

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

Bug: chromium:1178444
Change-Id: I582d6d1c9d2091ca37b0943235b5cea8d4e2790d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227282
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34619}
2021-08-02 09:52:24 +00:00
Emil Lundmark
4727071506 Enable WebRTC-Vp9DependencyDescriptor by default
Bug: chromium:1178444
Change-Id: I420e1e9b3c557b8b186cb08c15b962a779e1ca17
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226941
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34584}
2021-07-28 12:08:36 +00:00
Danil Chapovalov
5219c6f7ad Delete legacy forwarding header svc_rate_allocator.h
Bug: None
Change-Id: I8a73f1139560b8e5a654948497751e9515aa7b92
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227029
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34581}
2021-07-28 08:54:03 +00:00
Byoungchan Lee
75ac5ab859 Remove workaround for Android VideoFrame's ToI420() returning wrong type
Bug: webrtc:12602
Change-Id: I466a2751314fcff53051b63d77e4d5298368a095
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227040
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/master@{#34574}
2021-07-27 20:27:52 +00:00
Mirko Bonadei
190244bb59 Remove all #include <assert.h>/<cassert> and usage in Obj-C code.
This CL completes the removal of assert() and relative headers from
the codebase (excluded
//examples/objc/AppRTCMobile/third_party/SocketRocket which is in a
third_party sub-directory).

Bug: webrtc:6779
Change-Id: I93ed57168d2c0e011626873d66529488c5f484f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225546
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34528}
2021-07-22 14:00:26 +00:00
Erik Språng
62af58448e Revert "Rename vp9::FrameInfo to vp9::UncompressedHeader and add more fields."
This reverts commit 3097008de0.

Reason for revert: suspected crash
Bug: chromium:1230239
TBR=philipel@webrtc.org

Original change's description:
> Rename vp9::FrameInfo to vp9::UncompressedHeader and add more fields.
>
> These fields will be used for bitstream validation in upcoming CLs.
> A new vp9_constants.h file is also added, containing common constants
> defined by the bitstream spec.
>
> Bug: webrtc:12354
> Change-Id: If04256d83409069c8bee43ad41aed41c3707dfd3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226060
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34476}

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

Bug: webrtc:12354
Change-Id: Ia4d5180d593c66a053d5747e714a579c62ea2a37
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226327
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34496}
2021-07-17 18:00:23 +00:00
Erik Språng
3097008de0 Rename vp9::FrameInfo to vp9::UncompressedHeader and add more fields.
These fields will be used for bitstream validation in upcoming CLs.
A new vp9_constants.h file is also added, containing common constants
defined by the bitstream spec.

Bug: webrtc:12354
Change-Id: If04256d83409069c8bee43ad41aed41c3707dfd3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226060
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34476}
2021-07-15 11:25:25 +00:00
Sergey Silkin
d6afbead2d Correctly set number of reference buffers in H264 encoder
iNumRefFrame specifies total number of reference buffers to allocate.
For N temporal layers we need at least (N - 1) buffers to store last
encoded frames of all reference temporal layers.

There is no API in OpenH254 encoder to specify exact set of references
to be used to prediction of a given frame. Encoder can theoretically
use all available references.

Note that there is logic in OpenH264 which overrides iNumRefFrame to
max(iNumRefFrame, N - 1): https://source.chromium.org/chromium/chromium/src/+/main:third_party/openh264/src/codec/encoder/core/src/au_set.cpp;drc=8e90a2775c5b9448324fe8fef11d177cb65f36cc;l=122.
I.e., this change has no real effect. It only makes setup more clear.

Bug: none
Change-Id: If4b4970007e1cc55d8f052ea05213ab2e89a878f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225480
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34445}
2021-07-09 13:49:41 +00:00
Mirko Bonadei
25ab3228f3 Replace assert() with RTC_DCHECK().
CL partially auto-generated with:

git grep -l "\bassert(" | grep "\.[c|h]" | \
  xargs sed -i 's/\bassert(/RTC_DCHECK(/g'

And with:

git grep -l "RTC_DCHECK(false)" |  \
  xargs sed -i 's/RTC_DCHECK(false)/RTC_NOTREACHED()/g'

With some manual changes to include "rtc_base/checks.h" where
needed.

A follow-up CL will remove assert() from Obj-C code as well
and remove the #include of <assert.h>.

The choice to replace with RTC_DCHECK is because assert()
is because RTC_DCHECK has similar behavior as assert()
based on NDEBUG.

This CL also contains manual changes to switch from
basic RTC_DCHECK to other (preferred) versions like
RTC_DCHECK_GT (and similar).

Bug: webrtc:6779
Change-Id: I00bed8886e03d685a2f42324e34aef2c9b7a63b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224846
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34442}
2021-07-09 07:49:43 +00:00
Jerome Jiang
d45f9300b7 Add missing rate control settings for av1 wrapper
Bug: None
Change-Id: Ib2c22ca6ec57e85c7da5ebb0ac884ca9eeae3e5f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224523
Reviewed-by: Marco Paniconi <marpan@google.com>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#34404}
2021-07-01 21:34:56 +00:00
Christoffer Jansson
da9dfae850 Re-enable ChangeFramerateVP8 & ChangeBitrateVP8 for Android and iOS
Update expectations for ARM SOC's

Bug: webrtc:9267
Change-Id: I8d0d720ab7d4d086ccff92310396fc35f2222128
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223661
Commit-Queue: Christoffer Jansson <jansson@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34384}
2021-06-29 09:56:12 +00:00
Evan Shrubsole
f906ec40d4 Handle null return from ToI420 in encoders
In cases where ToI420 fails it should be able to return null.

Bug: webrtc:12877
Change-Id: Ia13859c104d978a29712ae10f8e15acada8406ac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222613
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#34342}
2021-06-21 12:45:11 +00:00
Henrik Boström
58126f92bf Update the only 3 remaining kFilterBilinear to kFilterBox.
Bilinear is faster but lesser quality, box is best quality. Our code
base has disagreed about which filter to use for quite some time,
causing aliasing bug reports. In an effort to avoid aliasing artifacts
and make our scaling filters more predictable, we're updating all uses
to kFilterBox.

WebRTC already uses kFilterBox everywhere except for these three
places. The main discrepency was between Chromium and WebRTC but that
has already been fixed. This CL fixes the last remaining bilinears.

This brings the WebRTC kFilterBox use count up from 11 to 14 and the
kFilterBilinear use count down from 3 to 0.

Bug: chromium:1212630
Change-Id: I5fe4aa92b9275d65b91ea97925533055d190d317
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221372
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34248}
2021-06-08 13:19:23 +00:00
Markus Handell
fccb052ee3 Add event traces to interesting places in WebRTC.
Bug: webrtc:12840
Change-Id: I2fe749039059c9f3d6da064dce10d9c24a27d02e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221044
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34199}
2021-06-02 13:06:04 +00:00
Erik Språng
486b0401c5 Make VP8 DefaultTemporalLayers always report TL count even with no rate.
If at creation of a VP8 encoder there is not enough bitrate to enable a
given spatial layer - the configuration won't be updated to indicate
the correct temporal layer count. This means GetEncoderInfo() will
indicate lack of temporal layer support, which triggers issues with
rate allocation.

This CL fixes that by always setting an initial bitrate of 0bps.

Bug: webrtc:12788
Change-Id: I10974e85446b58e597d2ca415eaf2550306ce986
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220929
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34198}
2021-06-02 10:35:07 +00:00
Erik Språng
f865444877 Make AV1 respect spatial layer active flag.
Bug: webrtc:12788
Change-Id: Ied629e1635b6ff9bf92fab2d1af708163f9dd28c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220928
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34189}
2021-06-01 16:07:25 +00:00
Ted Meyer
41a111d5b9 Switch to av_packet_alloc()
ffmpeg is going to be hiding the implementation of AVPacket, so we can't
allocate them on the stack anymore. av_init_packet is marked deprecated
on TOT ffmpeg, so remove its use everywhere in favor of av_packet_alloc
and av_packet_free.

Bug: chromium:1211508
Change-Id: I154311071123110dd749c71dec1ec2a0452b3908
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217780
Commit-Queue: Ted Meyer <tmathmeyer@google.com>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34106}
2021-05-24 23:33:08 +00:00
Henrik Boström
38f1d4bf8a [LibvpxVp8Encoder] Don't DCHECK crash if I420 is not equal to I420A.
In CL https://webrtc-review.googlesource.com/c/src/+/216323 we fixed
the issue where I420 and I420A not being equal would result in dropping
frames in release builds.

But we forgot to update the corresponding DCHECK, meaning the I420 not
being the same as I420A issue still causes crashes on debug builds.
(I must have been running a release build not to catch this before?)

This CL replaces the DCHECK_EQ with an RTC_NOTREACHED inside the
IsCompatibleVideoFrameBufferType check.

Because this only affects debug builds, this CL does not need to be
backmerged anywhere.

Bug: chromium:1203206
Change-Id: I101823e8bca293e94d0f7ce507fe78cedff3ea1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219281
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34048}
2021-05-19 08:48:46 +00:00
Zhaoliang Ma
074edf6016 Fix the VideoFrameType of super frame construction in VideoProcessor
When VideoFrameType for svc upper layer is kVideoFrameDelta for key pic,
the svc unittest will fail due to the wrong frame type for the super
frame of first key picture.

Bug: None
Change-Id: Iff026aaecb73890d3c45d2c88c9654a12d6fe3bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216461
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Zhaoliang Ma <zhaoliang.ma@intel.com>
Cr-Commit-Position: refs/heads/master@{#33986}
2021-05-12 02:21:45 +00:00
Erik Språng
fc88df81f6 Set new defaults for vp8 decoder deblocking params
Bug: webrtc:11551
Change-Id: Ica8d587c32b36500739120205dde954502e01c3f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217383
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33924}
2021-05-05 11:04:30 +00:00
Danil Chapovalov
c27c047e3e Set non-zero target bitrate for AV1 single spatial layer case
VideoCodecInitializer::SetupCodec never sets startBitrate,
so SetAv1SvcConfig shouldn't use it.

Bug: webrtc:12720
Change-Id: I04835dc27368f32c19132d93c72364173d7050fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217382
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33915}
2021-05-04 12:34:01 +00:00
Tommi
87f7090fd9 Replace more instances of rtc::RefCountedObject with make_ref_counted.
This is essentially replacing `new rtc::RefCountedObject` with
`rtc::make_ref_counted` in many files. In a couple of places I
made minor tweaks to make things compile such as adding parenthesis
when they were missing.

Bug: webrtc:12701
Change-Id: I3828dbf3ee0eb0232f3a47067474484ac2f4aed2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215973
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33852}
2021-04-27 17:01:59 +00:00
Henrik Boström
065ce9cb22 [LibvpxVp8Encoder] Allow I420A to be scaled to I420.
In Chromium, the I420ABufferInterface implementation uses the default
CropAndScale() implementation which converts to I420 in the process.

This should be OK, because we do not encode the alpha channel anyway,
so having WebRTC scaling ignore the alpha channel might even be a good
thing. Unfortunatety, an if statement in the LibvpxVp8Encoder did not
consider I420A and I420 to be the same, resulting in dropping perfectly
valid frames.

This CL fixes that by considering I420A and I420 "compatible" in a
comparison helper function. The problem only happens in this encoder,
so only this encoder needs to be fixed.

Bug: chromium:1203206
Change-Id: Iec434d4ada897c79e09914cac823148fd5b05e57
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216323
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33845}
2021-04-27 11:06:41 +00:00
Tomas Gunnarsson
e249d195e0 Make RefCountedObject require overriding virtual methods
Bug: webrtc:12701
Change-Id: Ia4ae4ad2e857cb8790d6ccfb6f88f07d52a8e91b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215967
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33831}
2021-04-26 11:05:19 +00:00
Johannes Kron
c3fcee7c3a Move h264_profile_level_id and vp9_profile to api/video_codecs
This is a refactor to simplify a follow-up CL of adding
SdpVideoFormat::IsSameCodec.

The original files media/base/h264_profile_level_id.* and
media/base/vp9_profile.h must be kept until downstream projects
stop using them.

Bug: chroimium:1187565
Change-Id: Ib39eca095a3d61939a914d9bffaf4b891ddd222f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215236
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33782}
2021-04-20 09:42:05 +00:00
Erik Språng
b6c3e89a8a Optimize VP8 DefaultTemporalLayers by reducing set/map usage
...though the big issue was probably that pending frames weren't being
culled properly in the case of frame dropping.

Bug: webrtc:12596
Change-Id: I9a03282b2a99087aa7c5650e57ce30fe0f0d3036
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214127
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33638}
2021-04-07 13:02:25 +00:00
Henrik Boström
3b4dd4c71a LibvpxVp8Encoder: Clarify RTC_LOG error message.
While debugging https://crbug.com/1195144 I found it useful to clarify
this log statement.

The log would say "When scaling [kNative], the image was unexpectedly
converted to [kI420]..." but not saying what it was trying to convert
it to. This CL adds: "... instead of [kNV12]."

Bug: chromium:1195144
Change-Id: I13e0040edf5d7d98d80ce674812f67dfb73be36e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214040
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33634}
2021-04-07 10:45:23 +00:00
Fyodor Kyslov
b454767f10 AV1: Use AOM_USAGE_REALTIME when creating encoder
libaom is compiled with REALTIME_ONLY option. Soon it will be impossible
to create encoder or request default config with usage other than
AOM_USAGE_REALTIME. Fixing the wrapper to use proper usage parameter

Bug: None
Change-Id: I862741a724e4a8524f22ae79700b3da6517dbfb2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214100
Commit-Queue: Fyodor Kyslov <kyslov@google.com>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33624}
2021-04-06 02:38:34 +00:00
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
Mirko Bonadei
20e4c80fbe Reland "Introduce RTC_NO_UNIQUE_ADDRESS."
This is a reland of f5e261aaf6

This CL disables RTC_NO_UNIQUE_ADDRESS on MSan builds since
there have been some issues.

Original change's description:
> Introduce RTC_NO_UNIQUE_ADDRESS.
>
> This macro introduces the possibility to suggest the compiler that a
> data member doesn't need an address different from other non static
> data members.
>
> The usage of a macro is to maintain portability since at the moment
> the attribute [[no_unique_address]] is only supported by clang
> with at least -std=c++11 but it should be supported by all the
> compilers starting from C++20.
>
> Bug: webrtc:11495
> Change-Id: I9f12b67b4422a2749649eaa6b004a67d5fd572d8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173331
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32246}

Bug: webrtc:11495, webrtc:12218
Change-Id: I4e6c7cc37d3daffad2407c9a2acfa897fa5b426a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189968
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32668}
2020-11-23 11:29:36 +00:00
Danil Chapovalov
06bbeb3398 in Av1 encoder wrapper communicate end_of_picture flag similar to VP9
In particular move end_of_picture flag out of vp9 specific information
since VP9 is not the only codec that can use spatial scalability and
thus need to distinguish layer frame and picture (aka temporal unit).

Bug: webrtc:12167
Change-Id: I0d046d8785fbea55281209ad099738c03ea7db96
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/192542
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32588}
2020-11-11 14:00:52 +00:00
Karl Wiberg
c95b939667 Introduce RTC_CHECK_NOTREACHED(), an always-checking RTC_NOTREACHED()
And use it in a few places that were using RTC_CHECK(false) or FATAL()
to do the exact same job. There should be no change in behavior.

Bug: none
Change-Id: I36d5e6bcf35fd41534e08a8c879fa0811b4f1967
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191963
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32567}
2020-11-09 10:47:55 +00:00
Danil Chapovalov
649648e722 Move SvcRateAllocator out of codecs/vp9 and make it not vp9 specific
to reuse it for scalable av1

Bug: webrtc:12148
Change-Id: I0d413c5466a2d66df3eea9cdf13687f4ddd1a843
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191765
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32560}
2020-11-05 18:35:37 +00:00
Mirko Bonadei
8cc6695652 Reformat python files checked by pylint (part 1/2).
After recently changing .pylintrc (see [1]) we discovered that
the presubmit check always checks all the python files when just
one python file gets updated.

This CL moves all these files one step closer to what the linter
wants.

Autogenerated with:

# Added all the files under pylint control to ~/Desktop/to-reformat
cat ~/Desktop/to-reformat | xargs sed -i '1i\\'
git cl format --python --full

This is part 1 out of 2. The second part will fix function names and
will not be automated.

[1] - https://webrtc-review.googlesource.com/c/src/+/186664

No-Presubmit: True
Bug: webrtc:12114
Change-Id: Idfec4d759f209a2090440d0af2413a1ddc01b841
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190980
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32530}
2020-10-30 10:13:11 +00:00
Sergey Silkin
b72cc6d670 Analyze quality of dropped frames in VideoProcessor.
Calculate quality metrics for dropped frames by comparing original
frame against last decoded one.

This feature makes comparison of encoders which do/don't drop frames
more fair.

The feature is controlled by analyze_quality_of_dropped_frames flag
and is disabled by default.

Bug: none
Change-Id: Ifab8df92d0b76e743ff3193c05d7c8dbd14921c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190660
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32518}
2020-10-29 08:23:49 +00:00
philipel
1b0d5437c9 Removed _completeFrame since we never allow incomplete frames.
In the old jitter buffer the two VCMVideoProtection modes |kProtectionNone| and |kProtectionFEC| could be set on the jitter buffer for it to not wait for NACK and instead generate incomplete frames. This has not been possible for a long time.

Bug: webrtc:9378, webrtc:7408
Change-Id: I0a2d3ec34d721126c1128306d5fad88314f8d59f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190680
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32513}
2020-10-28 16:00:27 +00:00
Sergey Silkin
18e6edd57a Change SPS/PPS id update strategy to SPS_LISTING.
INCREASING_ID, which is the default mode, triggers HW reset in chromium
decoder wrapper. Set eSpsPpsIdStrategy to SPS_LISTING to prevent that.

Note that WebRTC always resets the encoder on resolution change. This
makes all strategies except INCREASING_ID essentially equivalent to
CONSTANT_ID.

Bug: chromium:1111273
Change-Id: I37405c97b3390f812d1dcaa111694b3b1d638035
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190440
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32505}
2020-10-27 10:56:54 +00:00
Fabien Vallée
f8b5bfeaf2 Fix "control reaches end of non-void function" warnings
"warning: control reaches end of non-void function [-Wreturn-type]"
Reported by gcc (8.3)

In all the reported cases, the end of function is never actually
reached. Add RTC_CHECK(false) to ensure the compiler is aware that
this path is a dead-end.

Bug: webrtc:12008
Change-Id: I7f816fde3d1897ed2774057c7e05da66e1895e60
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189784
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Fabien VALLÉE <fabien.vallee@netgem.com>
Cr-Commit-Position: refs/heads/master@{#32503}
2020-10-27 10:22:23 +00:00
Erik Språng
5a04ef6ca4 Tweaks videocodec_test threshold for arm vp8 simulcast
Bug: webrtc:10155
Change-Id: If4fc89c1aec34ac5775154315cc50779bbee4ee5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190285
Reviewed-by: Ying Wang <yinwa@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32495}
2020-10-26 17:25:12 +00:00
Erik Språng
9d69cbeabf Changes default pacing factor to 1.1x
This changes the default behavior to use pacing factor of 1.1x instead
of 2.5x, it also sets libvpx rate controler as trusted, turns on the
encoder pushback mechanism and sets spatial hysteresis to 1.2.
The unused "dynamic rate" settings in libvpx is removed.

The new settings matches what has been used in chromium since 2019.
If needed, the legacy behavior can be enabled using the field trial
WebRTC-VideoRateControl.

Bug: webrtc:10155
Change-Id: I8186b491aa5bef61e8f568e96c980ca68f0c208f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186661
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32477}
2020-10-23 13:43:32 +00:00
Danil Chapovalov
42aab25b7f In Vp9 wrapper allow to use ScalableVideoController with simulcast structures
Bug: webrtc:11999
Change-Id: Ifed99e8676a75f869a7df6b3ac64a6ad1c29c62f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189550
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32452}
2020-10-20 14:16:50 +00:00
Danil Chapovalov
9f4859e5e3 Allow to set av1 scalability mode after encoder is constructed
Bug: webrtc:11404
Change-Id: I70b4115c8afdc4f32fd876d31d54b7d95d0a7e1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188582
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32437}
2020-10-19 10:42:23 +00:00
Danil Chapovalov
5ad731ad89 In VP9 wrapper fill information required to produce Dependency Descriptor
Bug: webrtc:11999
Change-Id: Id20575fca5b9279adccf1498165815aa16e044af
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187340
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32421}
2020-10-16 09:20:07 +00:00
Danil Chapovalov
da7fe39b84 Move scalability structures from av1 into own subfolder
To make it natural to reuse them for vp9

Bug: webrtc:11999
Change-Id: If2ef7ca16b8be96e0e03bb19211d9f5eb74b2d3d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188620
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32414}
2020-10-15 15:21:46 +00:00
Danil Chapovalov
c85baeb485 Refactor ScalableVideoController::OnEncodeDone signature
to make it a bit simpler

Bug: None
Change-Id: Ie6288594c5a1b8535007623032b422eefc716ca6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188460
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32405}
2020-10-14 17:48:11 +00:00
Evan Shrubsole
602b13ac87 Reland "NV12 support for VP8 simulcast"
This is a reland of 76d3e7a8d1

I have run the WPT tests and ensured they are now passing with this
change. I have changed the following,

- The old CL was assuming that ToI420 frames had type I420, but they
could be I420A which was causing a crash.
- I fixed a copy-paste error in the offset of the V stride.

Original change's description:
> NV12 support for VP8 simulcast
>
> Tested using video_loopback with generated NV12 frames.
>
> Bug: webrtc:11635, webrtc:11975
> Change-Id: I14b2d663c55a83d80e48e226fcf706cb18903193
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186722
> Commit-Queue: Evan Shrubsole <eshr@google.com>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32325}

Bug: webrtc:11635
Bug: webrtc:11975
Change-Id: Ifa790af97cd7ab30c6cb4648ebd140abc1593b0b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187490
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#32381}
2020-10-12 14:10:22 +00:00
Ilya Nikolaevskiy
1da46abbdd Fix quality scaler being accidentally enabled for VP9
Bug: webrtc:12026
Change-Id: If8361ff665f82741270336ddc110b4f0662c83b1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187483
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32380}
2020-10-12 09:40:44 +00:00
Danil Chapovalov
294729f33c Support layer skipping in full svc structures with 3 temporal layers
Bug: webrtc:11999
Change-Id: I09d9e9e83f43dc9e552f0dd72ba3e7e588fbab48
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187346
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32373}
2020-10-09 18:19:43 +00:00
Guido Urdaneta
7ef8093f2e Revert "NV12 support for VP8 simulcast"
This reverts commit 76d3e7a8d1.

Reason for revert: Causes multiple Chromium WPT tests to crash, preventing rolls.

Sample failed run:
https://ci.chromium.org/p/chromium/builders/try/win10_chromium_x64_rel_ng/685757?

Sample stack trace:
#0 0x7ff8623fbde9 base::debug::CollectStackTrace()
STDERR: #1 0x7ff862311ca3 [2665012:17:1009/162250.249660:WARNING:timestamp_aligner.cc(131)] too short translated timestamp interval: system time (us) = 3042652370324, interval (us) = 834
STDERR: base::debug::StackTrace::StackTrace()
STDERR: #2 0x7ff8623fb93b base::debug::(anonymous namespace)::StackDumpSignalHandler()
STDERR: #3 0x7ff857a70140 [2665012:17:1009/162250.249947:WARNING:timestamp_aligner.cc(131)] too short translated timestamp interval: system time (us) = 3042652370634, interval (us) = 742
STDERR: (/lib/x86_64-linux-gnu/libpthread-2.31.so+0x1413f)
STDERR: #4 0x7ff85778edb1 gsignal
STDERR: #5 0x7ff857778537 abort
STDERR: #6 0x7ff855d5eee2 [2665012:17:1009/162250.250342:WARNING:timestamp_aligner.cc(131)] too short translated timestamp interval: system time (us) = 3042652371030, interval (us) = 706
STDERR: [2665012:17:1009/162250.250514:WARNING:timestamp_aligner.cc(131)] too short translated timestamp interval: system time (us) = 3042652371204, interval (us) = 963
STDERR: rtc::webrtc_checks_impl::FatalLog()
STDERR: #7 0x7ff855f14e62 webrtc::LibvpxVp8Encoder::PrepareRawImagesForEncoding()
STDERR: #8 0x7ff855f14412 webrtc::LibvpxVp8Encoder::Encode()
STDERR: #9 0x7ff855bae765 webrtc::SimulcastEncoderAdapter::Encode()
STDERR: #10 0x7ff85607d598 webrtc::VideoStreamEncoder::EncodeVideoFrame()
STDERR: #11 0x7ff85607c60d webrtc::VideoStreamEncoder::MaybeEncodeVideoFrame()
STDERR: #12 0x7ff8560816f5 webrtc::webrtc_new_closure_impl::ClosureTask<>::Run()
STDERR: #13 0x7ff855b352b5 (anonymous namespace)::WebrtcTaskQueue::RunTask()
STDERR: #14 0x7ff855b3531e base::internal::Invoker<>::RunOnce()
STDERR: #15 0x7ff86239785b base::TaskAnnotator::RunTask()
STDERR: #16 0x7ff8623c8557 base::internal::TaskTracker::RunSkipOnShutdown()
STDERR: #17 0x7ff8623c7d92 base::internal::TaskTracker::RunTask()
STDERR: #18 0x7ff862415a06 base::internal::TaskTrackerPosix::RunTask()
STDERR: #19 0x7ff8623c75e6 base::internal::TaskTracker::RunAndPopNextTask()
STDERR: #20 0x7ff8623d3a8d base::internal::WorkerThread::RunWorker()
STDERR: #21 0x7ff8623d368d base::internal::WorkerThread::RunPooledWorker()
STDERR: #22 0x7ff862416509 base::(anonymous namespace)::ThreadFunc()
STDERR: #23 0x7ff857a64ea7 start_thread 

Original change's description:
> NV12 support for VP8 simulcast
>
> Tested using video_loopback with generated NV12 frames.
>
> Bug: webrtc:11635, webrtc:11975
> Change-Id: I14b2d663c55a83d80e48e226fcf706cb18903193
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186722
> Commit-Queue: Evan Shrubsole <eshr@google.com>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32325}

TBR=ilnik@webrtc.org,eshr@google.com

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

Bug: webrtc:11635
Bug: webrtc:11975
Change-Id: I61c8aed1270bc9c2f7f0577fa5ca717a325f548a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187484
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32369}
2020-10-09 15:32:33 +00:00
Ilya Nikolaevskiy
38e9b06151 Reland "Add scaling interface to VideoFrameBuffer"
(Reland with no changes after the fix to the downstream project)

This can be overriden for kNative frame types to perform scaling efficiently.

Default implementations for existing buffer types require actual
buffer implementation, thus this CL also merges "video_frame"
with "video_frame_I420" build targets.

Originally Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186303

(Landing with TBR as it's unchaged reland of already approved CL)
TBR=nisse@webrtc.org,sakal@webrtc.org

Bug: webrtc:11976, chromium:1132299
Change-Id: Ia23f7d3e474bd9cdc177104cc5c6d772f04b210f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187345
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32362}
2020-10-09 08:30:50 +00:00
Ilya Nikolaevskiy
441dbf9a56 Revert "Add scaling interface to VideoFrameBuffer"
This reverts commit c79f1d8cfb.

Reason for revert: Breaks downstream project.

Original change's description:
> Add scaling interface to VideoFrameBuffer
>
> This can be overriden for kNative frame types to perform scaling efficiently.
>
> Default implementations for existing buffer types require actual
> buffer implementation, thus this CL also merges "video_frame"
> with "video_frame_I420" build targets.
>
> Bug: webrtc:11976, chromium:1132299
> Change-Id: I3bf5f6bf179db5e7ab165b1c2301980043a08765
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186303
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Reviewed-by: Evan Shrubsole <eshr@google.com>
> Cr-Commit-Position: refs/heads/master@{#32352}

TBR=mbonadei@webrtc.org,sakal@webrtc.org,ilnik@webrtc.org,nisse@webrtc.org,stefan@webrtc.org,eshr@google.com

Change-Id: I86ac697bf963ef7e2c4f2ed34c3a7bf04f4f1ce1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11976
Bug: chromium:1132299
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187344
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32354}
2020-10-08 14:16:23 +00:00
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
Ilya Nikolaevskiy
c79f1d8cfb Add scaling interface to VideoFrameBuffer
This can be overriden for kNative frame types to perform scaling efficiently.

Default implementations for existing buffer types require actual
buffer implementation, thus this CL also merges "video_frame"
with "video_frame_I420" build targets.

Bug: webrtc:11976, chromium:1132299
Change-Id: I3bf5f6bf179db5e7ab165b1c2301980043a08765
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186303
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#32352}
2020-10-08 13:33:00 +00:00
Mirko Bonadei
0abd518abd Revert "Introduce RTC_NO_UNIQUE_ADDRESS."
This reverts commit f5e261aaf6.

Reason for revert: Breaks downstream projects.

Original change's description:
> Introduce RTC_NO_UNIQUE_ADDRESS.
>
> This macro introduces the possibility to suggest the compiler that a
> data member doesn't need an address different from other non static
> data members.
>
> The usage of a macro is to maintain portability since at the moment
> the attribute [[no_unique_address]] is only supported by clang
> with at least -std=c++11 but it should be supported by all the
> compilers starting from C++20.
>
> Bug: webrtc:11495
> Change-Id: I9f12b67b4422a2749649eaa6b004a67d5fd572d8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173331
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32246}

TBR=mbonadei@webrtc.org,kwiberg@webrtc.org

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

Bug: webrtc:11495
Change-Id: Ice318d1b11ca3dff09c190187a0b0a32ca945fe3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186944
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32335}
2020-10-07 07:37:01 +00:00
Evan Shrubsole
76d3e7a8d1 NV12 support for VP8 simulcast
Tested using video_loopback with generated NV12 frames.

Bug: webrtc:11635, webrtc:11975
Change-Id: I14b2d663c55a83d80e48e226fcf706cb18903193
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186722
Commit-Queue: Evan Shrubsole <eshr@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32325}
2020-10-06 11:54:04 +00:00
Danil Chapovalov
f67bb271c2 Factor out common logic for full svc scalability structures
Bug: webrtc:11999
Change-Id: Iacbb3e5d782987ee504b0fd1042a5e7fad2e2e50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186561
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32311}
2020-10-05 12:43:33 +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
Danil Chapovalov
b33a7186e6 Support layer skipping in L2T2 scalability structure
Bug: webrtc:11999
Change-Id: I4eae0b8e9749d5bf51482b58cc58606c28fd7318
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186305
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32289}
2020-10-02 11:21:03 +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
Danil Chapovalov
b3a83ba8a4 Support layer skipping in L3T1 scalability structure
Bug: webrtc:11999
Change-Id: Id60d28cf54e35b23f5da0f05bb94c1d9dcc356b6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185806
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32269}
2020-10-01 11:49:39 +00:00
Mirko Bonadei
f5e261aaf6 Introduce RTC_NO_UNIQUE_ADDRESS.
This macro introduces the possibility to suggest the compiler that a
data member doesn't need an address different from other non static
data members.

The usage of a macro is to maintain portability since at the moment
the attribute [[no_unique_address]] is only supported by clang
with at least -std=c++11 but it should be supported by all the
compilers starting from C++20.

Bug: webrtc:11495
Change-Id: I9f12b67b4422a2749649eaa6b004a67d5fd572d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173331
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32246}
2020-09-30 09:52:49 +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
Niels Möller
de95329daa Delete macros RTC_DISALLOW_ASSIGN and RTC_DISALLOW_IMPLICIT_CONSTRUCTORS
The former was unused, the latter is replaced with the explicit C++11
deletions. The related RTC_DISALLOW_COPY_AND_ASSIGN is left for now,
it is used in a lot more places.

Bug: None
Change-Id: I49503e7f2b9ff43c6285f8695833479bbc18c380
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185500
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32224}
2020-09-29 10:19: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
08ae7cea30 Reland "Delete the non-const version of the EncodedImage::data() method."
This is a reland of f2969fa868

Original change's description:
> Delete the non-const version of the EncodedImage::data() method.
>
> Bug: webrtc:9378
> Change-Id: I84ace3ca6a2eb4d0f7c3d4e62f815d77df581bfa
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185122
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> 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@{#32197}

Bug: webrtc:9378
Change-Id: I8521ac567749ea547f91cf7549eb48966baffa11
Tbr: ilnik@webrtc.org
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185807
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Marina Ciocea <marinaciocea@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32209}
2020-09-28 13:51:51 +00:00
Danil Chapovalov
b6103ff5f9 Test scalability structures do not suggest disabled layers
Bug: None
Change-Id: I85cc9dabc90882f5d1afa41ddab9489660c8b032
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185501
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32207}
2020-09-28 11:12:59 +00:00
Marina Ciocea
111de34102 Revert "Delete the non-const version of the EncodedImage::data() method."
This reverts commit f2969fa868.

Reason for revert: Breaks blink_platform_unittests; sample failure:
https://ci.chromium.org/p/chromium/builders/try/linux-rel/500046

Original change's description:
> Delete the non-const version of the EncodedImage::data() method.
>
> Bug: webrtc:9378
> Change-Id: I84ace3ca6a2eb4d0f7c3d4e62f815d77df581bfa
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185122
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> 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@{#32197}

TBR=ilnik@webrtc.org,nisse@webrtc.org,philipel@webrtc.org,titovartem@webrtc.org

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

Bug: webrtc:9378
Change-Id: I6374d263e2ee10da318ab1e040ed18bed7a96edd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185507
Reviewed-by: Marina Ciocea <marinaciocea@webrtc.org>
Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32205}
2020-09-27 08:28:07 +00:00
Niels Möller
f2969fa868 Delete the non-const version of the EncodedImage::data() method.
Bug: webrtc:9378
Change-Id: I84ace3ca6a2eb4d0f7c3d4e62f815d77df581bfa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185122
Reviewed-by: Artem Titov <titovartem@webrtc.org>
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@{#32197}
2020-09-25 12:14:50 +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
Erik Språng
ceb44959ca Reland: Wires up WebrtcKeyValueBasedConfig in media engines.
This is a reland of
https://webrtc-review.googlesource.com/c/src/+/174261

Patchset 1 contains the old cl (plus a merge conflict fix).
Later patchets are bufixes: A PeerConnection can be created without a
Call instance (in the case of DataChannel only), so we can't always
use that to fetch the current trials.

Old CL descritpion:

This replaces field_trial:: -based functions from system_wrappers.
Field trials are still used as fallback, but injectable trials are now
possible.

// Since re-land is otherwise unchanged, setting previous reviewers as TBR
TBR=kthelgason@webrtc.org,mbonadei@webrtc.org,stefan@webrtc.org,srte@webrtc.org

Bug: webrtc:11926
Change-Id: I57a9e8c3454f226f77fb93215bcac83da65034b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185003
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32163}
2020-09-22 16:08:22 +00:00
Åsa Persson
ceab7547f0 Make LibvpxVp8Encoder::GetCpuSpeed() to always read from CpuSpeedExperiment for arm.
CpuSpeedExperiment: Add option to have a separate config for cores below a configurable threshold.

Bug: none
Change-Id: I51562979f3a89a949d014a1ee6fc0802f3c1dae5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184926
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32154}
2020-09-22 07:26:26 +00:00
Ilya Nikolaevskiy
4c87d83d03 Extend I420 frame buffer pool to also create NV12 buffers
Bug: webrtc:11956
Change-Id: I758a28f2755cfa72ad486fbe1f9209f356eb5fa1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184510
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32147}
2020-09-21 09:46:15 +00:00
Åsa Persson
c5a74ffba4 Add support so requested resolution alignment also apply to scaled layers.
Bug: webrtc:11872
Change-Id: I7f904e2765330ee93270b66b0102ce57f336f9a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181883
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32146}
2020-09-21 09:23:22 +00:00
Artem Titov
9d77762023 Move SampleStatsCounter to public API
Bug: None
Change-Id: I8956f6febbb1caf71e951d212d57746fe1ec5eb2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184506
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32142}
2020-09-18 17:42:53 +00:00
Artem Titov
5956a17ed6 Revert "Wires up WebrtcKeyValueBasedConfig in media engines."
This reverts commit 591b2ab82e.

Reason for revert: Breaks downstream project

Original change's description:
> Wires up WebrtcKeyValueBasedConfig in media engines.
> 
> This replaces field_trial:: -based functions from system_wrappers.
> Field trials are still used as fallback, but injectable trials are now
> possible.
> 
> Bug: webrtc:11926
> Change-Id: I70f28c4fbabf6d9e55052342000e38612b46682c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174261
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32129}

TBR=mbonadei@webrtc.org,kthelgason@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,perkj@webrtc.org

Change-Id: I3e169149a8b787aa6366bb357abb71794534c63a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11926
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184507
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32132}
2020-09-17 20:17:38 +00:00
Erik Språng
591b2ab82e Wires up WebrtcKeyValueBasedConfig in media engines.
This replaces field_trial:: -based functions from system_wrappers.
Field trials are still used as fallback, but injectable trials are now
possible.

Bug: webrtc:11926
Change-Id: I70f28c4fbabf6d9e55052342000e38612b46682c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174261
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32129}
2020-09-17 16:24:10 +00:00
Emil Lundmark
7d73c6cf9d Explicitly enable CDEF
It should already be enabled by default in libaom, but explicitly enable
it here in case that changes.

Bug: None
Change-Id: I93a1dfc92f9c02bc5ec823c326d8cf6ff163bceb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184262
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32114}
2020-09-16 11:39:44 +00:00
Åsa Persson
869e9fb4f3 Use field trial list in CpuSpeedExperiment.
Removes the need for specifying a fixed number of parameters.

Bug: none
Change-Id: I1324861807cb4929963aedccb6c2755b9c6ea3fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180421
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32055}
2020-09-08 06:56:49 +00:00
Ilya Nikolaevskiy
fbb49b4f7f Enable Vp8VariableFramerateScreenshare by default
Bug: webrtc:10310,chromium:949112
Change-Id: I3ed54c0571bdb8be026dee82ca3578dd5c0f9158
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182182
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31979}
2020-08-21 15:03:58 +00:00
Florent Castelli
eeedb6ea33 Add error reporting on VP8 encoder configuration error
Bug: webrtc:11310
Change-Id: I4ceb565b211a2313add193a3859f3baeaacc3e87
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182001
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31964}
2020-08-19 13:15:52 +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
Niels Möller
5b69aa6613 Move definition of SpatialLayer to api/video_codecs/spatial_layer.h
Bug: webrtc:7660
Change-Id: I54009ebc5f65b6875a8c079ab5264e0c5ce9f654
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181500
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31942}
2020-08-17 09:45:19 +00:00
Rasmus Brandt
dabe48bb4c Add WebRTC-VP8-GetEncoderInfoOverride field trial to libvpx.
This trial allows the downstream users to quickly set the
requested resolution alignment.

Bug: webrtc:11832
Change-Id: I55b3213179021455740311247829b44926722efe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180884
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31857}
2020-08-05 11:42:54 +00:00
Florent Castelli
d3511010d9 Reland "Only enable conference mode simulcast allocations with flag enabled"
This is a reland of 32ca95145c

Fix includes not enabling the screenshare conference behavior on non
screenshare sources even if the flag is enabled.

Original change's description:
> Only enable conference mode simulcast allocations with flag enabled
>
> Non-conference mode simulcast screenshares were mistakenly using the
> conference mode semantics in the simulcast rate allocator, which broke
> spec compliant usage in some situation.
>
> This behavior should only be used when explicitly using the SDP entry
> "a=x-google-flag:conference" in both offer and answer.
>
> Bug: webrtc:11310, chromium:1093819
> Change-Id: Ibcba75c88a8405d60467546b33977a782e04e469
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179081
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31828}

Bug: webrtc:11310
Bug: chromium:1093819
Change-Id: Ic933f93a5c4bad20583354fe821f8a1170e911cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180802
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31847}
2020-08-04 10:30:08 +00:00
Florent Castelli
834dc9cfa1 Revert "Only enable conference mode simulcast allocations with flag enabled"
This reverts commit 32ca95145c.

Reason for revert: Internal test failure

Original change's description:
> Only enable conference mode simulcast allocations with flag enabled
> 
> Non-conference mode simulcast screenshares were mistakenly using the
> conference mode semantics in the simulcast rate allocator, which broke
> spec compliant usage in some situation.
> 
> This behavior should only be used when explicitly using the SDP entry
> "a=x-google-flag:conference" in both offer and answer.
> 
> Bug: webrtc:11310, chromium:1093819
> Change-Id: Ibcba75c88a8405d60467546b33977a782e04e469
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179081
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31828}

TBR=ilnik@webrtc.org,hta@webrtc.org,orphis@webrtc.org

Change-Id: I5ccb6e87594f491ba09fe6b837ee24d63db878ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11310
Bug: chromium:1093819
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180801
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31829}
2020-08-03 10:31:21 +00:00
Florent Castelli
32ca95145c Only enable conference mode simulcast allocations with flag enabled
Non-conference mode simulcast screenshares were mistakenly using the
conference mode semantics in the simulcast rate allocator, which broke
spec compliant usage in some situation.

This behavior should only be used when explicitly using the SDP entry
"a=x-google-flag:conference" in both offer and answer.

Bug: webrtc:11310, chromium:1093819
Change-Id: Ibcba75c88a8405d60467546b33977a782e04e469
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179081
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31828}
2020-08-03 10:09:46 +00:00
Danil Chapovalov
a5d9c1a45c In DependencyDescriptor rtp header extension drop partial chain support
i.e. when chain are used,
require each decode target to be protected by some chain.
where previously it was allowed to mark decode target as unprotected.

See https://github.com/AOMediaCodec/av1-rtp-spec/pull/125

Bug: webrtc:10342
Change-Id: Ia2800036e890db44bb1162abfa1a497ff68f3b24
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178807
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31772}
2020-07-21 14:01:27 +00:00
Jerome Jiang
7a9b96ff8e AV1: set error_resilience to 0.
No need to keep error_resilience 1 for layers in AV1

Bug: None
Change-Id: I6570d653a34ed2187307154ccdfd9e941ed8f917
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179742
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#31769}
2020-07-20 23:57:15 +00:00
philipel
e6542f2112 Removed unused include from encoded_image.h.
Bug: webrtc:9378
Change-Id: Ie26ab4d30d62ec109a8be638661789399821c162
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179525
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31758}
2020-07-17 14:14:03 +00:00
Markus Handell
3d2210876e Remove unused critical section includes.
Bug: webrtc:11567
Change-Id: Ic5e43c51ce06c0619adc265d12ad4bef73a9df76
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179521
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31745}
2020-07-16 13:52:28 +00:00
Danil Chapovalov
a13e7a1d46 Add factory to create scalability structures by name
according to webrtc-svc spec draft

Bug: webrtc:11404
Change-Id: I318b8a1a5c5389f6e5d15c3dd7d93041459e37f9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178603
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31731}
2020-07-15 10:26:40 +00:00
Markus Handell
6deec38ede Migrate modules/video_coding to webrtc::Mutex.
Bug: webrtc:11567
Change-Id: I8023fbe7595f7ba8ae7c7db3583fc2e560ec3df2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178803
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31644}
2020-07-07 11:41:21 +00:00
Danil Chapovalov
1e10a61564 In av1 add structure with custom spatial scalability factor
Bug: webrtc:11042
Change-Id: I93f125fba1fa21d060de47c96435798525f6b374
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178566
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31617}
2020-07-02 14:52:08 +00:00
Danil Chapovalov
54544ec92a In av1 encoder set bitrate per layer when scalability is used.
Bug: webrtc:11404
Change-Id: If779c16ffb55d28d21a0900439cbe2614507e557
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177015
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31570}
2020-06-26 09:26:05 +00:00
Danil Chapovalov
bf1816170b In Av1 encoder propagate zero bitrate as inactive decode target
Bug: webrtc:10342
Change-Id: I019acb6cca433db1551c22dd139a735ef976cff5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178101
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31567}
2020-06-25 16:32:28 +00:00
Danil Chapovalov
09867d37ed Share constants for dependency descriptor rtp header extension
Bug: webrtc:10342
Change-Id: I9c81215569bd1bd96b953faa359f5a3d32c7d0c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177521
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31549}
2020-06-22 11:58:29 +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
ee4f5cca00 Wires up trial for smarter postproc settings in non-arm VP8 decoder.
Params and format is the same as for existing ARM experiment, but a new
group name is created for non-ARM experiment.

Bug: webrtc:11551
Change-Id: I3a6c0f07a8c1d714477ae4703c16e48df36ac10e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177102
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31524}
2020-06-15 15:55:39 +00:00