Commit graph

1796 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
Tony Herre
5f14f9e6ed Remove VCMEncodedFrame from webrtc::EncodedFrame inheritance
Remove VCMEncodedFrame from the inheritance chain of EncodedFrames by
- moving getters for EncodedImage fields up to EncodedImage
- copying other non-deprecated fields & Methods from VCMEncodedFrame over to EncodedFrame
- Removing EncodedFrame's inheritance of VCMEncodedFrame

We leave VCMEncodedFrame as part of the (near) deprecated
VideoCodingModule code. The only place which needs to accept either is
in the generic decoder.

Bug: webrtc:9378, b:296992877
Change-Id: I60706aebbb6eacc7fd4b35ec90cc903efdbe14c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317160
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Auto-Submit: Tony Herre <herre@google.com>
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40639}
2023-08-28 11:46:48 +00:00
Danil Chapovalov
7084e1b6d9 In VideoPlayoutDelay delete access to integer representation of min/max values
Bug: webrtc:13756
Change-Id: I1a81c25e5e3fab68a44e94a5ab93e8184c824683
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/316864
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40612}
2023-08-23 16:14:26 +00:00
Joachim Reiersen
c08df4bdca Remove DCHECK when processing StapA in h264_sps_pps_tracker.cc
When GenericFrameDescriptor or DependencyDescriptor RTP extensions are used, we may receive multiple consecutive StapA packets where only the first packet has is_first_packet_in_frame set. The previous code assumed that all StapA had is_first_packet_in_frame = true. Per discussion on the attached bug, removing the DCHECK is OK.

Bug: webrtc:15155
Change-Id: I6348740eac7d70bca2b7541721aaa7e2b5e5a970
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/316941
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40608}
2023-08-23 12:44:06 +00:00
Markus Handell
411639ede8 Introduce a frame dumping encoder wrapper.
Expose new function MaybeCreateFrameDumpingEncoderWrapper that
wraps another passed encoder and dumps its encoded frames out
into a unique IVF file into the directory specified by the
"WebRTC-EncoderDataDumpDirectory" field trial. If the passed
encoder is nullptr, or the field trial is not setup, the function
just returns the passed encoder. The directory specified by the
field trial parameter should be delimited by ';'.

The new function is wired up in VideoStreamEncoder.

Bug: b/296242528
Change-Id: I6143adf899f78fcc03d4239a86c68dcbab483f1c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317200
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40600}
2023-08-22 15:45:32 +00:00
henrika
6b7bbe2e33 Adding new WebRTC.Video.GenericDecoder histograms
Goal is to be able to get an improved overview of the distribution
of the total delay.

Bug: None
Change-Id: I0dced53eafd1fb09941590f3706480066c52419b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317260
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40597}
2023-08-22 13:24:07 +00:00
Danil Chapovalov
06717773a5 Move EncodedImage::playout_delay_ to private section of the class
Remove code where integer -1 as delay is used to represent unset value.

Bug: webrtc:13756
Change-Id: I16a01e12c25a09ce21a971c9edabf47af5936662
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/316923
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40592}
2023-08-22 08:24:37 +00:00
Danil Chapovalov
c146b5f77b Represent unset VideoPlayoutDelay with nullopt rather than special value
Remove support for setting one limit without another limit
because related rtp header extension doesn't support such values.

Start morphing VideoPlayouDelay into a class and stricter type: add accessors returning TimeDelta

Bug: webrtc:13756
Change-Id: If0dd02620528dc870b015beeff3a8103e04022ee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315921
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40570}
2023-08-18 13:17:50 +00:00
Philipp Hancke
1e42d83db4 Make VCMReceiveCallback::FrameToRender pure virtual again
after the downstream tests have been updated.

BUG=webrtc:14728

Change-Id: I9cf7eb607f8b26acf985d90625e55bac257a2606
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/316220
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40557}
2023-08-16 10:44:28 +00:00
Philipp Hancke
5165743926 Reland "Fix definition of keyframes decoded statistics"
This is a reland of commit 0e37f5ebd4
with backward compability added to allow downstream tests to migrate to the new signature.

