Commit 07f5380b authored by David Staessens's avatar David Staessens Committed by Commit Bot

media/gpu/test: Change dropped frame rate to dropped frame percentage.

The new video_decode_accelerator_perf_tests collect various performance metrics
while decoding a video. To give an idea of the relative amount of frames dropped
the 'frame drop rate' is calculated, which is the ratio between frames dropped
and frames not-dropped. This metric is unfortunately rather confusing to
interpret (e.g. 50% of frames dropped is a frame drop rate of 1). The drop rate
was initially used rather than drop percentage to keep in sync with the old
video_decode_accelerator_unittest.

This CL changes the 'frame drop rate' metric to the more readable 'frame drop
percentage', which is also the metric collected by various other tests such as
the Tast playback_perf_* tests.

TEST=new vda performance tests on eve

BUG=None

Change-Id: I674e47b9d540df0348ee53f4cf71f5cc19fb5db8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1750534Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Commit-Queue: David Staessens <dstaessens@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686680}
parent 317f71a5
......@@ -87,8 +87,9 @@ struct PerformanceMetrics {
// The number of frames dropped because of the decoder running behind, only
// relevant for capped performance tests.
size_t frames_dropped_ = 0;
// The rate at which frames are dropped: dropped frames / non-dropped frames.
double dropped_frame_rate_ = 0;
// The percentage of frames dropped because of the decoder running behind,
// only relevant for capped performance tests.
double dropped_frame_percentage_ = 0.0;
// Statistics about the time between subsequent frame deliveries.
PerformanceTimeStats delivery_time_stats_;
// Statistics about the time between decode start and frame deliveries.
......@@ -165,12 +166,12 @@ void PerformanceEvaluator::StopMeasuring() {
perf_metrics_.total_duration_.InSecondsF();
perf_metrics_.frames_dropped_ = frame_renderer_->FramesDropped();
// Calculate the frame drop rate.
// TODO(dstaessens@) Find a better metric for dropped frames.
size_t frames_rendered =
perf_metrics_.frames_decoded_ - perf_metrics_.frames_dropped_;
perf_metrics_.dropped_frame_rate_ =
perf_metrics_.frames_dropped_ / std::max<size_t>(frames_rendered, 1ul);
// Calculate the dropped frame percentage.
perf_metrics_.dropped_frame_percentage_ =
static_cast<double>(perf_metrics_.frames_dropped_) /
static_cast<double>(
std::max<size_t>(perf_metrics_.frames_decoded_, 1ul)) *
100.0;
// Calculate delivery and decode time metrics.
perf_metrics_.delivery_time_stats_ =
......@@ -186,8 +187,8 @@ void PerformanceEvaluator::StopMeasuring() {
<< std::endl;
std::cout << "Frames Dropped: " << perf_metrics_.frames_dropped_
<< std::endl;
std::cout << "Dropped frame rate: " << perf_metrics_.dropped_frame_rate_
<< std::endl;
std::cout << "Dropped frame percentage: "
<< perf_metrics_.dropped_frame_percentage_ << "%" << std::endl;
std::cout << "Frame delivery time - average: "
<< perf_metrics_.delivery_time_stats_.avg_ms_ << "ms" << std::endl;
std::cout << "Frame delivery time - percentile 25: "
......@@ -229,8 +230,8 @@ void PerformanceEvaluator::WriteMetricsToFile() const {
metrics.SetKey(
"FramesDropped",
base::Value(base::checked_cast<int>(perf_metrics_.frames_dropped_)));
metrics.SetKey("DroppedFrameRate",
base::Value(perf_metrics_.dropped_frame_rate_));
metrics.SetKey("DroppedFramePercentage",
base::Value(perf_metrics_.dropped_frame_percentage_));
metrics.SetKey("FrameDeliveryTimeAverage",
base::Value(perf_metrics_.delivery_time_stats_.avg_ms_));
metrics.SetKey(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment