Commit graph

150 commits

Author SHA1 Message Date
Mirko Bonadei
a3d2c58e38 Skip LibaomAv1SvcTest.EncodeAndDecodeAllDecodeTargets/S3T3.
This is temporary while AV1 gets fixed.

Bug: webrtc:15715, b/315476578
Change-Id: I4fdadb97788c934b12b4a3a19dfec1f61a95a3a5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330640
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Marco Paniconi <marpan@google.com>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41345}
2023-12-09 12:24:51 +00:00
Sergey Silkin
50e2054c5b Move setting single spatial layer bitrates to GetVp9SvcConfig
Before this change bitrate limits for VP9 single spatial layer case were set in VideoCodecInitializer. Move this logic to GetVp9SvcConfig. This simplifies replication of WebRTC behaviour in codec level tests. The similar AV1 logic sits in SetAv1SvcConfig, not VideoCodecInitializer.

Bug: webrtc:14852
Change-Id: Ie7202ec880d0e4b903e7265721eeef9b3920f21a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324286
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40992}
2023-10-23 14:10:21 +00:00
Sergey Silkin
a4b2b95f99 Restrict ARM-specific VP8/VP9/AV1 settings to mobile platforms
ARM-specific settings were intended to be used on mobile ARM devices which may not be powerful enough. But the settings were also applied to ARM-based Macs. This changes restricts ARM-specific settings to Android and iOS platforms.

Bug: none
Change-Id: I68764b4c0679db07399bba5923f4a6be89c5ad80
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321861
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Jerome Jiang <jianj@google.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40884}
2023-10-06 15:10:04 +00:00
Danil Chapovalov
9c58483b5a Rename EncodedImage property Timetamp to RtpTimestamp
To avoid name collision with Timestamp type,
To avoid confusion with capture time represented as Timestamp

Bug: webrtc:9378
Change-Id: I8438a9cf4316e5f81d98c2af9dc9454c21c78e70
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320601
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40796}
2023-09-24 20:06:48 +00:00
philipel
31718d7ce2 Reland "Add option to disable quality scaling for AV1."
This reverts commit 83102d3907.

Reason for revert: reland with fix

Original change's description:
> Revert "Add option to disable quality scaling for AV1."
>
> This reverts commit 446dbc66fd.
>
> Reason for revert: downstream break
>
> Original change's description:
> > Add option to disable quality scaling for AV1.
> >
> > The main goal of this change is to disable the quality scaler when multiple spatial layers are used.
> >
> > Bug: b/295129711
> > Change-Id: I25e0b7440a8c2adee3e97720a1e0ee5e0a914334
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319181
> > Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> > Reviewed-by: Erik Språng <sprang@webrtc.org>
> > Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#40709}
>
> Bug: b/295129711
> Change-Id: Iaeb13951d1b839bc0426120436035843bb3ee98f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320081
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Owners-Override: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40742}

Bug: b/295129711
Change-Id: Iab4846c2cd6074f50a3ebe9551432d449243b5d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320120
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40743}
2023-09-13 15:19:36 +00:00
Philip Eliasson
83102d3907 Revert "Add option to disable quality scaling for AV1."
This reverts commit 446dbc66fd.

Reason for revert: downstream break

Original change's description:
> Add option to disable quality scaling for AV1.
>
> The main goal of this change is to disable the quality scaler when multiple spatial layers are used.
>
> Bug: b/295129711
> Change-Id: I25e0b7440a8c2adee3e97720a1e0ee5e0a914334
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319181
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40709}

Bug: b/295129711
Change-Id: Iaeb13951d1b839bc0426120436035843bb3ee98f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320081
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Owners-Override: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40742}
2023-09-13 12:21:31 +00:00
philipel
19ff1ad237 Reland "Always use AV1 specific bitrate limits when spatial layers are used."
This reverts commit 030c6ff43f.

Reason for revert: reland with fix

