Commit graph

1004 commits

Author SHA1 Message Date
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
Sergey Silkin
86a7969a6d Synchronize access to callbacks map
Bug: webrtc:14852
Change-Id: I65a608976056865849f4175411febc8093402de1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314481
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40500}
2023-08-02 11:38:25 +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
Florent Castelli
8c4b9ea535 Remove references to AudioCodec and VideoCodec constructors
The preferred method to create codecs is to use the function
cricket::CreateAudioCodec or cricketCreateVideoCodec.
Empty codec objects are deprecated and should be replaced
with alternatives such as methods returning an
absl::optional object instead.

Bug: webrtc:15214
Change-Id: I7fe40f64673cd407830dbbb0e541b85a3aee93aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307521
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40226}
2023-06-05 23:23:40 +00:00
Florent Castelli
816f5b1a39 Create VP9Encoder with a VP9 codec object
Empty codec objects do not make sense. Instead of creating an empty
object to be used as a placeholder in the API, at least create a
video codec with the right name.

Bug: webrtc:15214
Change-Id: I705d9d1361f353fe5dc538a6fe972c8a346f1247
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307221
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40218}
2023-06-05 00:23:47 +00:00
Florent Castelli
5278b39fab Add H264Encoder::Create()
Most of the usage of the H264Encoder::Create(codec) method passes a
simple codec with just the H264 codec name. This simplified the call
sites in many places and removes references to the codec types.

Bug: webrtc:15214
Change-Id: I4039c0be4ce6e3147c14c7853df4635f344b7d70
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307222
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40214}
2023-06-02 17:40:26 +00:00
Sergey Silkin
0328190ab3 Add video_codec_perf_tests to desktop and android perf test suites
Followed instructions in https://webrtc.googlesource.com/src/+/refs/heads/main/g3doc/add-new-test-binary.md

Bug: webrtc:14852
Change-Id: I4cdc7d55270de7b24723a89b8e3bb0d392d0e788
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305600
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40118}
2023-05-23 12:13:29 +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
Erik Språng
20bede7cc7 Clean up dead code in vp9 encoder wrapper
Bug: None
Change-Id: Ic99af40e95c5d82db9b4b5624eae3103d0a11c55
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304286
Auto-Submit: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40027}
2023-05-09 12:47:25 +00:00
Sergey Silkin
691b447c53 Fix returns from IsSameSettings and IsSameRate in codec tests
Swap true/false.

Bug: webrtc:14852
Change-Id: Id82c0180d33bfc4e5237f4800c3e89fe8d17693f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302381
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39917}
2023-04-21 11:29:32 +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
Jared Siskin
c018bae807 Format /modules
git ls-files | grep -e  "\(\.h\|\.cc\)$" | grep -e  "^modules/" | xargs clang-format -i ; git cl format
after landing: add to .git-blame-ignore-revs

Bug: webrtc:15082
Change-Id: I2c3cd28740062794f8c10e39d8406aadb9e9a35a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301620
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Jared Siskin <jtsiskin@meta.com>
Cr-Commit-Position: refs/heads/main@{#39901}
2023-04-20 02:02:45 +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
Sergey Silkin
26d1b26277 Log metrics even if test failed
Set of codecs for testing is hardcoded to AV1, VP8, VP9, H264, H265. Some codecs may not be available due to lack of support on the platform or due to some issue in our code which would be a regression. Reporting zero metrics for failed tests would allow the perf tool to detect such a regression.

This also enables codec tests by default. The tests should not run on bots since video_codec_perf_tests binary is not included in any test suits yet.

Bug: webrtc:14852
Change-Id: I967160069055036f93e595d328c4d5f1ca483be9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300868
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39840}
2023-04-13 08:49:37 +00:00
Sergey Silkin
b4a45546b7 Dedicated build target for video codec perf tests
Bug: webrtc:14852
Change-Id: Ib56ef931b58058a7d09b97b7013ba39ee1767629
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300740
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39823}
2023-04-12 11:24:48 +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
Sergey Silkin
ebb5383fd8 Dump codec input
Add functionality for dumping encoder and decoder input to file in video codec test.

