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
This commit is contained in:
Adrian Grange 2012-10-02 09:36:41 -07:00
parent 9704cdec9f
commit 30f58b526d
2 changed files with 7 additions and 0 deletions

View 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;

View File

@ -65,6 +65,10 @@ class TwopassStatsStore {
return buf;
}
void Reset() {
buffer_.clear();
}
protected:
std::string buffer_;
};