Original change's description:
> Revert "Always use AV1 specific bitrate limits when spatial layers are used."
>
> This reverts commit d2d165d47c.
>
> Reason for revert: All the regressions!
>
> Original change's description:
> > Always use AV1 specific bitrate limits when spatial layers are used.
> >
> > Bug: b/295129711
> > Change-Id: I93569027bea34c43e2a3c4de0875e8bbddd5b64e
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319283
> > Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
> > Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> > Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#40719}
>
> Bug: b/295129711
> Change-Id: I5776edbaba33e86eb10414062ef2b29510f40b8d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319880
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Cr-Commit-Position: refs/heads/main@{#40730}

Bug: b/295129711
Change-Id: I5fe84184d3f3780fdc4e9c1d43c4989d333d44a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319881
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40739}
2023-09-12 13:00:19 +00:00
Philip Eliasson
030c6ff43f Revert "Always use AV1 specific bitrate limits when spatial layers are used."
This reverts commit d2d165d47c.

Reason for revert: All the regressions!

Original change's description:
> Always use AV1 specific bitrate limits when spatial layers are used.
>
> Bug: b/295129711
> Change-Id: I93569027bea34c43e2a3c4de0875e8bbddd5b64e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319283
> Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40719}

Bug: b/295129711
Change-Id: I5776edbaba33e86eb10414062ef2b29510f40b8d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319880
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#40730}
2023-09-11 11:57:39 +00:00
philipel
d2d165d47c Always use AV1 specific bitrate limits when spatial layers are used.
Bug: b/295129711
Change-Id: I93569027bea34c43e2a3c4de0875e8bbddd5b64e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319283
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40719}
2023-09-08 09:02:11 +00:00
philipel
8fd09016e6 Reduce number of spatial layers depending on input resolution for AV1
Bug: b/295129711
Change-Id: If54562d6e453209da9f358bbdb2909662e4ab873
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319380
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40713}
2023-09-07 10:29:47 +00:00
philipel
446dbc66fd Add option to disable quality scaling for AV1.
The main goal of this change is to disable the quality scaler when multiple spatial layers are used.

Bug: b/295129711
Change-Id: I25e0b7440a8c2adee3e97720a1e0ee5e0a914334
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319181
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40709}
2023-09-06 12:37:22 +00:00
Tony Herre
55b593fb6b Remove EncodedFrame::MissingFrame and start removing Decode() param
Remove EncodedFrame::MissingFrame, as it was always false in actual
in-use code anyway, and remove usages of the Decode missing_frames param
within WebRTC. Uses/overrides in other projects will be cleaned up
shortly, allowing that variant to be removed from the interface.

Bug: webrtc:15444
Change-Id: Id299d82e441a351deff81c0f2812707a985d23d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317802
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Tony Herre <herre@google.com>
Commit-Queue: Tony Herre <herre@google.com>
Cr-Commit-Position: refs/heads/main@{#40662}
2023-08-30 10:38:35 +00:00
Jerome Jiang
3403acb3c6 av1: 8 threads for >720p and tiles config
Use 8 threads for > 720p
Use 4 tile columns and 2 tile rows for 8 threads
Use 2 tile columns and 2 tile rows for 4 threads

For VGA, 2 tile_col x 2 tile_row configuration has
 - ~9% speedup over 4 tile_col x 1 tile_row
 - ~5% speedup over 1 tile_col x 4 tile_row

Bug: None
Change-Id: I3c1ea948437aece7c6734ce25351158cbdf0a15b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307880
Commit-Queue: Jerome Jiang <jianj@google.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40237}
2023-06-07 15:33:41 +00:00
Sergey Silkin
d615704551 Enable frame dropping in libaom AV1 encoder
Bug: webrtc:15225
Change-Id: Ife16a61d47d7aa2f20548d30c56bf59844de1b26
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307500
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40236}
2023-06-07 13:24:02 +00:00
Danil Chapovalov
0c85f733c9 For AV1, disable error resilience on upper temporal layers
Error resilience is no longer required for upper temporal layers.
Disabling error resilience on the upper layers leads to a ~2% PSNR BD-rate gain.

