From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../rtc_tools/frame_analyzer/frame_analyzer.cc | 197 ++++++++++++++++ .../frame_analyzer/linear_least_squares.cc | 206 +++++++++++++++++ .../frame_analyzer/linear_least_squares.h | 56 +++++ .../linear_least_squares_unittest.cc | 93 ++++++++ .../reference_less_video_analysis.cc | 41 ++++ .../reference_less_video_analysis_lib.cc | 139 ++++++++++++ .../reference_less_video_analysis_lib.h | 48 ++++ .../reference_less_video_analysis_unittest.cc | 49 ++++ .../frame_analyzer/video_color_aligner.cc | 237 ++++++++++++++++++++ .../rtc_tools/frame_analyzer/video_color_aligner.h | 51 +++++ .../frame_analyzer/video_color_aligner_unittest.cc | 176 +++++++++++++++ .../frame_analyzer/video_geometry_aligner.cc | 178 +++++++++++++++ .../frame_analyzer/video_geometry_aligner.h | 57 +++++ .../video_geometry_aligner_unittest.cc | 153 +++++++++++++ .../frame_analyzer/video_quality_analysis.cc | 160 +++++++++++++ .../frame_analyzer/video_quality_analysis.h | 103 +++++++++ .../video_quality_analysis_unittest.cc | 249 +++++++++++++++++++++ .../frame_analyzer/video_temporal_aligner.cc | 238 ++++++++++++++++++++ .../frame_analyzer/video_temporal_aligner.h | 61 +++++ .../video_temporal_aligner_unittest.cc | 129 +++++++++++ 20 files changed, 2621 insertions(+) create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/frame_analyzer.cc create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/linear_least_squares.cc create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/linear_least_squares.h create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/linear_least_squares_unittest.cc create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/reference_less_video_analysis.cc create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_lib.cc create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_lib.h create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/reference_less_video_analysis_unittest.cc create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/video_color_aligner.cc create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/video_color_aligner.h create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/video_color_aligner_unittest.cc create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/video_geometry_aligner.cc create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/video_geometry_aligner.h create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/video_geometry_aligner_unittest.cc create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/video_quality_analysis.cc create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/video_quality_analysis.h create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/video_quality_analysis_unittest.cc create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/video_temporal_aligner.cc create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/video_temporal_aligner.h create mode 100644 third_party/libwebrtc/rtc_tools/frame_analyzer/video_temporal_aligner_unittest.cc (limited to 'third_party/libwebrtc/rtc_tools/frame_analyzer') diff --git a/third_party/libwebrtc/rtc_tools/frame_analyzer/frame_analyzer.cc b/third_party/libwebrtc/rtc_tools/frame_analyzer/frame_analyzer.cc new file mode 100644 index 0000000000..501a6142a8 --- /dev/null +++ b/third_party/libwebrtc/rtc_tools/frame_analyzer/frame_analyzer.cc @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include +#include + +#include +#include +#include + +#include "absl/flags/flag.h" +#include "absl/flags/parse.h" +#include "absl/strings/match.h" +#include "api/scoped_refptr.h" +#include "api/test/metrics/chrome_perf_dashboard_metrics_exporter.h" +#include "api/test/metrics/global_metrics_logger_and_exporter.h" +#include "api/test/metrics/metrics_exporter.h" +#include "api/test/metrics/stdout_metrics_exporter.h" +#include "rtc_base/strings/string_builder.h" +#include "rtc_tools/frame_analyzer/video_color_aligner.h" +#include "rtc_tools/frame_analyzer/video_geometry_aligner.h" +#include "rtc_tools/frame_analyzer/video_quality_analysis.h" +#include "rtc_tools/frame_analyzer/video_temporal_aligner.h" +#include "rtc_tools/video_file_reader.h" +#include "rtc_tools/video_file_writer.h" + +ABSL_FLAG(int32_t, width, -1, "The width of the reference and test files"); +ABSL_FLAG(int32_t, height, -1, "The height of the reference and test files"); +ABSL_FLAG(std::string, + label, + "MY_TEST", + "The label to use for the perf output"); +ABSL_FLAG(std::string, + reference_file, + "ref.yuv", + "The reference YUV file to run the analysis against"); +ABSL_FLAG(std::string, + test_file, + "test.yuv", + "The test YUV file to run the analysis for"); +ABSL_FLAG(std::string, + aligned_output_file, + "", + "Where to write aligned YUV/Y4M output file, f not present, no files " + "will be written"); +ABSL_FLAG(std::string, + yuv_directory, + "", + "Where to write aligned YUV ref+test output files, if not present, " + "no files will be written"); +ABSL_FLAG(std::string, + chartjson_result_file, + "", + "Where to store perf result in chartjson format, if not present, no " + "perf result will be stored"); + +namespace { + +#ifdef WIN32 +const char* const kPathDelimiter = "\\"; +#else +const char* const kPathDelimiter = "/"; +#endif + +std::string JoinFilename(std::string directory, std::string filename) { + return directory + kPathDelimiter + filename; +} + +} // namespace + +/* + * A command line tool running PSNR and SSIM on a reference video and a test + * video. The test video is a record of the reference video which can start at + * an arbitrary point. It is possible that there will be repeated frames or + * skipped frames as well. The video files should be I420 .y4m or .yuv videos. + * If both files are .y4m, it's not needed to specify width/height. The tool + * prints the result to standard output in the Chromium perf format: + * RESULT :