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-Original-Commit-Position: refs/heads/master@{#19515}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: ee95f874885a8489bebc54bae9c3bec26884f858
diff --git a/modules/video_coding/codecs/test/plot_videoprocessor_integrationtest.cc b/modules/video_coding/codecs/test/plot_videoprocessor_integrationtest.cc
index 198bb8a..468a718 100644
--- a/modules/video_coding/codecs/test/plot_videoprocessor_integrationtest.cc
+++ b/modules/video_coding/codecs/test/plot_videoprocessor_integrationtest.cc
@@ -38,7 +38,7 @@
     false,  // save_decoded_y4m
 };
 
-const int kNumFrames = 299;
+const int kNumFrames = 300;
 
 }  // namespace
 
diff --git a/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc b/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc
index d188d34..87dc5f3 100644
--- a/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc
+++ b/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc
@@ -34,7 +34,7 @@
 #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/modules/video_coding/codecs/test/videoprocessor_integrationtest.h b/modules/video_coding/codecs/test/videoprocessor_integrationtest.h
index 3d43d64..d87ffed 100644
--- a/modules/video_coding/codecs/test/videoprocessor_integrationtest.h
+++ b/modules/video_coding/codecs/test/videoprocessor_integrationtest.h
@@ -496,9 +496,7 @@
       // 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 @@
           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<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.
     processor_->Release();