Bug: b/261160916, webrtc:14852
Change-Id: I49a84a886d87903c601cf5c35bd723b6393c2a75
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298051
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39626}
2023-03-21 16:54:19 +00:00
Åsa Persson
014b244fa0 Keep SVC max bitrate if number of spatial layers are reduced.
Bug: chromium:1423361
Change-Id: I02bcb11f2ac456db79ed835dd38d4d7621a49608
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298446
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39614}
2023-03-21 12:00:17 +00:00
Sergey Silkin
aa17f2f0a9 Add Initialize() to Encoder/Decoder API in video codec tester
Initialization of Android HW codecs takes hundreds milliseconds. Exclude this time from frame processing time of first frame by initializing codecs before starting encoding/decoding.

Bug: b/261160916, webrtc:14852
Change-Id: I9ec84c6b12c1d9821b59965cf521170224066563
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298304
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39613}
2023-03-21 08:04:48 +00:00
Sergey Silkin
12669513d2 Use internal codec factories directly
BuiltinVideoEncoderFactory, which was used before, has been started to use SEA since https://webrtc-review.googlesource.com/c/src/+/297740. SEA requires factory lifetime to be ~same as created codec lifetime. Codec test doesn't guarantee this currently.

Bug: b/261160916, webrtc:14852
Change-Id: I75ef99f1c9fe0d7823f31fd07c05a3ca52f7212d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298201
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39600}
2023-03-20 10:33:40 +00:00
Sergey Silkin
0af2bc639a Add H265 to VideoCodecMimeType
This enables testing HW H265 codecs on devices where the support is available.

Bug: b/261160916, webrtc:14852
Change-Id: I32d102fcf483ea4ba46d6f5161342dbb584e7cc9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298040
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39591}
2023-03-17 15:28:11 +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
Sergey Silkin
82e8a7fdca Fix frame rate scaling in video codec tests
Swap numerator and denominator values.

Bug: b/261160916, webrtc:14852
Change-Id: Id1fa81ac8e13513005a53b7034f1d38bb1602c2f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/297960
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39581}
2023-03-16 17:13:59 +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
Sergey Silkin
a5f32e445c Set frame capture timestamp
Unlike SW encoder wrappers, Android HW encoder wrapper uses frame capture timestamp instead of RTP timestamp: https://source.corp.google.com/piper///depot/google3/third_party/webrtc/files/stable/webrtc/sdk/android/src/jni/video_frame.cc;rcl=514125748;l=309

Bug: b/261160916, webrtc:14852
Change-Id: Ief76abae659f7ba890371901cc9b505526ac4f97
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296500
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39495}
2023-03-07 13:56:14 +00:00
Sergey Silkin
1c1382be0f Dump codec output to ivf/y4m
Bug: b/261160916, webrtc:14852
Change-Id: I19de2210aa03b56752db5ce8b6fd94498123d6f5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296260
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39490}
2023-03-07 08:33:39 +00:00
Sergey Silkin
9259b5f72c Add rate adaptation tests
Bug: b/261160916, webrtc:14852
Change-Id: I58b3647218c961dcf0305c3902f79adb448b73e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295866
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39489}
2023-03-06 18:33:16 +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
Sergey Silkin
fddc9131a5 Aggregate and log video codec metrics
Bug: b/261160916, webrtc:14852
Change-Id: Idcb7e96b12ca38af49b9b1f10d1e23cc7faac92b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293945
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39427}
2023-03-01 08:27:54 +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
Tove Petersson
1fccaa4485 Reland "operator== for VideoFrameMetadata + used in CloneSenderVideoFrame test"
This reverts commit 8bf3210629.

Reason for revert: Initialized an uninitialized member in GofInfoVP9 (+ removed some redundant initialization of members already initialized by SetGofInfoVP9())

Original change's description:
> Revert "operator== for VideoFrameMetadata + used in CloneSenderVideoFrame test"
>
> This reverts commit 437bf78ed9.
>
> Reason for revert: Breaks upstream project
>
> Original change's description:
> > operator== for VideoFrameMetadata + used in CloneSenderVideoFrame test
> >
> > Added equality and inequality operators for VideoFrameMetadata and used the equality operator to check that the cloned metadata property is equal to the original metadata in RtpSenderVideoFrameTransformerDelegateTest.CloneSenderVideoFrame.
> >
> > Also default-initialized VideoFrameMetadata::ssrc_ to 0.
> >
> > Bug: webrtc:14708
> > Change-Id: If1f5153069bc986061ff9f0a6abaa2a4a5a98dd1
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293560
> > Commit-Queue: Tove Petersson <tovep@google.com>
> > Reviewed-by: Tony Herre <herre@google.com>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#39411}
>
> Bug: webrtc:14708
> Change-Id: Icbec1b65ed22b89766606cb9514dde6f4e9124be
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295500
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Auto-Submit: Andrey Logvin <landrey@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39413}

