From 3f4042b52a5d1a1c6ea41c192970d8b7e1a53118 Mon Sep 17 00:00:00 2001 From: Urvang Joshi Date: Wed, 8 Jun 2016 19:26:41 +0000 Subject: [PATCH] WebPAnimEncoder: If 'minimize_size' and 'allow_mixed' on, try lossy + lossless. This improves compression by ~5% at default quality. If only 'allow_mixed' is on (but 'minimize_size' isn't), we continue to use a heuristic to try one of the two or both. Change-Id: Ia573a73ea26ad25f9debff759eed69d2b0449e82 --- src/mux/anim_encode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mux/anim_encode.c b/src/mux/anim_encode.c index 53e2906a..df4a047b 100644 --- a/src/mux/anim_encode.c +++ b/src/mux/anim_encode.c @@ -845,6 +845,9 @@ static WebPEncodingError GenerateCandidates( if (!enc->options_.allow_mixed) { candidate_ll->evaluate_ = is_lossless; candidate_lossy->evaluate_ = !is_lossless; + } else if (enc->options_.minimize_size) { + candidate_ll->evaluate_ = 1; + candidate_lossy->evaluate_ = 1; } else { // Use a heuristic for trying lossless and/or lossy compression. const int num_colors = WebPGetColorPalette(¶ms->sub_frame_ll_, NULL); candidate_ll->evaluate_ = (num_colors < MAX_COLORS_LOSSLESS);