summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/api/test/video_codec_stats.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /third_party/libwebrtc/api/test/video_codec_stats.cc
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/api/test/video_codec_stats.cc')
-rw-r--r--third_party/libwebrtc/api/test/video_codec_stats.cc97
1 files changed, 97 insertions, 0 deletions
diff --git a/third_party/libwebrtc/api/test/video_codec_stats.cc b/third_party/libwebrtc/api/test/video_codec_stats.cc
new file mode 100644
index 0000000000..fb7226701e
--- /dev/null
+++ b/third_party/libwebrtc/api/test/video_codec_stats.cc
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2023 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 "api/test/video_codec_stats.h"
+
+namespace webrtc {
+namespace test {
+
+void VideoCodecStats::Stream::LogMetrics(
+ MetricsLogger* logger,
+ std::string test_case_name,
+ std::map<std::string, std::string> metadata) const {
+ logger->LogMetric("width", test_case_name, width, Unit::kCount,
+ webrtc::test::ImprovementDirection::kBiggerIsBetter,
+ metadata);
+
+ logger->LogMetric("height", test_case_name, height, Unit::kCount,
+ webrtc::test::ImprovementDirection::kBiggerIsBetter,
+ metadata);
+
+ logger->LogMetric(
+ "frame_size_bytes", test_case_name, frame_size_bytes, Unit::kBytes,
+ webrtc::test::ImprovementDirection::kNeitherIsBetter, metadata);
+
+ logger->LogMetric("keyframe", test_case_name, keyframe, Unit::kCount,
+ webrtc::test::ImprovementDirection::kSmallerIsBetter,
+ metadata);
+
+ logger->LogMetric("qp", test_case_name, qp, Unit::kUnitless,
+ webrtc::test::ImprovementDirection::kSmallerIsBetter,
+ metadata);
+
+ logger->LogMetric(
+ "encode_time_ms", test_case_name, encode_time_ms, Unit::kMilliseconds,
+ webrtc::test::ImprovementDirection::kSmallerIsBetter, metadata);
+
+ logger->LogMetric(
+ "decode_time_ms", test_case_name, decode_time_ms, Unit::kMilliseconds,
+ webrtc::test::ImprovementDirection::kSmallerIsBetter, metadata);
+
+ logger->LogMetric("target_bitrate_kbps", test_case_name, target_bitrate_kbps,
+ Unit::kKilobitsPerSecond,
+ webrtc::test::ImprovementDirection::kBiggerIsBetter,
+ metadata);
+
+ logger->LogMetric("target_framerate_fps", test_case_name,
+ target_framerate_fps, Unit::kHertz,
+ webrtc::test::ImprovementDirection::kBiggerIsBetter,
+ metadata);
+
+ logger->LogMetric("encoded_bitrate_kbps", test_case_name,
+ encoded_bitrate_kbps, Unit::kKilobitsPerSecond,
+ webrtc::test::ImprovementDirection::kBiggerIsBetter,
+ metadata);
+
+ logger->LogMetric("encoded_framerate_fps", test_case_name,
+ encoded_framerate_fps, Unit::kHertz,
+ webrtc::test::ImprovementDirection::kBiggerIsBetter,
+ metadata);
+
+ logger->LogMetric("bitrate_mismatch_pct", test_case_name,
+ bitrate_mismatch_pct, Unit::kPercent,
+ webrtc::test::ImprovementDirection::kSmallerIsBetter,
+ metadata);
+
+ logger->LogMetric("framerate_mismatch_pct", test_case_name,
+ framerate_mismatch_pct, Unit::kPercent,
+ webrtc::test::ImprovementDirection::kSmallerIsBetter,
+ metadata);
+
+ logger->LogMetric("transmission_time_ms", test_case_name,
+ transmission_time_ms, Unit::kMilliseconds,
+ webrtc::test::ImprovementDirection::kSmallerIsBetter,
+ metadata);
+
+ logger->LogMetric("psnr_y_db", test_case_name, psnr.y, Unit::kUnitless,
+ webrtc::test::ImprovementDirection::kBiggerIsBetter,
+ metadata);
+
+ logger->LogMetric("psnr_u_db", test_case_name, psnr.u, Unit::kUnitless,
+ webrtc::test::ImprovementDirection::kBiggerIsBetter,
+ metadata);
+
+ logger->LogMetric("psnr_v_db", test_case_name, psnr.v, Unit::kUnitless,
+ webrtc::test::ImprovementDirection::kBiggerIsBetter,
+ metadata);
+}
+
+} // namespace test
+} // namespace webrtc