Reland of https://webrtc-review.googlesource.com/c/src/+/302001

Bug: webrtc:15106
Change-Id: I72ca9d504a7848dda934cbd52669027061742256
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305782
Reviewed-by: Jerome Jiang <jianj@google.com>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Marco Paniconi <marpan@google.com>
Cr-Commit-Position: refs/heads/main@{#40099}
2023-05-22 08:14:08 +00:00
Jeremy Leconte
67f2109544 Revert "For AV1, disable error resilience on upper temporal layers. Error resilience is no longer required for upper temporal layers. Disabling error resilience on the upper layers leads to a ~2% PSNR BD-rate gain."
This reverts commit 2080dacfb7.

Reason for revert: This CL is causing a lot of flakiness on iOS bots
https://ci.chromium.org/p/webrtc/builders/ci/iOS%20Debug%20%28simulator%29

Original change's description:
> For AV1, disable error resilience on upper temporal layers. Error resilience is no longer required for upper temporal layers. Disabling error resilience on the upper layers leads to a ~2% PSNR BD-rate gain.
>
> Bug: webrtc:15106
> Change-Id: Id92d51defbd26c1a77e3c9fe19607e9db4a3e7c1
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302001
> Reviewed-by: Marco Paniconi <marpan@webrtc.org>
> Commit-Queue: Michael Horowitz <mhoro@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39900}

Bug: webrtc:15106
Change-Id: I24515280113ed6681c9766026ec24d689035c031
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301983
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Owners-Override: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#39903}
2023-04-20 09:24:52 +00:00
Michael Horowitz
2080dacfb7 For AV1, disable error resilience on upper temporal layers. Error resilience is no longer required for upper temporal layers. Disabling error resilience on the upper layers leads to a ~2% PSNR BD-rate gain.
Bug: webrtc:15106
Change-Id: Id92d51defbd26c1a77e3c9fe19607e9db4a3e7c1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302001
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Michael Horowitz <mhoro@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39900}
2023-04-20 00:17:45 +00:00
Yu-Chen (Eric) Sun
35f2b89ee4 Fix the issue 15059: wrong libaom initialized target bitrate
Fix Issue 15059: The target bitrate was mistakenly set to be the maximal

bitrate when initializing the libaom encoder.

Bug: webrtc:15059
Change-Id: I38498d4cce7b0a9c26736d9f1096178dd2e1fef6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300004
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39822}
2023-04-12 10:42:58 +00:00
Wan-Teh Chang
ad192a8c5e Remove extraneous opening parenthesis in comment
Bug: None
Change-Id: I8f1939caa43a7eb48dc5a6276520b39429062b30
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298000
Auto-Submit: Wan-Teh Chang <wtc@google.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Cr-Commit-Position: refs/heads/main@{#39587}
2023-03-17 14:31:15 +00:00
Wan-Teh Chang
8f29b42670 Validate encoder_settings_.qpMax
libaom uses the quantizer as an index for an array of size 64, so
encoder_settings_.qpMax must be <= 63.

Add a comment to LibaomAv1Encoder::SetSvcParams() to explain why the
method doesn't initialize svc_params.layer_target_bitrate.

Bug: None
Change-Id: I26be80de005752214365abbe8b9b32dc976cee0b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293680
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Cr-Commit-Position: refs/heads/main@{#39572}
2023-03-16 02:57:44 +00:00
Danil Chapovalov
8eb7aef196 Relax expectation on the libaom rate controller
Bug: b/271819773
Change-Id: I580b6fde352d1f23773fd394b0ee1543724b828f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296323
Reviewed-by: Jerome Jiang <jianj@google.com>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39482}
2023-03-06 13:58:51 +00:00
Michael Horowitz
b27efd487d Add option to configure AV1 EncoderInfo resolution_bitrate_limits.
bug: webrtc:14931
Change-Id: I8ade2a888d29f76a0f690fc3541b45b7304ad4d3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294600
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Michael Horowitz <mhoro@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39426}
2023-02-28 20:48:33 +00:00
Erik Språng
ff1cf61cf3 Fix potentially bad rate control with libaom av1 encoder.
This can happen when the encoder uses real presentation timestamps that
originate with the input frames. By using those, the encoder can bypass
webrtc frame dropping logic and may severely over/under-shoot if the
timestamps are very precise. In practice, this seems rather common on
Chrome on Windows.

