diff options
author | Adrian Grange <agrange@google.com> | 2012-10-02 09:36:41 -0700 |
---|---|---|
committer | Adrian Grange <agrange@google.com> | 2012-10-03 11:50:54 -0700 |
commit | 30f58b526d0b3c58af45c64eee16efbc7f3fe897 (patch) | |
tree | cfd1784263b72d08fcf1e461085fd7e9358520b5 | |
parent | 9704cdec9fb777833599312fc84e3f1311d25eed (diff) | |
download | libvpx-30f58b526d0b3c58af45c64eee16efbc7f3fe897.tar libvpx-30f58b526d0b3c58af45c64eee16efbc7f3fe897.tar.gz libvpx-30f58b526d0b3c58af45c64eee16efbc7f3fe897.tar.bz2 libvpx-30f58b526d0b3c58af45c64eee16efbc7f3fe897.zip |
Added Reset method to TwopassStatsStore
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
-rw-r--r-- | test/encode_test_driver.cc | 3 | ||||
-rw-r--r-- | test/encode_test_driver.h | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/test/encode_test_driver.cc b/test/encode_test_driver.cc index e93bc0938..43e99187d 100644 --- a/test/encode_test_driver.cc +++ b/test/encode_test_driver.cc @@ -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; diff --git a/test/encode_test_driver.h b/test/encode_test_driver.h index 3d74b7488..f06549268 100644 --- a/test/encode_test_driver.h +++ b/test/encode_test_driver.h @@ -65,6 +65,10 @@ class TwopassStatsStore { return buf; } + void Reset() { + buffer_.clear(); + } + protected: std::string buffer_; }; |