Original change's description:
> Fix definition of keyframes decoded statistics
>
> which are defined to be measured after decoding, not before:
>   https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-keyframesdecoded
>
> BUG=webrtc:14728
>
> Change-Id: I0a83dde278e1ebe8acf787bdac729af369a1ecf8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315520
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40545}

BUG=webrtc:14728

Change-Id: I4cf52bb22ba8244155b4fa8c367b9c0306a77590
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/316120
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40553}
2023-08-15 12:09:46 +00:00
Mirko Bonadei
2dbf6e09c1 Revert "Fix definition of keyframes decoded statistics"
This reverts commit 0e37f5ebd4.

Reason for revert: Breaks downstream tests (non backwards compatible change)

Original change's description:
> Fix definition of keyframes decoded statistics
>
> which are defined to be measured after decoding, not before:
>   https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-keyframesdecoded
>
> BUG=webrtc:14728
>
> Change-Id: I0a83dde278e1ebe8acf787bdac729af369a1ecf8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315520
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40545}

BUG=webrtc:14728
No-Presubmit: true
No-Tree-Checks: true
No-Try: true

Change-Id: Idd31fbe6b7173e4bcdfaabfc1704ec6513e80ebe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315961
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#40550}
2023-08-14 17:12:56 +00:00
Philipp Hancke
0e37f5ebd4 Fix definition of keyframes decoded statistics
which are defined to be measured after decoding, not before:
  https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-keyframesdecoded

BUG=webrtc:14728

Change-Id: I0a83dde278e1ebe8acf787bdac729af369a1ecf8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315520
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40545}
2023-08-14 12:13:38 +00:00
Danil Chapovalov
ebb2bfd239 Delete deprecated member CodecSpecificInfoVP9::end_of_picture
This field is unused. It was deprecated in
https://webrtc-review.googlesource.com/c/src/+/192542

Bug: None
Change-Id: Iba264c03e16fc240893595075b525d44efa8ab96
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314720
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40504}
2023-08-02 14:05:31 +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
Philipp Hancke
3f10b4917e Log SSRC for video decode errors
which makes it possible to grep the logs for all decode errors
on a particular SSRC.

BUG=None

