Bug 1952339 - Vendor libwebrtc from 6e95644b2c

Upstream commit: https://webrtc.googlesource.com/src/+/6e95644b2c90021099f05af3b23458c23525ca0b
    Enable corruption detection for H265.

    Bug: webrtc:358039777
    Change-Id: I88de4341187019bbfc6847d0cfeca88b5f9fd594
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/379080
    Commit-Queue: Emil Vardar (xWF) <vardar@google.com>
    Reviewed-by: Erik Språng <sprang@webrtc.org>
    Reviewed-by: Fanny Linderborg <linderborg@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#44003}

Differential Revision: https://phabricator.services.mozilla.com/D244013
This commit is contained in:
Michael Froman
2025-03-07 17:02:58 -06:00
parent 62a7a887f3
commit df7cbaad39
3 changed files with 23 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-03-07T23:01:54.516615+00:00.
libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-03-07T23:02:48.513554+00:00.
# base of lastest vendoring
caa8ef3ab5
6e95644b2c

View File

@@ -24,6 +24,7 @@ constexpr int kChromaThresholdVp8 = 6;
constexpr int kChromaThresholdVp9 = 4;
constexpr int kChromaThresholdAv1 = 4;
constexpr int kChromaThresholdH264 = 2;
constexpr int kChromaThresholdH265 = 4;
int LumaThreshold(VideoCodecType codec_type) {
return kLumaThreshold;
@@ -39,6 +40,8 @@ int ChromaThreshold(VideoCodecType codec_type) {
return kChromaThresholdAv1;
case VideoCodecType::kVideoCodecH264:
return kChromaThresholdH264;
case VideoCodecType::kVideoCodecH265:
return kChromaThresholdH265;
default:
RTC_FATAL() << "Codec type " << CodecTypeToPayloadString(codec_type)
<< " is not supported.";
@@ -65,6 +68,10 @@ double MapQpToOptimalStdDev(int qp, VideoCodecType codec_type) {
return RationalFunction(0.69, -256, 0.42, qp);
case VideoCodecType::kVideoCodecH264:
return ExponentialFunction(0.016, 0.13976962, -1.40179328, qp);
case VideoCodecType::kVideoCodecH265:
// Observe that these values are currently only tuned for software libx265
// in "preset ultrafast -tune zerolatency" mode.
return RationalFunction(1.6, -52, 0.1, qp);
default:
RTC_FATAL() << "Codec type " << CodecTypeToPayloadString(codec_type)
<< " is not supported.";

View File

@@ -27,6 +27,7 @@ constexpr int kChromaThresholdVp8 = 6;
constexpr int kChromaThresholdVp9 = 4;
constexpr int kChromaThresholdAv1 = 4;
constexpr int kChromaThresholdH264 = 2;
constexpr int kChromaThresholdH265 = 4;
TEST(GenericMappingFunctionsTest, TestVp8) {
constexpr VideoCodecType kCodecType = VideoCodecType::kVideoCodecVP8;
@@ -88,5 +89,18 @@ TEST(GenericMappingFunctionsTest, TestH264) {
kChromaThresholdH264));
}
TEST(GenericMappingFunctionsTest, TestH265) {
constexpr VideoCodecType kCodecType = VideoCodecType::kVideoCodecH265;
EXPECT_THAT(GetCorruptionFilterSettings(/*qp=*/10, kCodecType),
FieldsAre(DoubleNear(0.481, kMaxAbsoluteError), kLumaThreshold,
kChromaThresholdH265));
EXPECT_THAT(GetCorruptionFilterSettings(/*qp=*/30, kCodecType),
FieldsAre(DoubleNear(2.2818, kMaxAbsoluteError), kLumaThreshold,
kChromaThresholdH265));
EXPECT_THAT(GetCorruptionFilterSettings(/*qp=*/51, kCodecType),
FieldsAre(DoubleNear(81.7, kMaxAbsoluteError), kLumaThreshold,
kChromaThresholdH265));
}
} // namespace
} // namespace webrtc