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}
This commit is contained in:
brandtr
2017-08-25 04:51:54 -07:00
committed by Commit Bot
parent 26e3abbb40
commit ee95f87488
3 changed files with 4 additions and 9 deletions

View File

@ -38,7 +38,7 @@ const VisualizationParams kVisualizationParams = {
false, // save_decoded_y4m false, // save_decoded_y4m
}; };
const int kNumFrames = 299; const int kNumFrames = 300;
} // namespace } // namespace

View File

@ -34,7 +34,7 @@ const char kForemanCif[] = "foreman_cif";
#if !defined(WEBRTC_IOS) #if !defined(WEBRTC_IOS)
const int kNumFramesShort = 100; const int kNumFramesShort = 100;
#endif #endif
const int kNumFramesLong = 299; const int kNumFramesLong = 300;
const std::nullptr_t kNoVisualizationParams = nullptr; const std::nullptr_t kNoVisualizationParams = nullptr;

View File

@ -496,9 +496,7 @@ class VideoProcessorIntegrationTest : public testing::Test {
// In batch mode, we calculate the metrics for all frames after all frames // In batch mode, we calculate the metrics for all frames after all frames
// have been sent for encoding. // have been sent for encoding.
// TODO(brandtr): Refactor "frame number accounting" so we don't have to for (frame_number = 0; frame_number < num_frames; ++frame_number) {
// call ProcessFrame num_frames+1 times here.
for (frame_number = 0; frame_number <= num_frames; ++frame_number) {
processor_->ProcessFrame(frame_number); processor_->ProcessFrame(frame_number);
} }
@ -543,16 +541,13 @@ class VideoProcessorIntegrationTest : public testing::Test {
processor_->SetRates(bitrate_kbps_, framerate_); 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 // 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). // frames since the last rate update (if not in batch mode).
PrintAndMaybeVerifyRateControlMetrics(update_index, rc_thresholds); PrintAndMaybeVerifyRateControlMetrics(update_index, rc_thresholds);
EXPECT_EQ(num_frames, frame_number); EXPECT_EQ(num_frames, frame_number);
EXPECT_EQ(num_frames + 1, static_cast<int>(stats_.stats_.size())); EXPECT_EQ(num_frames, static_cast<int>(stats_.stats_.size()));
// Release encoder and decoder to make sure they have finished processing. // Release encoder and decoder to make sure they have finished processing.
processor_->Release(); processor_->Release();