]> granicus.if.org Git - libvpx/commitdiff
Added Reset method to TwopassStatsStore
authorAdrian Grange <agrange@google.com>
Tue, 2 Oct 2012 16:36:41 +0000 (09:36 -0700)
committerAdrian Grange <agrange@google.com>
Wed, 3 Oct 2012 18:50:54 +0000 (11:50 -0700)
The stats buffer needs to be reset between runs of the
encoder. I added a Reset() function to TwopassStatsStore
and called it at the beginning of each encode.

This enables us to run multiple encodes which was
previously not possible since there was no way to reset
the stats between runs.

Change-Id: Iebb18dab83ba9331f009f764cc858609738a27f9

test/encode_test_driver.cc
test/encode_test_driver.h

index e93bc0938cd0d81ac1a7dffefe4527073b9af72e..43e99187d54f34c3c750f1e884acba7b9a884388 100644 (file)
@@ -126,6 +126,9 @@ void EncoderTest::RunLoop(VideoSource *video) {
 #if CONFIG_VP8_DECODER
   vpx_codec_dec_cfg_t dec_cfg = {0};
 #endif
+
+  stats_.Reset();
+
   for (unsigned int pass = 0; pass < passes_; pass++) {
     last_pts_ = 0;
 
index 3d74b748809a4485dd6fd570046ccfb40c612558..f0654926845eca5ba1bfcd26080eea7bffe9bbc7 100644 (file)
@@ -65,6 +65,10 @@ class TwopassStatsStore {
     return buf;
   }
 
+  void Reset() {
+    buffer_.clear();
+  }
+
  protected:
   std::string  buffer_;
 };