Bug: webrtc:14708
Change-Id: I843d29f7dd0da2c7f16968a7fc08dc02cd359fc1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295520
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Tove Petersson <tovep@google.com>
Cr-Commit-Position: refs/heads/main@{#39418}
2023-02-28 15:44:21 +00:00
Andrey Logvin
8bf3210629 Revert "operator== for VideoFrameMetadata + used in CloneSenderVideoFrame test"
This reverts commit 437bf78ed9.

Reason for revert: Breaks upstream project

Original change's description:
> operator== for VideoFrameMetadata + used in CloneSenderVideoFrame test
>
> Added equality and inequality operators for VideoFrameMetadata and used the equality operator to check that the cloned metadata property is equal to the original metadata in RtpSenderVideoFrameTransformerDelegateTest.CloneSenderVideoFrame.
>
> Also default-initialized VideoFrameMetadata::ssrc_ to 0.
>
> Bug: webrtc:14708
> Change-Id: If1f5153069bc986061ff9f0a6abaa2a4a5a98dd1
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293560
> Commit-Queue: Tove Petersson <tovep@google.com>
> Reviewed-by: Tony Herre <herre@google.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39411}

Bug: webrtc:14708
Change-Id: Icbec1b65ed22b89766606cb9514dde6f4e9124be
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295500
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Andrey Logvin <landrey@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39413}
2023-02-28 11:50:42 +00:00
Tove Petersson
437bf78ed9 operator== for VideoFrameMetadata + used in CloneSenderVideoFrame test
Added equality and inequality operators for VideoFrameMetadata and used the equality operator to check that the cloned metadata property is equal to the original metadata in RtpSenderVideoFrameTransformerDelegateTest.CloneSenderVideoFrame.

Also default-initialized VideoFrameMetadata::ssrc_ to 0.

Bug: webrtc:14708
Change-Id: If1f5153069bc986061ff9f0a6abaa2a4a5a98dd1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293560
Commit-Queue: Tove Petersson <tovep@google.com>
Reviewed-by: Tony Herre <herre@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39411}
2023-02-28 08:32:09 +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
Philipp Hancke
b660b7a89c Enable multithreaded OpenH264 encoding behind field trial
This uses the field trial introduced is crbug.com/1406331 and
extends the usage to OpenH264. This simplifies experimentation
whether this change improves performance without requiring
multi-slice encoding.

BUG=webrtc:14368

Change-Id: I0031e59059f7113dd5453234869c957d46f311bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294340
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39371}
2023-02-22 14:26:33 +00:00
Henrik Boström
fbd0ddb32e Introduce WebRTC-VideoEncoderSettings/encoder_thread_limit:X.
As requested by a CEF hosted application (https://crbug.com/1406331)
who want to be able to limit the number of threads in a controlled
environment, this CL adds a flag to control the max limit per encoder.

For plumbing-reasons, this is placed in VideoEncoder::Settings but
with a note that this is considered an experimental API with limited
support. For now only LibvpxVp8Encoder uses it and there are no plans
to roll this out.

I have manually confirmed this is working with printf debugging,
--force-fieldtrials=WebRTC-VideoEncoderSettings/encoder_thread_limit:2
and https://jsfiddle.net/henbos/2bd6m7Lt/

Bug: chromium:1406331
Change-Id: Ib02bd83e2071034874843d3aaa0d3b0adc5bbf46
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293960
Reviewed-by: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39349}
2023-02-20 14:01:32 +00:00
Sergey Silkin
72b99a1128 Test Android HW codecs
Bug: b/261160916, webrtc:14852
Change-Id: Iebeab244a9ca6ae196735016064ccd056b7c888e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293401
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39326}
2023-02-16 14:01:52 +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
Henrik Boström
2e540a28c0 Introduce EncodedImage.SimulcastIndex().
As part of go/unblocking-vp9-simulcast (Step 1), EncodedImage is being
upgraded to be able to differentiate between what is a simulcast index
and what is a spatial index.

In order not to break existing code assuming that "if codec != VP9,
SpatialIndex() is the simulcast index", SimulcastIndex() has fallback
logic to return the value of spatial_index_ in the event that
SetSimulcastIndex() has not been called. This allows migrating external
code from (Set)SpatialIndex() to (Set)SimulcastIndex(). During this
intermediate time, codec gates are still necessary in some places of
the code, see TODOs added.

