Skip to content

Commit

Permalink
media/gpu/vea_perf_tests: Change the way of computing the bitrate dev…
Browse files Browse the repository at this point in the history
…iation

This CL changes the way of computing the bitrate deviation for
temporal layer encoding. It compares with the sums of bitrates of
the temporal layers in the same spatial layer. The value represents
more clearly the bitrate deviation of streams received by a decoder.

Bug: b:220225711
Test: video_encode_accelerator_perf_tests
Change-Id: I1ae86eb448e737d3bb6d8f57f21166982f9c092f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3583588
Reviewed-by: Miguel Casas-Sanchez <mcasas@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#992455}
  • Loading branch information
Hirokazu Honda authored and Chromium LUCI CQ committed Apr 14, 2022
1 parent 35aa8c2 commit 6a69768
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions media/gpu/video_encode_accelerator_perf_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ void BitstreamQualityMetrics::WriteToConsole(
uint32_t actual_bitrate) const {
const auto default_ssize = std::cout.precision();
std::cout << "[ Result " << svc_text << "]" << std::endl;
std::cout << "Bitrate: " << actual_bitrate << std::endl;
std::cout << "Bitrate: " << actual_bitrate << " (target: " << target_bitrate
<< ")" << std::endl;
std::cout << "Bitrate deviation: " << std::fixed << std::setprecision(2)
<< (actual_bitrate * 100.0 / target_bitrate) - 100.0 << " %"
<< std::endl;
Expand Down Expand Up @@ -459,7 +460,7 @@ void BitstreamQualityMetrics::WriteToFile(
metrics.SetKey("Bitrate",
base::Value(base::checked_cast<int>(actual_bitrate)));
metrics.SetKey(
"Bitrate deviation",
"BitrateDeviation",
base::Value((actual_bitrate * 100.0 / target_bitrate) - 100.0));
metrics.SetKey("SSIMAverage", base::Value(ssim_stats.avg));
metrics.SetKey("PSNRAverage", base::Value(psnr_stats.avg));
Expand Down Expand Up @@ -709,9 +710,12 @@ TEST_F(VideoEncoderTest, MeasureProducedBitstreamQuality) {
actual_bitrate = stats.Bitrate();
} else {
CHECK(spatial_idx && temporal_idx);
target_bitrate =
g_env->Bitrate().GetBitrateBps(*spatial_idx, *temporal_idx);
actual_bitrate = stats.LayerBitrate(*spatial_idx, *temporal_idx);
// Target and actual bitrates in temporal layer encoding are the sum of
// bitrates of the temporal layers in the spatial layer.
for (size_t tid = 0; tid <= *temporal_idx; ++tid) {
target_bitrate += g_env->Bitrate().GetBitrateBps(*spatial_idx, tid);
actual_bitrate += stats.LayerBitrate(*spatial_idx, tid);
}
}

metrics.Output(target_bitrate, actual_bitrate);
Expand Down

0 comments on commit 6a69768

Please sign in to comment.