From 1267d498dc863034c5db58233495a0a605909023 Mon Sep 17 00:00:00 2001 From: Urvang Joshi Date: Tue, 5 Feb 2013 19:48:30 +0100 Subject: [PATCH] Tune alpha quality mapping to more reasonable values. This results in a significant speedup with minimal increase in file sizes. Change-Id: I6ecefe33eee219fba4099810d04a916f7efbd292 --- src/enc/alpha.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/enc/alpha.c b/src/enc/alpha.c index c16b84db..9decbfcf 100644 --- a/src/enc/alpha.c +++ b/src/enc/alpha.c @@ -79,10 +79,9 @@ static int EncodeLossless(const uint8_t* const data, int width, int height, WebPConfigInit(&config); config.lossless = 1; config.method = effort_level; // impact is very small - // Set moderate default quality setting for alpha. Higher qualities (80 and - // above) could be very slow. - config.quality = 10.f + 15.f * effort_level; - if (config.quality > 100.f) config.quality = 100.f; + // Set a moderate default quality setting for alpha. + config.quality = 6.f * effort_level; + assert(config.quality >= 0 && config.quality <= 100.f); ok = VP8LBitWriterInit(&tmp_bw, (width * height) >> 3); ok = ok && (VP8LEncodeStream(&config, &picture, &tmp_bw) == VP8_ENC_OK);