commit fa4e3d4c986fef32981e3b9f6406c8e67ea791e5 parent ffaa323af667dee1208ee8e2bcfb7f28143cefbf Author: Dan Baker <dbaker@mozilla.com> Date: Thu, 23 Oct 2025 14:47:54 -0600 Bug 1995393 - Vendor libwebrtc from c0426dbdf7 Upstream commit: https://webrtc.googlesource.com/src/+/c0426dbdf7f5558f50b6ca33e6a8bfbd92d39e25 Propagate clock into VP8Decoder::QpSmoother Bug: webrtc:42223992 Change-Id: I6b8f3023b4b6d2489549488515d789344404b1c5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/404240 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@{#45326} Diffstat:
6 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-23T20:45:33.826626+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-23T20:47:39.634926+00:00. # base of lastest vendoring -af1ea44cfb +c0426dbdf7 diff --git a/third_party/libwebrtc/modules/video_coding/BUILD.gn b/third_party/libwebrtc/modules/video_coding/BUILD.gn @@ -618,7 +618,6 @@ rtc_library("webrtc_vp8") { "../../rtc_base:logging", "../../rtc_base:rtc_numerics", "../../rtc_base:safe_conversions", - "../../rtc_base:timeutils", "../../rtc_base/experiments:encoder_info_settings", "../../rtc_base/experiments:field_trial_parser", "../../rtc_base/experiments:rate_control_settings", diff --git a/third_party/libwebrtc/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc b/third_party/libwebrtc/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc @@ -21,6 +21,7 @@ #include "api/environment/environment.h" #include "api/field_trials_view.h" #include "api/scoped_refptr.h" +#include "api/units/timestamp.h" #include "api/video/color_space.h" #include "api/video/encoded_image.h" #include "api/video/i420_buffer.h" @@ -32,7 +33,6 @@ #include "modules/video_coding/include/video_error_codes.h" #include "rtc_base/checks.h" #include "rtc_base/numerics/exp_filter.h" -#include "rtc_base/time_utils.h" #include "system_wrappers/include/metrics.h" #include "third_party/libvpx/source/libvpx/vpx/vp8.h" #include "third_party/libvpx/source/libvpx/vpx/vp8dx.h" @@ -96,7 +96,10 @@ std::unique_ptr<VideoDecoder> CreateVp8Decoder(const Environment& env) { class LibvpxVp8Decoder::QpSmoother { public: - QpSmoother() : last_sample_ms_(TimeMillis()), smoother_(kAlpha) {} + explicit QpSmoother(const Environment& env) + : env_(env), + last_sample_(env_.clock().CurrentTime()), + smoother_(kAlpha) {} int GetAvg() const { float value = smoother_.filtered(); @@ -104,16 +107,18 @@ class LibvpxVp8Decoder::QpSmoother { } void Add(float sample) { - int64_t now_ms = TimeMillis(); - smoother_.Apply(static_cast<float>(now_ms - last_sample_ms_), sample); - last_sample_ms_ = now_ms; + Timestamp now = env_.clock().CurrentTime(); + smoother_.Apply((now - last_sample_).ms<float>(), sample); + last_sample_ = now; } void Reset() { smoother_.Reset(kAlpha); } private: - const float kAlpha = 0.95f; - int64_t last_sample_ms_; + static constexpr float kAlpha = 0.95f; + + const Environment env_; + Timestamp last_sample_; ExpFilter smoother_; }; @@ -131,7 +136,8 @@ LibvpxVp8Decoder::LibvpxVp8Decoder(const Environment& env) deblock_params_(use_postproc_ ? GetPostProcParamsFromFieldTrialGroup( env.field_trials()) : std::nullopt), - qp_smoother_(use_postproc_ ? new QpSmoother() : nullptr) {} + qp_smoother_(use_postproc_ ? std::make_unique<QpSmoother>(env) + : nullptr) {} LibvpxVp8Decoder::~LibvpxVp8Decoder() { inited_ = true; // in order to do the actual release diff --git a/third_party/libwebrtc/moz-patch-stack/s0018.patch b/third_party/libwebrtc/moz-patch-stack/s0018.patch @@ -10,7 +10,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/1387b2c480b55ecca 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc b/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc -index 13e7b3229b..85b85e06a2 100644 +index 5e51c316cc..3578e2651a 100644 --- a/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc +++ b/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc @@ -51,7 +51,7 @@ const char kVp8PostProcArmFieldTrial[] = "WebRTC-VP8-Postproc-Config-Arm"; diff --git a/third_party/libwebrtc/moz-patch-stack/s0100.patch b/third_party/libwebrtc/moz-patch-stack/s0100.patch @@ -39,7 +39,7 @@ index 0f2341a462..51d055bcf0 100644 group("media") { diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn -index 2ef666d59a..2eddb81fd7 100644 +index ef3d60ee34..0d68cb4b29 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -7,7 +7,7 @@ diff --git a/third_party/libwebrtc/moz-patch-stack/s0102.patch b/third_party/libwebrtc/moz-patch-stack/s0102.patch @@ -588,7 +588,7 @@ index a693604389..72972d18e1 100644 import("../../webrtc.gni") diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn -index 2eddb81fd7..11da028bd3 100644 +index 0d68cb4b29..43a7a2e8d8 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -6,7 +6,7 @@