Change-Id: I4aa54434f0b85932313adaf39e099729991a4700
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308823
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40404}
2023-07-06 11:24:16 +00:00
Yaowen Guo
6fc700ec3d Rland "Revert "Reland "Reland "Delete old Android ADM.""""
This reverts commit 7534ebd2bf.

Reason for revert: Downstream projects have been updated, try it again.

R=perkj@webrtc.org

Bug: webrtc:7452
Change-Id: Ice48a563a6da499b6050b6f6e21bb0a18cd34f57
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271841
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40386}
2023-06-30 13:10:12 +00:00
Sergey Silkin
d7c7b07c5d Account for codec type when accessing codec specific settings
Bug: none
Change-Id: Ic60414d7a8cd2e40f8c3855fd4ceed09ea4d7c07
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305784
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40324}
2023-06-21 11:26:04 +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
Ying Wang
2d598535aa Add SetRetransmissionMode() to FecController, this will be used to control RTX settings in FecController.
Currently FecController knows about network conditions, these information can be used to control RTX settings in-call.

Change-Id: I8f84164aeac48ea13b7f1cf82fd7424431f98ada
Bug: webrtc:15167
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304800
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Ying Wang <yinwa@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40192}
2023-06-01 07:51:56 +00:00
Rasmus Brandt
f0820ffd88 Implement video versions of RTCInboundRtpStreamStats.jitterBuffer{Target,Minimum}Delay
* https://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-jitterbuffertargetdelay
* https://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-jitterbufferminimumdelay

Tested: https://jsfiddle.net/pfgzj0yo/17/

Bug: webrtc:14244
Change-Id: I3d949ba63c8339b3881f5d00356559d5789d283d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304404
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40157}
2023-05-26 13:34:09 +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
Mirko Bonadei
ad363ea310 Remove spam log from IvfFileWriter.
The IvfFileWriter logs a warning in case frames have a different
resolution compared to the one of the first frame in the file.

While this is an issue, since the IVF header will have the resolution
of the first frame, in reality this is not a problem (e.g. tools like
VLC can open and play the IVF without issues).

For this reason, let's remove the log which gets printed for each
frame.

Bug: b/282678729
Change-Id: I540cd1b6ce4f5d888737725e7615918aa126647f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305280
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40069}
2023-05-15 14:55:25 +00:00
Rasmus Brandt
39250a4e68 Rename and move VCMReceiveStatisticsCallback closer to its users.
The VCMReceiveStatisticsCallback interface is both implemented (by ReceiveStatisticsProxy) and called (by VideoStreamBufferController) in `video/`, so there's no reason it should be declared in `modules/video_coding`. I also took the opportunity to update the name.

No functional changes are intended by this change, but following CLs will make some changes.

Bug: webrtc:15085
Change-Id: Ib8da30ca56675e4f638d0b9778c329b9c1138acf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304662
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40034}
2023-05-10 04:59:51 +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
Rasmus Brandt
24f9a8b398 Document VCMTiming::VideoDelayTimings better.
* Reorder and rename members.
* Add comments.
* Define struct first in the class, as per style guide.
* Update direct callers.

Bug: webrtc:15085
Change-Id: I37d26cae1953dacbba7d0507da48e3829ab84ba5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304403
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40011}
2023-05-08 15:30:02 +00:00
Rasmus Brandt
9dfb531f38 Move deprecated Receiver to modules/video_coding/deprecated/
This move further clarifies that the file and its class are deprecated. It also cleans up the modules/video_coding root folder a bit.

No functional changes are intended.

Bug: webrtc:14876
Change-Id: I580e8412d379931bfdf9517e0a8be25c19e0cd32
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304100
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40004}
2023-05-08 07:02:15 +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
Rasmus Brandt
59d09aeeee Move deprecated JitterBuffer to modules/video_coding/deprecated/
This move further clarifies that the file and its class are deprecated. It also cleans up the modules/video_coding root folder a bit.

No functional changes are intended.

Bug: webrtc:14876
Change-Id: Ic3ac439b3dd3492e6c9c85869efa80a6708658ee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301521
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39876}
2023-04-17 13:19:50 +00:00
Sergey Silkin
ea1502accb Add necessary deps for android video_codec_perf_tests
native_test_jni_onload depends on base_jni which depends on modules/audio_processing:api. This requires to include audio_device_java in pure video targets like video_codec_perf_tests.

Bug: webrtc:14852
Change-Id: I5e7b102fd730801562695bf3f4d5170ec8e59b58
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301363
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39873}
2023-04-17 12:19:13 +00:00
Markus Handell
4ec56a3aa0 VCMJitterBuffer: fix deadlock.
The jitterbuffer would call Flush which takes a mutex from
InsertPacket, which is already under the same mutex. Fix
this by introducing an internal flush method that assumes
a locked state.

The change also adds more thread annotations in case more
problems were present. No more problems were detected.

Fixed: b/277930190
Change-Id: If85609f27f8187ade9370847fecc2bc83d940dd5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301340
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Auto-Submit: Markus Handell <handellm@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39868}
2023-04-17 08:54:18 +00:00
Jeremy Leconte
06e2148889 Deflake simulcast flow tests: prevent negative Timestamp exception.
These tests often fail in 'ExtrapolateLocalTime' because the result gives a negative Timestamp.

Here is the stack from https://chromium-swarm.appspot.com/task?id=6173230e67897b10:
PC: @     0x7f03afdb8e87  (unknown)  raise
    ...
    @     0x55f4a360ba71        352  webrtc::Timestamp::operator+()
    @     0x55f4a47ecaf3        160  webrtc::TimestampExtrapolator::ExtrapolateLocalTime()

Low-Coverage-Reason: coverage isn't that low.
Change-Id: If3e7cbf31d6c4800727b24352ed2c6edc425fc73
Bug: webrtc:15022
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300600
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#39853}
2023-04-13 16:35:26 +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
Henrik Boström
9bbd9598b8 Also apply VP9 bitrate's singlecast tweak in single active stream case.
We shouldn't treat VP9 simulcast {active,inactive,inactive} different
from VP9 singlecast when it comes to bitrates, so the condition
`config.simulcast_layers.size() <= 1` is updated to
`video_codec.numberOfSimulcastStreams <= 1` which holds true in the
"single active stream" case as well.

This is consistent with existing logic, such as the fact that we use
`SvcRateAllocator` instead of `SimulcastRateAllocator` when
`numberOfSimulcastStreams <= 1`.

Bug: webrtc:15061
Change-Id: I67fc78b9c0f97f1d607c91bbc689b06c3fd5cb48
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298920
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39791}
2023-04-08 15:18:29 +00:00
Henrik Boström
8481f6358e Remove IsSinglecastOrAllNonFirstLayersInactive() helper.
As of recent changes, we can simply look at numberOfSimulcastStreams
because in the {active,inactive,inactive} case we get a single
webrtc::VideoStream here[1] which results in numberOfSimulcastStreams
being 1 here[2].

Looking at numberOfSimulcastStreams instead of using a helper is
preferred because it is more descriptive and in the future, when
{inactive,active,inactive} or {inactive,inactive,active} cases of VP9
simulcast is also supported (webrtc:15046) then this gating will work
even when the first layer is not the active one.

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/config/encoder_stream_factory.cc;l=146;drc=c99753ac8f051e379ae68e281aaef04b0a5ca8f2

[2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/video_codec_initializer.cc;l=77;drc=4baea5b07f2fd309892845cf2d1c0f4ca77862d3

# No need to wait for win chrome bot, everything else green
NOTRY=True

Bug: webrtc:15046
Change-Id: I8aaea2e8cc350bd01fb00cc7fd85032b7fdfe24d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299942
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39759}
2023-04-04 13:59:07 +00:00
Henrik Boström
4baea5b07f Make VP9 simulcast behave like singlecast for single active layer cases.
Various "if streams == 1" cases are updated to "if
IsSinglecastOrAllNonFirstLayersInactive()" in order not to cause subtle
differences between VP9 {active} and VP9 {active,inactive,inactive}.

This CL also affects a line that conditionally sets
`simulcastStream[0].active = codec_active` so it seemed fitting to
improve the test coverage of "if all streams are inactive, don't send".

Bug: webrtc:15028
Change-Id: I8872dc8be0f2dfc1d8914bdba5e6433f9ba8cbfd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298881
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39656}
2023-03-23 14:49:22 +00:00
Henrik Boström
80850ca477 Fix crash happening when changing from legacy to standard VP9.
Attempting to ship "WebRTC-AllowDisablingLegacyScalability" revealed a
DCHECK that happens when negotiating 3 VP9 streams prior to the
setParameters() call:
1. By default, `scalability_mode` is missing, so those 3 streams
   defaulted to legacy SVC, meaning only a single stream is used.
2. Then, setParameters() was called to make
   `encodings[0].scalability_mode = "L2T2_KEY"` and
   `encodings[1-2].active = false`. The inactive streams were just
   dummies and never expected to exist.

Without simulcast support this is OK, because both 1) and 2) are
interpreted to have a single stream. But with simulcast support, 1) is
interpreted as single stream and 2) as three streams (1 active, 2
inactive). This should be roughly the same setup, but our code treats
them differently.

The DCHECK crash was a mismatch in number of streams in one of the
layers.

The fix is to re-create the streams when the number of streams change
for this reason. The new test revealed other issues and fixes too:
- Support for multiple spatial layers (e.g. "L2T2_KEY") when multiple
  encodings exist but only one encoding is active.
- Allow inactive layers not to have a scalability mode set.

A laundry list (https://crbug.com/webrtc/15028) has been created to
update known places doing "if streams == 1" that need to do "if
active streams == 1" instead.

Credit:
  The RecreateWebRtcStream() fix is based on eshr@'s POC from
  https://webrtc-review.googlesource.com/c/src/+/298565.

Bug: webrtc:15016
Change-Id: I909a3f83a4ef53562894549ade0a870b208cec7e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298443
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/main@{#39651}
2023-03-23 10:46:17 +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