From fc88df81f6dad20f58221af4ed8beeb10816d640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Spr=C3=A5ng?= Date: Wed, 5 May 2021 10:57:48 +0200 Subject: [PATCH] Set new defaults for vp8 decoder deblocking params MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:11551 Change-Id: Ica8d587c32b36500739120205dde954502e01c3f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217383 Commit-Queue: Erik Språng Reviewed-by: Åsa Persson Cr-Commit-Position: refs/heads/master@{#33924} --- .../video_coding/codecs/test/videocodec_test_libvpx.cc | 2 +- modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc | 10 +++------- modules/video_coding/codecs/vp8/libvpx_vp8_decoder.h | 9 ++++++--- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/modules/video_coding/codecs/test/videocodec_test_libvpx.cc b/modules/video_coding/codecs/test/videocodec_test_libvpx.cc index 8076e40fd4..fa768927b0 100644 --- a/modules/video_coding/codecs/test/videocodec_test_libvpx.cc +++ b/modules/video_coding/codecs/test/videocodec_test_libvpx.cc @@ -301,7 +301,7 @@ TEST(VideoCodecTestLibvpx, MAYBE_ChangeFramerateVP8) { {31, 30, 0.85, 0.84}, {31.5, 30.5, 0.86, 0.84}, {30.5, 29, 0.83, 0.78}}; #else std::vector quality_thresholds = { - {31, 30, 0.87, 0.86}, {32, 31, 0.89, 0.86}, {32, 30, 0.87, 0.82}}; + {31, 30, 0.87, 0.85}, {32, 31, 0.88, 0.85}, {32, 30, 0.87, 0.82}}; #endif fixture->RunTest(rate_profiles, &rc_thresholds, &quality_thresholds, nullptr); } diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc b/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc index 979ded9a63..9d6ffdba90 100644 --- a/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc +++ b/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc @@ -54,13 +54,9 @@ constexpr bool kIsArm = false; #endif absl::optional DefaultDeblockParams() { - if (kIsArm) { - // For ARM, this is only called when deblocking is explicitly enabled, and - // the default strength is set by the ctor. - return LibvpxVp8Decoder::DeblockParams(); - } - // For non-arm, don't use the explicit deblocking settings by default. - return absl::nullopt; + return LibvpxVp8Decoder::DeblockParams(/*max_level=*/8, + /*degrade_qp=*/60, + /*min_qp=*/30); } absl::optional diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.h b/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.h index 8d84b67ce3..60295e5d5d 100644 --- a/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.h +++ b/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.h @@ -42,9 +42,12 @@ class LibvpxVp8Decoder : public VideoDecoder { const char* ImplementationName() const override; struct DeblockParams { - int max_level = 6; // Deblocking strength: [0, 16]. - int degrade_qp = 1; // If QP value is below, start lowering |max_level|. - int min_qp = 0; // If QP value is below, turn off deblocking. + DeblockParams() : max_level(6), degrade_qp(1), min_qp(0) {} + DeblockParams(int max_level, int degrade_qp, int min_qp) + : max_level(max_level), degrade_qp(degrade_qp), min_qp(min_qp) {} + int max_level; // Deblocking strength: [0, 16]. + int degrade_qp; // If QP value is below, start lowering |max_level|. + int min_qp; // If QP value is below, turn off deblocking. }; private: