This is a reland of commit 7ae48c452a with updated RtpVp9RefFinder
RtpVp9RefFinder relied on the fact that frames with (inter_pic_predicted=true && inter_layer_predicted=true) were marked as keyframes. Since this is not the case anymore, the related code paths in RtpVp9RefFinder have been deleted.
Calculation of gof_info_[] index for non-keyframes has been updated to account for that fact it is now possible to received multiple T0 frames belonging to the same temporal unit (we don't need to do "unwrapped_tl0 - 1" in this case).
Original change's description:
> Mark frames with inter_layer_predicted=true as delta frames
>
> As it is currently implemented, the VP9 depacketizer decides packet's frame type based on p_bit ("Inter-picture predicted layer frame"). p_bit is set to 0 for upper spatial layer frames of keyframe since they do not have temporal refs. This results in marking packets of upper spatial layer frames, and, eventually these frames, of SVC keyframes as "keyframe" while they are in fact delta frames.
>
> Normally spatial layer frames are merged into a superframe and the superframe is passed to decoder. But passing individual layers to a single decoder instance is a valid scenario too and is used in downstream projects. In this case, an upper layer frame marked as keyframe may cause decoder reset [2] and break decoding.
>
> This CL changes frame type decision logic in the VP9 depacketizer such that only packets with both P and D (inter-layer predicted) bits unset are considered as keyframe packets.
>
> When spatial layer frames are merged into a superframe in CombineAndDeleteFrames [1], frame type of the superframe is inferred from the lowest spatial layer frame.
>
> [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/frame_helpers.cc;l=53
>
> [2] https://source.corp.google.com/piper///depot/google3/third_party/webrtc/files/stable/webrtc/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc;l=209
>
> Bug: webrtc:15827
> Change-Id: Idc3445636f0eae0192dac998876fedec48628560
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343342
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41939}
Bug: webrtc:15827
Change-Id: Ic69b94989919cf6d353bceea85d0eba63bc500ee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/344144
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41985}
FFmpeg has removed this field and usage of it in chromium must be
removed before the ffmpeg dependency is updated. The chromium media
change can be found here:
https://chromium-review.googlesource.com/c/chromium/src/+/5384308
The usage of the field in webrtc seems only to be for sanity checking,
so it should be just safe to remove entirely, since webrtc does not
expect re-ordering at all.
Bug: chromium:330573128
Change-Id: I9c5854ec82c3ad2d55374ea4eaa0c571437f8267
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343840
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#41935}
Webrtc is build with FFmpeg sources on defined in the include path
through the -I flag, so they should be included this way instead. This
would otherwise cause a conflict when the chromium ffmpeg sources move
from third_party/ffmpeg/* to third_party/ffmpeg/src/*
BUG: chromium:329282834
Change-Id: Id8f7e91446bdc536db77e74388a73e51f5111ffc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342820
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#41899}
Also remove all dependencies on rtc_media_base except for a few
that are suspected of being linker directives.
Bug: webrtc:14775
Change-Id: Ic0daf88b5422047d3ed7079ee6af9e689853310c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/341461
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41886}
There's an AV1 encoder speed setting 11 that is supposed to be used
for screen sharing content.
Bug: chromium:328598314
Change-Id: Id97898554a740eb1684d03c782c718c19f4c95e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342201
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41874}
describing video codecs with their parameters as static members of SdpVideoFormat:
static const SdpVideoFormat VP8();
static const SdpVideoFormat H264();
static const SdpVideoFormat VP9Profile0();
static const SdpVideoFormat VP9Profile1();
static const SdpVideoFormat VP9Profile2();
static const SdpVideoFormat VP9Profile3();
static const SdpVideoFormat AV1Profile0();
static const SdpVideoFormat AV1Profile1();
This removes the need to craft instances of these by hand.
BUG=webrtc:15703
Change-Id: I2171e08b48ec98f18424f53f3b5d6d148130532e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337441
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41833}
The feature isn't in use by Google and has proven to contain security
issues. It's time to remove it.
Bug: b/324864439
Change-Id: I80344eb2f2060469d2d69a54dc4519fdd02ab4ea
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340324
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41808}
It used up to 3 threads for QVGA on Android before. This change disables Android-specific code path in NumberOfThreads() and uses the generic settings, which configure 1 thread for resolutions <=VGA, instead. The change is guarded by a killswitch.
For reference, frame encode time for VGA 512kbps using 1 thread on Pixel 2 (7 years old device; SD835) is ~5.5ms: https://chromeperf.appspot.com/report?sid=6e80c701ef6ff0d008a299fb122a16f0d2600ddfcd9981d3d75cd722c92b2869
Bug: webrtc:15828, b/316494683
Change-Id: I0e9571ede64c6cb77d529d21ccb0310ccb8bfdaf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337601
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41770}
Example: "WebRTC-LibvpxVp9Encoder-SvcFrameDropConfig/Enabled,layer_drop_mode:1,max_consec_drop:7/"
It is only possible to enable LAYER_DROP (layer_drop_mode=1) for now. All other modes are ignored. Max consecutive frame drops (max_consec_drop) value from the field is always applied if the field trial is enabled.
LAYER_DROP requires flexible mode (is_flexible_mode_=true) which can be enabled by means of WebRTC-Vp9InterLayerPred: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/media/engine/webrtc_video_engine.cc;l=976
Bug: webrtc:15827, b/320629637
Change-Id: I9c4d4838b11547e608d863198b109cb1485902d6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335041
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41755}
This is a reland of commit a2655449ee
This CL guards H265 header behind RTC_ENABLE_H265.
Original change's description:
> Add HEVC support for h264_packet_buffer.
>
> Renamed to h26x_packet_buffer as it also supports HEVC now. For HEVC,
> start code is added by depacktizer, and remote endpoint must send
> sequence and picture information in-band.
>
> Co-authored-by: Qiujiao Wu <qiujiao.wu@intel.com>
>
> Bug: webrtc:13485
> Change-Id: I321cb223357d8d15da95cec80ec0c3a43c26734e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/333863
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Commit-Queue: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41739}
Bug: webrtc:13485
Change-Id: I478e0ab88adcef34100670a90b12251ab3c9b623
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/339822
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41748}
Renamed to h26x_packet_buffer as it also supports HEVC now. For HEVC,
start code is added by depacktizer, and remote endpoint must send
sequence and picture information in-band.
Co-authored-by: Qiujiao Wu <qiujiao.wu@intel.com>
Bug: webrtc:13485
Change-Id: I321cb223357d8d15da95cec80ec0c3a43c26734e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/333863
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41739}
This is a reland of commit 050ffefd85
Original change's description:
> Extends WebRTC logs for software encoder fallback
>
> This CL extends logging related to HW->SW fallbacks on the encoder
> side in WebRTC. The goal is to make it easier to track down the
> different steps taken when setting up the video encoder and why/when
> HW encoding fails.
>
> Current logs are added on several lines which makes regexp searching
> difficult. This CL adds all related information on one line instead.
>
> Three new search tags are also added VSE (VideoStreamEncoder), VESFW
> (VideoEncoderSoftwareFallbackWrapper) and SEA (SimulcastEncoderAdapter). The idea is to allow searching for the tags to see correlated logs.
>
> It has been verified that these added logs also show up in WebRTC
> logs in Meet.
>
> Logs from the GPU process are not included due to the sandboxed
> nature which makes it much more complex to add to the native
> WebRTC log. I think that these simple logs will provide value as is.
>
> Example: https://gist.github.com/henrik-and/41946f7f0b10774241bd14d7687f770b
>
> Bug: b/322132132
> Change-Id: Iec58c9741a9dd6bab3236a88e9a6e45440f5d980
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/339260
> Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41733}
NOTRY=true
Bug: b/322132132
Change-Id: I25dd34b9ba59ea8502e47b4c89cd111430636e08
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/339680
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41736}
This reverts commit 050ffefd85.
Reason for revert: Breaks downstream project.
Original change's description:
> Extends WebRTC logs for software encoder fallback
>
> This CL extends logging related to HW->SW fallbacks on the encoder
> side in WebRTC. The goal is to make it easier to track down the
> different steps taken when setting up the video encoder and why/when
> HW encoding fails.
>
> Current logs are added on several lines which makes regexp searching
> difficult. This CL adds all related information on one line instead.
>
> Three new search tags are also added VSE (VideoStreamEncoder), VESFW
> (VideoEncoderSoftwareFallbackWrapper) and SEA (SimulcastEncoderAdapter). The idea is to allow searching for the tags to see correlated logs.
>
> It has been verified that these added logs also show up in WebRTC
> logs in Meet.
>
> Logs from the GPU process are not included due to the sandboxed
> nature which makes it much more complex to add to the native
> WebRTC log. I think that these simple logs will provide value as is.
>
> Example: https://gist.github.com/henrik-and/41946f7f0b10774241bd14d7687f770b
>
> Bug: b/322132132
> Change-Id: Iec58c9741a9dd6bab3236a88e9a6e45440f5d980
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/339260
> Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41733}
Bug: b/322132132
Change-Id: I24d0a4e71a43ac192485f1af208563a51d919865
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/339661
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41735}
This CL extends logging related to HW->SW fallbacks on the encoder
side in WebRTC. The goal is to make it easier to track down the
different steps taken when setting up the video encoder and why/when
HW encoding fails.
Current logs are added on several lines which makes regexp searching
difficult. This CL adds all related information on one line instead.
Three new search tags are also added VSE (VideoStreamEncoder), VESFW
(VideoEncoderSoftwareFallbackWrapper) and SEA (SimulcastEncoderAdapter). The idea is to allow searching for the tags to see correlated logs.
It has been verified that these added logs also show up in WebRTC
logs in Meet.
Logs from the GPU process are not included due to the sandboxed
nature which makes it much more complex to add to the native
WebRTC log. I think that these simple logs will provide value as is.
Example: https://gist.github.com/henrik-and/41946f7f0b10774241bd14d7687f770b
Bug: b/322132132
Change-Id: Iec58c9741a9dd6bab3236a88e9a6e45440f5d980
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/339260
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41733}
To reduce number calls to the CreateVideoDecoder
Bug: webrtc:15791
Change-Id: I5d6ecc2e5e68165d4e012b3ad7edb6eaa40e1913
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336420
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41706}
The division by 2 has been accidentally removed in https://webrtc-review.googlesource.com/c/src/+/76921
The code and comment are out of sync now.
Bug: None
Change-Id: If43a40461878ffe58dd9ed0ab8a6244ad79c4f6b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336283
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Auto-Submit: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41627}
This allows using different encoder and decoder implementations in a test. For example, to encode with SW encoder and to decode with HW decoder or vice versa.
Bug: webrtc:14852
Change-Id: Ic100cba2158fb6311b84a54a0831f2a0dcff9270
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335300
Auto-Submit: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41571}
Tracking keyframe packets is a useless optimization that kicked in when the nack list is full (1000 packets).
Bug: none
Change-Id: I134ecb4d51131718e5bb8775847fbde18f262ef9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334645
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41547}
This is a reland of commit 63d03f586b
Original change's description:
> Unify access to SDP codec parameters
>
> which come from the a=fmtp:<pt> lines in the SDP and were used as either
> std::map<std::string, std:string>
> with three aliases,
> cricket::CodecParameterMap
> SdpAudioFormat::Parameters
> SdpVideoFormat::Parameters
>
> Use webrtc::CodecParameterMap in all places.
>
> BUG=None
>
> Change-Id: If47692bde7347834c349c6539b43309d8770e67b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#41375}
Bug: None
Change-Id: I5f8f45688df232eb37b12fa3e56a893a1c754e17
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/331402
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41467}
which come from the a=fmtp:<pt> lines in the SDP and were used as either
std::map<std::string, std:string>
with three aliases,
cricket::CodecParameterMap
SdpAudioFormat::Parameters
SdpVideoFormat::Parameters
Use webrtc::CodecParameterMap in all places.
BUG=None
Change-Id: If47692bde7347834c349c6539b43309d8770e67b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41375}
Move logging of decode failure from VCMGenericDecoder to VideoReceiveStream2 where remote SSRC is always known. Log frame details such as size and resolution which help to identify this frame in bitstream dump.
Bug: b/309132190
Change-Id: Ibe50799e448ffdc19f9857cc1625cfde0d7aa7a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328821
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41276}