In a follow-up CL, after having fixed dependencies, we'll be able to
remove the fallback logic and rely on SimulcastIndex() and
SpatialIndex() actually being the advertised index and "if codec..."
hacks will be a thing of the past!

Bug: webrtc:14884
Change-Id: I70095c091d0ce2336640451150888a3c3841df80
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293343
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39318}
2023-02-15 15:02:57 +00:00
Sergey Silkin
5dd493b3da Do not use PostDelayedTask in video codec tester's pacer
PostDelayedTask doesn't guarantee task execution order. For example,
if you post two tasks, A and B, back-to-back using the same delay
there is no guarantee that A will be executed before B.

Re-implemented pacing using sleep(). Changed pacer to compute task
scheduled time instead of delay. Sleep time is calculated right before
task start. This provides better accuracy by accounting for any delays
that may happen after pacing time is computed and before task queue is
ready to run the task.

It is tricky to implement pacer tests using simulated clocks. The test
use system time which make them flacky on low performance bots. Keep
the test disabled by default.

Bug: b/261160916, webrtc:14852
Change-Id: I88e1a2001e6d33cf3bb7fe16730ec28abf90acc8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291804
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39302}
2023-02-13 15:07:16 +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
Sergey Silkin
c6ff4bc793 Do not transfer ownership of codecs to tester
Passing of ownership of codecs to tester is not strictly needed. We may need to continue using a codec after test. For example, to check codec state or to use the same codec instance in next test.

Bug: b/261160916, webrtc:14852
Change-Id: I179b262116d7de76b8171f0409f943ad6d87433e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291802
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39256}
2023-02-03 14:29:43 +00:00
Sergey Silkin
6c60f72a6b Refactor video codec testing stats
This CL introduces VideoCodecStats and VideoCodecStatsImpl which provide baseline functionalities for storing, slicing and aggregation of encoded and/or decoded video frame statistics. To facilitate metrics logging (not implemented yet), SamplesStatsCounter is used for stream parameters.

VideoCodecStats/VideoCodecStatsImpl will replace existing VideoCodecTestStats/VideoCodecTestStatsImpl.

Bug: b/261160916, webrtc:14852
Change-Id: I0f96ce1ed9be3aee2a702804612524676c9882fd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291323
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39248}
2023-02-02 15:56:40 +00:00
Sergio Garcia Murillo
1389c4b594 Add 444 10 bits support for H264 and VP9
This CL adds support for I410 buffers (444 10 bits) and modify vp9 and h264 for being able to convert input buffer to it when appropiate.

Bug: webrtc:14818
Change-Id: I2fb3dc9d80c5338944c6df74dd6217a0454180d9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290721
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39123}
2023-01-17 12:32:26 +00:00
Evan Shrubsole
f7b0e14d8b [Unwrap] Use RtpTimestampUnwrapper in ScreenshareLayers
Bug: webrtc:13982
Change-Id: I4dbd05be7db77450a7a3a2c6a22f0101c9cb9150
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288748
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39033}
2023-01-09 14:38: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
Sergey Silkin
2e1a9a4ae0 Add video codec tester.
This tester is an improved version of VideoProcessor and VideoCodecTestFixture and will eventually replace them.

The tester provides better separation between codecs and testing logic. Its knowledge about codecs is limited to frame encode/decode calls and frame ready callbacks. Instantiation and configuration of codecs are the test responsibilities.

Other differences:
- Run encoding and decoding in separate threads
- Run quality analysis in a separate thread
- Reference frame buffering is moved into video source (which re-read frames from the file).
- Make it possible to run decode-only tests

This CL is MVP implementation: it adds only 1 test (video_codec_test.cc, ConstantRate/EncodeDecodeTest) and the test is disabled for now.

Bug: b/261160916
Change-Id: Ida24a2fca1b1496237fa695c812084877c76379f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283525
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38901}
2022-12-15 14:32:53 +00:00
Chunbo Hua
46ad25119c Make requested_resolution_alignment of webrtc::EncoderInfo as uint32_t.
At the same time, proper names of some parameters are refactored in SimulcastEncoderAdapter.

Bug: None
Change-Id: Ia036e3f362d1394e90aa26b79953c1ffe75e2fe0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284961
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Chunbo Hua <chunbo.hua@intel.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38870}
2022-12-12 06:02:59 +00:00