mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-15 21:39:59 +02:00
Only recompute level_cost_[] when needed
Add a dirty_ flag to keep track of updated probabilities and the need to recompute the level costs. This only makes a difference for "-m 2" method which was sub-optimal. But it's overall cleaner to have this flag. Change-Id: I21c71201e1d07a923d97a3adf2fbbd7d67d35433
This commit is contained in:
@ -158,9 +158,12 @@ const uint8_t
|
||||
|
||||
void VP8DefaultProbas(VP8Encoder* const enc) {
|
||||
VP8Proba* const probas = &enc->proba_;
|
||||
probas->use_skip_proba_ = 0;
|
||||
memset(probas->segments_, 255u, sizeof(probas->segments_));
|
||||
memcpy(probas->coeffs_, VP8CoeffsProba0, sizeof(VP8CoeffsProba0));
|
||||
probas->use_skip_proba_ = 0;
|
||||
// Note: we could hard-code the level_costs_ corresponding to VP8CoeffsProba0,
|
||||
// but that's ~11k of static data. Better call VP8CalculateLevelCosts() later.
|
||||
probas->dirty_ = 1;
|
||||
}
|
||||
|
||||
// Paragraph 11.5. 900bytes.
|
||||
|
Reference in New Issue
Block a user