#include "rtc_tools/frame_analyzer/video_quality_analysis.h"
#include <algorithm>
#include <array>
#include <cstddef>
#include "api/numerics/samples_stats_counter.h"
#include "api/test/metrics/metric.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "third_party/libyuv/include/libyuv/compare.h"
namespace webrtc {
namespace test {
ResultsContainer::ResultsContainer() { … }
ResultsContainer::~ResultsContainer() { … }
template <typename FrameMetricFunction>
static double CalculateMetric(
const FrameMetricFunction& frame_metric_function,
const rtc::scoped_refptr<I420BufferInterface>& ref_buffer,
const rtc::scoped_refptr<I420BufferInterface>& test_buffer) { … }
double Psnr(const rtc::scoped_refptr<I420BufferInterface>& ref_buffer,
const rtc::scoped_refptr<I420BufferInterface>& test_buffer) { … }
double Ssim(const rtc::scoped_refptr<I420BufferInterface>& ref_buffer,
const rtc::scoped_refptr<I420BufferInterface>& test_buffer) { … }
std::vector<AnalysisResult> RunAnalysis(
const rtc::scoped_refptr<webrtc::test::Video>& reference_video,
const rtc::scoped_refptr<webrtc::test::Video>& test_video,
const std::vector<size_t>& test_frame_indices) { … }
std::vector<Cluster> CalculateFrameClusters(
const std::vector<size_t>& indices) { … }
int GetMaxRepeatedFrames(const std::vector<Cluster>& clusters) { … }
int GetMaxSkippedFrames(const std::vector<Cluster>& clusters) { … }
int GetTotalNumberOfSkippedFrames(const std::vector<Cluster>& clusters) { … }
void PrintAnalysisResults(const std::string& label,
ResultsContainer& results,
MetricsLogger& logger) { … }
}
}