From: Adrian Grange Date: Tue, 2 Oct 2012 16:36:41 +0000 (-0700) Subject: Added Reset method to TwopassStatsStore X-Git-Tag: v1.2.0~58^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30f58b526d0b3c58af45c64eee16efbc7f3fe897;p=platform%2Fupstream%2Flibvpx.git 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 --- diff --git a/test/encode_test_driver.cc b/test/encode_test_driver.cc index e93bc09..43e9918 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 3d74b74..f065492 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_; };