Commit graph

215 commits

Author SHA1 Message Date
Danil Chapovalov
0be8eba07e Migrate pacing and video_coding to absl::AnyInvocable based TaskQueueBase interface
Bug: webrtc:14245
Change-Id: Icfab3e6548055ea72a199a226eca5233b1ead20d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267983
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37467}
2022-07-06 15:46:04 +00:00
Niels Möller
cb99ccd244 Update/delete old TODOs
Bug: webrtc:10198
Change-Id: I0341e068d792bc0b143db86e675988f4cd07ff2e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267822
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37454}
2022-07-06 07:49:04 +00:00
Artem Titov
c374d11fac Move to_queued_task.h and pending_task_safety_flag.h into public API
Bug: b/235812579
Change-Id: I9fa3dc4a65044df8b44fff4e9bfeac7233fa381c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266080
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37248}
2022-06-17 09:20:39 +00:00
Niels Möller
105711e9ad Move rtc::make_ref_counted to api/
Bug: webrtc:12701
Change-Id: If49095b101c1a1763c2a44a0284c0d670cce953f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265390
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37219}
2022-06-15 09:47:38 +00:00
Niels Möller
c0a9f35248 Define SimulcastStream as an alias for SpatialLayer
Step one in making it a separate type, that will be done as a
followup, after downstream code is updated to use the new name.

Bug: webrtc:11607
Change-Id: I6fa664a0729b1cfd71b7f02b6441880beee0e741
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262806
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36946}
2022-05-20 13:12:21 +00:00
Niels Möller
807328fec7 Move frame drop config to VideoCodec and VideoEncoderConfig.
Intend to delete corresponding codec-specific settings in a followup.

Bug: webrtc:6883
Change-Id: I78ab07729a5aee1055f80d39d8f7289beb6721e1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262244
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36882}
2022-05-13 13:40:14 +00:00
Ali Tofigh
62238097c9 Remove top-level const from parameters in function declarations.
This is a safe cleanup change since top-level const applied to
parameters in function declarations (that are not also
definitions) are ignored by the compiler. Hence, such changes do
not change the type of the declared functions and are simply
no-ops.

Bug: webrtc:13610
Change-Id: Ibafb92c45119a6d8bdb6f9109aa8dad6385163a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249086
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35802}
2022-01-26 11:05:25 +00:00
Anton Bikineev
7abf45fe2c LSC: Apply clang-tidy's modernize-use-bool-literals
The check finds implicit conversions of integer literals to bools:
  bool b1 = 1;
  bool b2 = static_cast<bool>(1);
and transforms them to:
  bool b1 = true;
  bool b2 = true;

Bug: chromium:1290142
Change-Id: I6819a0bd2ca84ecadae08ed9389c17d2652589f4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/248166
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#35778}
2022-01-24 20:42:01 +00:00
Byoungchan Lee
604fd2f1ab Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/
Bug: webrtc:13555, webrtc:13082
Change-Id: I2c2cbcbd918f0cfa970c1a964893220ba11d4b41
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247960
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35771}
2022-01-24 11:50:20 +00:00
Byoungchan Lee
c065e739e2 Remove RTC_DISALLOW_COPY_AND_ASSIGN more.
Bug: webrtc:13555, webrtc:13082
Change-Id: I9c07708108da0a26f5e228384fd56cef4d1540b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247300
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35749}
2022-01-20 11:00:18 +00:00
Shuhai Peng
9753fbc380 Video: Avoid crashing when dump stream with IvfFileWriter.
Currently some RTPVideoHeaders are not filled with width and height
information, such as AV1. If we dump the stream with command line
“--force-fieldtrials=WebRTC-DecoderDataDumpDirectory/./”, and if
width and height are 0, it will crash soon.

This CL aims to avoid crashing when the |encoded_image._encodedWidth|
and |encoded_image._encodedHeight| are 0.

Bug: webrtc:13491
Change-Id: Ie5af58c03f09a9784ed67943dc5b5959850b4368
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/242500
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35576}
2021-12-23 13:37:22 +00:00
Nico Grunbaum
d525e2d9f7 Disambiguate kIvfHeaderSize for Mozilla unified build
kIvfHeaderSize is defined both inside of ivf_file_writer.cc and
ivf_file_reader.cc. This patch moves its definition into a header.

