Lower the quality settings for Alpha encoding.

Evaluated the impact of this change over 1000 image corpus.
The compression density is up (on average) by 1.2% and encoding time has
gone down considerably from 716 ms (per file) to 146 ms (per file)
(4.9X improvement in encoding time).

Change-Id: Ida562cc0bfe18c9d6f5f00873c95f8396b480eab
This commit is contained in:
Vikas Arora 2012-06-29 16:18:04 +05:30
parent fcc69923b9
commit f864be3b2c

View File

@ -82,9 +82,10 @@ static int EncodeLossless(const uint8_t* data, int width, int height,
WebPConfigInit(&config);
config.lossless = 1;
config.method = effort_level; // impact is very small
// quality below 50 doesn't change things much (in speed and size).
// quality above 80 can be very very slow.
config.quality = 40 + 10.f * effort_level;
// Set moderate default quality setting for alpha. Higher qualities (80 and
// above) could be very slow.
config.quality = 10 + 15.f * effort_level;
if (config.quality > 100.f) config.quality = 100.f;
VP8LBitWriterInit(&tmp_bw, (width * height) >> 3);
ok = (VP8LEncodeStream(&config, &picture, &tmp_bw) == VP8_ENC_OK);