Bug: aomedia:3391
Change-Id: I2be5eed4fabc86dac8a6c7bfdd068c2dcb5a3743
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294740
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39382}
2023-02-23 18:54:57 +00:00
Palak Agarwal
a09f21b207 Introduce capture_time_identifier in webrtc::EncodedImage
This CL propagates capture_time_identifier introduced in
webrtc::VideoFrame and propagates it to EncodedImage. For use cases
involving EncodedTransforms, this identifier is further propagated to
TransformableVideoSenderFrame.

VideoEncoder::Encode function is overriden by each encoder. Each of
these overriden functions needs to be changed so that they can handle
this new identifier and propagate its value in the created EncodedImage.

Change-Id: I5bea4c5a3fe714f1198e497a4bcb5fd059afe516
Bug: webrtc:14878
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291800
Reviewed-by: Tony Herre <herre@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Palak Agarwal <agpalak@google.com>
Cr-Commit-Position: refs/heads/main@{#39374}
2023-02-22 17:08:53 +00:00
Wan-Teh Chang
f6eb9d64b2 Declare kMinimumFrameRate for AV1 codec as double
The kMinimumFrameRate constant is only used in a comparison with
RateControlParameters::framerate_fps, which is of the double type.
Declare kMinimumFrameRate as double to match.

Note: The kMinimumFrameRate constant was added in
https://webrtc-review.googlesource.com/c/src/+/170360.

Bug: webrtc:11404
Change-Id: I11769867d4e52a720219c8a0ade8e8b74d13ca86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293384
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Cr-Commit-Position: refs/heads/main@{#39320}
2023-02-15 17:27:34 +00:00
Wan-Teh Chang
1f39162528 Fill fps allocation for LibaomAv1Encoder correctly
The elements of the fps_allocation vector are fractions of the maximum
frame rate. Each fraction is represented as an 8-bit unsigned integer,
where 0 = 0% and 255 = 100%.

The original code (added in
https://webrtc-review.googlesource.com/c/src/+/201384) sets the elements
of the fps_allocation vector to frame rates rather than frame rate
fractions. Perhaps fps_allocation could be renamed to avoid this kind of
confusion.

modules_unittests --gtest_filter=LibaomAv1EncoderTest.*

Tested: 
Change-Id: Icd050da3b3c2cff31913c3430f7b6b6e9829b9fa
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/292784
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39286}
2023-02-09 16:00:55 +00:00
Evan Shrubsole
097fc347ec [Unwrap] Prepare SequenceNumberUnwrapper for migrations
This is in prep for the migration of all unwrappers to
SequenceNumberUnwrapper as a standard implementation.

This moves the SeqNumUnwapper to its own header and adds 2 methods to
SeqNumUnwrapper which are defined by other unwrappers:
* PeekUnwrap
* Reset

It also adds two implementations for RtpTimestamps and
RtpSequenceNumbers.

Bug: webrtc:13982
Change-Id: I5baefb2de1db92fe1bb600760bd63b71e9310eb5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288742
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39030}
2023-01-09 11:42:20 +00:00
Evan Shrubsole
9b235cd93b Add scalability mode to RTCOutboundRtpStreamStats stats
This is in the webrtc-stats spec at
https://www.w3.org/TR/webrtc-stats/#dom-rtcoutboundrtpstreamstats-scalabilitymode.

This adds the scalability mode to CodecSpecificInfo which is used to
plumb the modes for each simulcast layer.

TBR=orphis@webrtc.org

Tested: Compiled into Chrome and confirmed the scalability mode set for AV1, VP9, VP8 and H264 software encoders in chrome://webrtc-internals.
Bug: webrtc:14730
Change-Id: I71ceba8f6485a4f4a73e0856031b8d5f16f913f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285085
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38847}
2022-12-08 11:46:06 +00:00
philipel
ef005bc924 Unwrap the presentation timestamp before calling aom_codec_encode in LibaomAv1Encoder.
Bug: webrtc:14673
Change-Id: I0358fed5ac0839994482c5fb049c13e442f82c82
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283701
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38657}
2022-11-17 08:32:18 +00:00
philipel
0c4563c0c4 Remove the libaom av1 decoder.
Bug: webrtc:14267
Change-Id: I95a416b25fa20d4dea6896e05beb59789621f1fa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268305
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38253}
2022-09-30 08:42:25 +00:00
Zhaoliang Ma
dd65499002 Skip one data copy on dav1d decoding
This CL wraps the |Dav1dPicture| data directly for |VideoFrame| using
instead of copy data out to new buffer.

Bug: None
Change-Id: I21ceffb5cac7dda4a44eafbd0ed221974b8d45ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276526
Commit-Queue: Zhaoliang Ma <zhaoliang.ma@intel.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38194}
2022-09-26 08:37:24 +00:00
Joe Downing
59020bd88b Add AV1 profile-1 video decode support to WebRTC
The Chrome Remote Desktop team is looking to support AV1 profile-1
w/ I444 for screen sharing however only I420 is currently supported.

This CL adds I444 support for the Dav1dDecoder, which appears to be
the preferred decoder and adds profile-1 to the
InternalDecoderFactory when the Dav1dDecoder is being used.

I've tested this CL using a CRD host w/ I444 enabled and it seems to
work as expected, though I've only tested on a debug build so I plan
to do some perf testing once this is available in a release build.

Bug: chromium:1329660
Change-Id: I2b8b7b7fd530727456ac5c46e694e7dbad6deff2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273986
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Joe Downing <joedow@google.com>
Cr-Commit-Position: refs/heads/main@{#38022}
2022-09-06 16:31:40 +00:00
philipel
9e9bc644f8 Update visibility for dav1d_decoder.
Bug: webrtc:13573
Change-Id: Icb43b11cf0a6ad2b90f6876875bcb545be01ec0c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268303
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37505}
2022-07-12 10:07:46 +00:00
Byoungchan Lee
a1a7c638ec Let PCF.GetRtpSenderCapabilities return codecs' scalabilityModes.
Also move ScalabilityModeToString to api and add RTC_EXPORT so that
Chromium can use it.

Bug: chromium:986069
Change-Id: I5dbbb6de9b14ca20f3ae0630552dcd44595ad5ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267780
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#37444}
2022-07-05 13:28:33 +00:00
Oleh Prypin
752436f821 Add dependencies on absl when they are used but undeclared
Bug: b/36882554
Change-Id: I3a1c5f0024abc452bcd74eef2b66d4493f4f974c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266760
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37320}
2022-06-24 06:19:39 +00:00
Florent Castelli
90b74389a2 SVC: Add end to end tests for VP8 and VP9
The tests check that the various scalability mode are supported
and the frames are marked properly by the encoder with their
spatial and temporal index.
The same information is then checked on the receiving side.

A new member is added on EncodedImage to store the temporal index,
and is filled by the encoders and retreived by the ref finder
objects on the decoding side.

Bug: webrtc:11607
Change-Id: I7522f6a6fc5402244cab0c4c64b544ce09bc5204
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260189
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37303}
2022-06-22 11:07:01 +00:00
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
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
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
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
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
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
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
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
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