Bug: webrtc:13463
Change-Id: Ia6b2fcc3434f69a1e30a7dae7bf0c90547f11d98
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239722
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35540}
2021-12-15 08:52:00 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
Evan Shrubsole
7de81e2717 Add const to methods in DecodedFramesHistory
Bug: webrtc:13343
Change-Id: I3f4e015e683f4003bb038424646cb51ae26c76fa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236848
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35329}
2021-11-10 12:30:18 +00:00
Harald Alvestrand
97597c0f51 Remove usage of INFO alias for LS_INFO in log messages
Bug: webrtc:13362
Change-Id: Ifda893861a036a85c045cd366f9eab33c62ebde0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237221
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35310}
2021-11-04 13:46:17 +00:00
Shuhai Peng
2ab7d5b961 Fix bad license header style from CRLF to LF.
Bug: webrtc:13227
Change-Id: I39a83c7ba7ad69ee7dbbd53758d45d0b3c3b5b12
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/233884
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35189}
2021-10-12 16:59:50 +00:00
Shuhai Peng
f270770679 video: Implement bandwidth based scaler
The |slice_qp_detla| reported by the hardware is not credible, which
causing the quality scaler cannot work properly,the resolution cannot
be adjusted correctly.

To fix this issue, this CL implements a bandwidth scaler which is used
for adjust resolution, this scaler will be used when QP based quality
scaler is not working due to untrusted QP reported by HW AVC encoder.

Bug: webrtc:12942
Change-Id: I2fc5f07a5400ec7e5ead2c2c502faee84d7f2a76
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228860
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35120}
2021-09-29 10:39:27 +00:00
Danil Chapovalov
cd4ab49ee7 in Vp9UncompressedHeaderParser fix reading delta quantization parameter
delta_q is encoded as signed integer (s(4)) that uses extra bit for the
sign. See VP9 Bitstream Specification section 6.2.10 Delta quantizer syntax

Bug: None
Change-Id: Ib458c2a2ded3c4d6c153b6bedd29c48ef12cc538
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231125
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34908}
2021-09-02 13:24:31 +00:00
Danil Chapovalov
faba0fa1c7 Change ParseUncompressedVp9Header implementation to use BitstreamReader
Bug: None
Change-Id: I91010b0102622fd8154f8ba941e61298b0584eae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230802
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34899}
2021-09-01 22:52:15 +00:00
Erik Språng
cc69ea4a93 Fix parsing of vp9 skip level segmentation feature
Bug: chromium:1241297
Change-Id: I44c3e8eddcb2467aae7433f3907cff34fa807f69
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229302
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34803}
2021-08-19 12:16:00 +00:00
Åsa Persson
062acd9eb4 Move frame drop functionality in VideoAdapter into a separate class.
This class will replace modules/video_coding/utility/framerate_controller.h

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

Reason for revert: downstream project adjusted

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

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

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

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

Bug: webrtc:12354, chromium:1230448

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

Bug: webrtc:12354
Change-Id: Ibd301eb458a6104b562cefbc0e616c39b54fb38b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229060
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34789}
2021-08-17 19:42:00 +00:00
Mirko Bonadei
d6da4c23cc Revert "Update remaining usage of VideoDecoder::InitDecode to Configure"
This reverts commit ca0a08ab60.

Reason for revert: Breaks downstream project.

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

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

Change-Id: I1868700a43b5aa4b37e9bcba5af233d24526c974
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:13045
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229024
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34780}
2021-08-17 09:35:28 +00:00
Danil Chapovalov
ca0a08ab60 Update remaining usage of VideoDecoder::InitDecode to Configure
Bug: webrtc:13045
Change-Id: I5253fddfd613cf0228fc3cd861b91e56558dd34a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228947
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34777}
2021-08-17 08:48:30 +00:00
Artem Titov
dcd7fc7ea8 Use backticks not vertical bars to denote variables in comments for /modules/video_coding
Bug: webrtc:12338
Change-Id: Ia8a9adea291d594e4f59a6a1203a7bfb0758adac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227165
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34684}
2021-08-09 15:26:22 +00:00
Sergey Silkin
d4b087c6cf Use **** code for codec of unknown type
This allows dumping kVideoCodecGeneric to IVF.

Bug: none
Change-Id: I71ae5f11dc226f68aa60e4423556feb1af96d11c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226865
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34543}
2021-07-23 21:04:59 +00:00
Erik Språng
62af58448e Revert "Rename vp9::FrameInfo to vp9::UncompressedHeader and add more fields."
This reverts commit 3097008de0.

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

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

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

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

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

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

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

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

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

And with:

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

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

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

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

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

