From 2e1a2cd20d65a5d1f5957570035d08eafa303803 Mon Sep 17 00:00:00 2001 From: Sergey Silkin Date: Thu, 25 Apr 2024 10:19:37 +0200 Subject: [PATCH] Make stats analysis working with empty layers (bitrate=0) Setting layer's target bitrate to zero is a valid scanario. Example of command line: out/debug/video_codec_perf_tests --gtest_also_run_disabled_tests --gtest_filter=*EncodeDecode --encoder=libvpx-vp9 --decoder=libvpx-vp9 --scalability_mode=L2T1_KEY --width=640 --height=360 --bitrate_kbps=0,400 Bug: webrtc:14852 Change-Id: If0619dde1da254699939d56f2971dd0bc8391d95 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349160 Reviewed-by: Mirko Bonadei Commit-Queue: Sergey Silkin Cr-Commit-Position: refs/heads/main@{#42174} --- test/video_codec_tester.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/video_codec_tester.cc b/test/video_codec_tester.cc index ac671a9cb3..4706eb6055 100644 --- a/test/video_codec_tester.cc +++ b/test/video_codec_tester.cc @@ -574,6 +574,10 @@ class VideoCodecAnalyzer : public VideoCodecTester::VideoCodecStats { } int num_encoded_frames = stream.frame_size_bytes.NumSamples(); + if (num_encoded_frames == 0) { + return stream; + } + const Frame& first_frame = frames.front(); Filter filter_all_layers{.min_timestamp_rtp = filter.min_timestamp_rtp,