summaryrefslogtreecommitdiffstats
path: root/third_party/libwebp/enc/cost.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libwebp/enc/cost.c')
-rw-r--r--third_party/libwebp/enc/cost.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/third_party/libwebp/enc/cost.c b/third_party/libwebp/enc/cost.c
index 14b357b..92e0cc7 100644
--- a/third_party/libwebp/enc/cost.c
+++ b/third_party/libwebp/enc/cost.c
@@ -354,6 +354,9 @@ static int VariableLevelCost(int level, const uint8_t probas[NUM_PROBAS]) {
void VP8CalculateLevelCosts(VP8Proba* const proba) {
int ctype, band, ctx;
+
+ if (!proba->dirty_) return; // nothing to do.
+
for (ctype = 0; ctype < NUM_TYPES; ++ctype) {
for (band = 0; band < NUM_BANDS; ++band) {
for(ctx = 0; ctx < NUM_CTX; ++ctx) {
@@ -370,6 +373,7 @@ void VP8CalculateLevelCosts(VP8Proba* const proba) {
}
}
}
+ proba->dirty_ = 0;
}
//------------------------------------------------------------------------------