Bug: webrtc:6779
Change-Id: I00bed8886e03d685a2f42324e34aef2c9b7a63b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224846
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34442}
2021-07-09 07:49:43 +00:00
Erik Språng
5a5d751aa5 VP9 parser: undo r34393 and fix incorrect return statement.
Some code was deleted in
https://webrtc-review.googlesource.com/c/src/+/224266/2/modules/video_coding/utility/vp9_uncompressed_header_parser.cc
since it was detected as unreachable.
The root cause was an early return that should have been a
RETURN_IF_FALSE(x).

Bug: webrtc:12924
Change-Id: Ifadded9bbb4748d56cf65c30fd8f87e92fde10d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225040
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34422}
2021-07-06 14:39:57 +00:00
Sergey Silkin
54388a876a Fix a comment in FrameDropper
Bug: webrtc:12810
Change-Id: I340b1c84785070b3b12490aa873ca17aab2e423a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225100
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34421}
2021-07-06 14:06:20 +00:00
Peter Kasting
286b1db1b2 Fix -Wunreachable-code-aggressive.
Bug: chromium:1066980
Change-Id: I6888ea1fbc458c9b3063b3f60a7732af16ab5fc9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224266
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#34393}
2021-06-30 11:14:37 +00:00
Björn Terelius
a77e16ca2c Update BitBuffer methods to style guide
Specifically, use reference instead of pointer for out parameter
and place the out parameter last, for the following methods

ReadUInt8
ReadUInt16
ReadUInt32
ReadBits
PeekBits
ReadNonSymmetric
ReadSignedExponentialGolomb
ReadExponentialGolomb

Bug: webrtc:11933
Change-Id: I3f1efe3e29155985277b0cd18700ddea25fe7914
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/218504
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34037}
2021-05-18 11:10:27 +00:00
Erik Språng
edb7ea2e69 Refactors Vp9UncompressedHeaderParser.
Biggest change is a new helper class used to read data from the
bitstream and then pass the result to a function if reading was
successful. There's also helper to do if/else flow based on the read
values. This avoids a bunch of temporaries and in my view makes the
code esaier to read.

For example, this block:

uint32_t bit;
RETURN_FALSE_IF_ERROR(br->ReadBits(&bit, 1));
if (bit) {
  RETURN_FALSE_IF_ERROR(br->ConsumeBits(7));
}

...is now written as:

RETURN_IF_FALSE(
    br->IfNextBoolean([br] { return br->ConsumeBits(7); }));

In addition, we parse and put a few extra things in FrameInfo:
show_existing_frame, is_keyframe, and base_qp.

Bug: webrtc:12354
Change-Id: Ia0b707b223a1afe0a4521ce2b995437d41243c06
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215239
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33776}
2021-04-19 16:46:48 +00:00
Sergey Silkin
0e42cf703b Reland "Parse encoded frame QP if not provided by encoder"
This reverts commit 727d2afc43.

Reason for revert: Use thread-safe wrapper for H264 parser.

Original change's description:
> Revert "Parse encoded frame QP if not provided by encoder"
>
> This reverts commit 8639673f0c.
>
> Reason for revert: linux_tsan fails https://ci.chromium.org/ui/p/webrtc/builders/ci/Linux%20Tsan%20v2/25329/overview
>
> Original change's description:
> > Parse encoded frame QP if not provided by encoder
> >
> > Bug: webrtc:12542
> > Change-Id: Ic70b46e226f158db7a478a9f20e1f940804febba
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/210966
> > Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> > Reviewed-by: Åsa Persson <asapersson@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#33434}
>
> TBR=asapersson@webrtc.org,ssilkin@webrtc.org
>
> Change-Id: Ie251d8f70f8e87fd86b63730aefd2ef3f941e4bb
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:12542
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211355
> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33441}

# Not skipping CQ checks because this is a reland.

Bug: webrtc:12542
Change-Id: Ib7601fd6f2f26bceddbea2b4ba54d67a281f3a59
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211660
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33458}
2021-03-15 10:11:22 +00:00
Sergey Silkin
727d2afc43 Revert "Parse encoded frame QP if not provided by encoder"
This reverts commit 8639673f0c.

Reason for revert: linux_tsan fails https://ci.chromium.org/ui/p/webrtc/builders/ci/Linux%20Tsan%20v2/25329/overview 

Original change's description:
> Parse encoded frame QP if not provided by encoder
>
> Bug: webrtc:12542
> Change-Id: Ic70b46e226f158db7a478a9f20e1f940804febba
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/210966
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Reviewed-by: Åsa Persson <asapersson@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33434}

TBR=asapersson@webrtc.org,ssilkin@webrtc.org

