From ee95f874885a8489bebc54bae9c3bec26884f858 Mon Sep 17 00:00:00 2001 From: brandtr Date: Fri, 25 Aug 2017 04:51:54 -0700 Subject: [PATCH] Change frame bookkeeping in VideoProcessorIntegrationTest. Now we always process |rate_profile.num_frames| number of frames. This means that the output of the tests in videoprocessor_integrationtest.cc will be slightly different, as we will no process 300 frames, instead of 299. No rate control or quality thresholds need to be updated, however. BUG=webrtc:6634 Review-Url: https://codereview.webrtc.org/3004583002 Cr-Commit-Position: refs/heads/master@{#19515} --- .../codecs/test/plot_videoprocessor_integrationtest.cc | 2 +- .../codecs/test/videoprocessor_integrationtest.cc | 2 +- .../codecs/test/videoprocessor_integrationtest.h | 9 ++------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/webrtc/modules/video_coding/codecs/test/plot_videoprocessor_integrationtest.cc b/webrtc/modules/video_coding/codecs/test/plot_videoprocessor_integrationtest.cc index 198bb8a682..468a718a88 100644 --- a/webrtc/modules/video_coding/codecs/test/plot_videoprocessor_integrationtest.cc +++ b/webrtc/modules/video_coding/codecs/test/plot_videoprocessor_integrationtest.cc @@ -38,7 +38,7 @@ const VisualizationParams kVisualizationParams = { false, // save_decoded_y4m }; -const int kNumFrames = 299; +const int kNumFrames = 300; } // namespace diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc index d188d3466b..87dc5f3043 100644 --- a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc +++ b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc @@ -34,7 +34,7 @@ const char kForemanCif[] = "foreman_cif"; #if !defined(WEBRTC_IOS) const int kNumFramesShort = 100; #endif -const int kNumFramesLong = 299; +const int kNumFramesLong = 300; const std::nullptr_t kNoVisualizationParams = nullptr; diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h index 3d43d64380..d87ffed55d 100644 --- a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h +++ b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h @@ -496,9 +496,7 @@ class VideoProcessorIntegrationTest : public testing::Test { // In batch mode, we calculate the metrics for all frames after all frames // have been sent for encoding. - // TODO(brandtr): Refactor "frame number accounting" so we don't have to - // call ProcessFrame num_frames+1 times here. - for (frame_number = 0; frame_number <= num_frames; ++frame_number) { + for (frame_number = 0; frame_number < num_frames; ++frame_number) { processor_->ProcessFrame(frame_number); } @@ -543,16 +541,13 @@ class VideoProcessorIntegrationTest : public testing::Test { processor_->SetRates(bitrate_kbps_, framerate_); } } - // TODO(brandtr): Refactor "frame number accounting" so we don't have to - // call ProcessFrame one extra time here. - processor_->ProcessFrame(frame_number); } // Verify rate control metrics for all frames (if in batch mode), or for all // frames since the last rate update (if not in batch mode). PrintAndMaybeVerifyRateControlMetrics(update_index, rc_thresholds); EXPECT_EQ(num_frames, frame_number); - EXPECT_EQ(num_frames + 1, static_cast(stats_.stats_.size())); + EXPECT_EQ(num_frames, static_cast(stats_.stats_.size())); // Release encoder and decoder to make sure they have finished processing. processor_->Release();