don't consolidate proba stats too often

adds a minimum count before FinalizeToken() is called for update.

Change-Id: I445be6a3e347620583d87c33067cefa656a25039
This commit is contained in:
skal 2013-03-13 13:48:23 +01:00
parent 69e2590642
commit eef73d07a3

View File

@ -901,15 +901,21 @@ int VP8EncLoop(VP8Encoder* const enc) {
// Single pass using Token Buffer. // Single pass using Token Buffer.
#if !defined(DISABLE_TOKEN_BUFFER) #if !defined(DISABLE_TOKEN_BUFFER)
#define MIN_COUNT 96 // minimum number of macroblocks before updating stats
int VP8EncTokenLoop(VP8Encoder* const enc) { int VP8EncTokenLoop(VP8Encoder* const enc) {
int ok; int ok;
// refresh the proba 8 times per pass // Roughly refresh the proba height times per pass
const int max_count = (enc->mb_w_ * enc->mb_h_) >> 3; int max_count = (enc->mb_w_ * enc->mb_h_) >> 3;
int cnt = max_count; int cnt;
VP8EncIterator it; VP8EncIterator it;
VP8Proba* const proba = &enc->proba_; VP8Proba* const proba = &enc->proba_;
const VP8RDLevel rd_opt = enc->rd_opt_level_; const VP8RDLevel rd_opt = enc->rd_opt_level_;
if (max_count < MIN_COUNT) max_count = MIN_COUNT;
cnt = max_count;
assert(enc->num_parts_ == 1); assert(enc->num_parts_ == 1);
assert(enc->use_tokens_); assert(enc->use_tokens_);
assert(proba->use_skip_proba_ == 0); assert(proba->use_skip_proba_ == 0);