Change-Id: Ie251d8f70f8e87fd86b63730aefd2ef3f941e4bb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:12542
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211355
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33441}
2021-03-11 17:06:06 +00:00
Sergey Silkin
8639673f0c Parse encoded frame QP if not provided by encoder
Bug: webrtc:12542
Change-Id: Ic70b46e226f158db7a478a9f20e1f940804febba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/210966
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33434}
2021-03-11 11:48:38 +00:00
philipel
9aa9b8dbbe Prepare to replace VideoLayerFrameId with int64_t.
Bug: webrtc:12206
Change-Id: I10bfdefbc95a79e0595956c1a0e688051da6d2b9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/207180
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33265}
2021-02-15 14:42:02 +00:00
philipel
f109193fba Remove VideoLayerFrameId::spatial_layer, use EncodedImage::SpatialIndex instead.
Next step is to replace VideoLayerFrameId with int64_t.

Bug: webrtc:12206
Change-Id: I414f491e383acf7f8efd97f7bf93dc55a5194fbf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206804
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33245}
2021-02-12 11:16:23 +00:00
Artem Titov
d15a575ec3 Use SequenceChecker from public API
Bug: webrtc:12419
Change-Id: I00cca16a0ec70246156ba00b97aa7ae5ccbf5364
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205323
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33220}
2021-02-10 15:04:55 +00:00
Ilya Nikolaevskiy
483b31c231 Reland "Enable Video-QualityScaling experiment by default"
This time exclude iOS from the default behaviour.

Bug: webrtc:12401
Change-Id: Ib1f77123b72c3365591b56455332b3d97b307b26
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205006
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33173}
2021-02-05 09:49:13 +00:00
Ilya Nikolaevskiy
d6604df27f Revert "Enable Video-QualityScaling experiment by default"
This reverts commit 066b5b6ed7.

Reason for revert: Regressions on iOS testbots.

Original change's description:
> Enable Video-QualityScaling experiment by default
>
> Bug: webrtc:12401
> Change-Id: Iebf3130e785892bb9fddf1012bc46027a21085a4
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204000
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Åsa Persson <asapersson@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33091}

TBR=ilnik@webrtc.org,asapersson@webrtc.org

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

Bug: webrtc:12401
Change-Id: I489b805c7741b63c22c16cfce03347179a3e2602
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205001
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33123}
2021-02-01 13:20:49 +00:00
Ilya Nikolaevskiy
066b5b6ed7 Enable Video-QualityScaling experiment by default
Bug: webrtc:12401
Change-Id: Iebf3130e785892bb9fddf1012bc46027a21085a4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204000
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33091}
2021-01-28 18:17:03 +00:00
Florent Castelli
54fb32a15e IvfFileReader: Fix SpatialIndex values
The SpatialIndex value from an EncodedImage is 0-based, but values were
off by 1.

Bug: none
Change-Id: Ie74e6450ddef1cfaee68fa230c441030fa86a64a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203525
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33067}
2021-01-25 13:11:45 +00:00
Mirko Bonadei
20e4c80fbe Reland "Introduce RTC_NO_UNIQUE_ADDRESS."
This is a reland of f5e261aaf6

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

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

Bug: webrtc:11495, webrtc:12218
Change-Id: I4e6c7cc37d3daffad2407c9a2acfa897fa5b426a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189968
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32668}
2020-11-23 11:29:36 +00:00
philipel
1b0d5437c9 Removed _completeFrame since we never allow incomplete frames.
In the old jitter buffer the two VCMVideoProtection modes |kProtectionNone| and |kProtectionFEC| could be set on the jitter buffer for it to not wait for NACK and instead generate incomplete frames. This has not been possible for a long time.

Bug: webrtc:9378, webrtc:7408
Change-Id: I0a2d3ec34d721126c1128306d5fad88314f8d59f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190680
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32513}
2020-10-28 16:00:27 +00:00
Erik Språng
9d69cbeabf Changes default pacing factor to 1.1x
This changes the default behavior to use pacing factor of 1.1x instead
of 2.5x, it also sets libvpx rate controler as trusted, turns on the
encoder pushback mechanism and sets spatial hysteresis to 1.2.
The unused "dynamic rate" settings in libvpx is removed.

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

Bug: webrtc:10155
Change-Id: I8186b491aa5bef61e8f568e96c980ca68f0c208f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186661
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32477}
2020-10-23 13:43:32 +00:00
Danil Chapovalov
9f4859e5e3 Allow to set av1 scalability mode after encoder is constructed
Bug: webrtc:11404
Change-Id: I70b4115c8afdc4f32fd876d31d54b7d95d0a7e1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188582
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32437}
2020-10-19 10:42:23 +00:00