From 6a15e3ba5c144ec7b265c5d87996121d60f0250e Mon Sep 17 00:00:00 2001 From: Rasmus Brandt Date: Thu, 24 Mar 2022 08:15:44 +0100 Subject: [PATCH] Remove deprecated `heavy_metrics_computation_enabled` Bug: None Change-Id: Ieaccca83559d0f17b394c2c9bbc8d52acbaebcdb Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256601 Reviewed-by: Artem Titov Commit-Queue: Rasmus Brandt Cr-Commit-Position: refs/heads/main@{#36314} --- .../default_video_quality_analyzer_frames_comparator.cc | 5 +---- ...ault_video_quality_analyzer_frames_comparator_test.cc | 3 ++- .../default_video_quality_analyzer_shared_objects.h | 2 -- .../video/default_video_quality_analyzer_test.cc | 9 ++++++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator.cc b/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator.cc index a132cd4f3d..904671001a 100644 --- a/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator.cc +++ b/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator.cc @@ -363,10 +363,7 @@ void DefaultVideoQualityAnalyzerFramesComparator::ProcessComparison( // Perform expensive psnr and ssim calculations while not holding lock. double psnr = -1.0; double ssim = -1.0; - // TODO(brandtr): Remove `heavy_metrics_computation_enabled` when downstream - // has been updated. - if ((options_.heavy_metrics_computation_enabled || options_.compute_psnr || - options_.compute_ssim) && + if ((options_.compute_psnr || options_.compute_ssim) && comparison.captured.has_value() && comparison.rendered.has_value()) { rtc::scoped_refptr reference_buffer = comparison.captured->video_frame_buffer()->ToI420(); diff --git a/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator_test.cc b/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator_test.cc index adbd97a876..56ac7894bc 100644 --- a/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator_test.cc +++ b/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator_test.cc @@ -31,7 +31,8 @@ constexpr int kMaxFramesInFlightPerStream = 10; DefaultVideoQualityAnalyzerOptions AnalyzerOptionsForTest() { DefaultVideoQualityAnalyzerOptions options; - options.heavy_metrics_computation_enabled = false; + options.compute_psnr = false; + options.compute_ssim = false; options.adjust_cropping_before_comparing_frames = false; options.max_frames_in_flight_per_stream_count = kMaxFramesInFlightPerStream; return options; diff --git a/test/pc/e2e/analyzer/video/default_video_quality_analyzer_shared_objects.h b/test/pc/e2e/analyzer/video/default_video_quality_analyzer_shared_objects.h index 7d9fd50cdc..3b52a80d35 100644 --- a/test/pc/e2e/analyzer/video/default_video_quality_analyzer_shared_objects.h +++ b/test/pc/e2e/analyzer/video/default_video_quality_analyzer_shared_objects.h @@ -214,8 +214,6 @@ struct DefaultVideoQualityAnalyzerOptions { bool compute_ssim = true; // If true, weights the luma plane more than the chroma planes in the PSNR. bool use_weighted_psnr = false; - // DEPRECATED. - bool heavy_metrics_computation_enabled = true; // If true DefaultVideoQualityAnalyzer will try to adjust frames before // computing PSNR and SSIM for them. In some cases picture may be shifted by // a few pixels after the encode/decode step. Those difference is invisible diff --git a/test/pc/e2e/analyzer/video/default_video_quality_analyzer_test.cc b/test/pc/e2e/analyzer/video/default_video_quality_analyzer_test.cc index ec2bf587ba..1d4d24a210 100644 --- a/test/pc/e2e/analyzer/video/default_video_quality_analyzer_test.cc +++ b/test/pc/e2e/analyzer/video/default_video_quality_analyzer_test.cc @@ -44,7 +44,8 @@ constexpr char kReceiverPeerName[] = "bob"; DefaultVideoQualityAnalyzerOptions AnalyzerOptionsForTest() { DefaultVideoQualityAnalyzerOptions options; - options.heavy_metrics_computation_enabled = false; + options.compute_psnr = false; + options.compute_ssim = false; options.adjust_cropping_before_comparing_frames = false; options.max_frames_in_flight_per_stream_count = kMaxFramesInFlightPerStream; return options; @@ -596,7 +597,8 @@ TEST(DefaultVideoQualityAnalyzerTest, HeavyQualityMetricsFromEqualFrames) { /*num_squares=*/absl::nullopt); DefaultVideoQualityAnalyzerOptions analyzer_options; - analyzer_options.heavy_metrics_computation_enabled = true; + analyzer_options.compute_psnr = true; + analyzer_options.compute_ssim = true; analyzer_options.adjust_cropping_before_comparing_frames = false; analyzer_options.max_frames_in_flight_per_stream_count = kMaxFramesInFlightPerStream; @@ -654,7 +656,8 @@ TEST(DefaultVideoQualityAnalyzerTest, /*num_squares=*/absl::nullopt); DefaultVideoQualityAnalyzerOptions analyzer_options; - analyzer_options.heavy_metrics_computation_enabled = true; + analyzer_options.compute_psnr = true; + analyzer_options.compute_ssim = true; analyzer_options.adjust_cropping_before_comparing_frames = true; analyzer_options.max_frames_in_flight_per_stream_count = kMaxFramesInFlightPerStream;