gif2webp: detect and flatten uniformly similar blocks

helps during lossless compression.

10% average saving, but that's mostly on what was previously
'difficult' cases, where the gain is ~30-50% actually.
Non-difficult cases are mostly unchanged.
Tested over ~7k random web gifs.

Change-Id: I09db4560e4ab09105d1cad28e6dbf83842eda8e9
This commit is contained in:
skal
2013-10-08 15:04:52 +02:00
parent 6a8c0eb718
commit 00125196f3
3 changed files with 59 additions and 2 deletions

View File

@ -170,6 +170,7 @@ static int OptimizeAndEncodeFrame(
// For lossy compression, it's better to replace transparent pixels of
// 'curr' with actual RGB values, whenever possible.
WebPUtilReduceTransparency(prev_canvas, &rect, curr);
WebPUtilFlattenSimilarBlocks(prev_canvas, &rect, curr);
}
if (!WebPFrameCacheShouldTryKeyFrame(cache)) {
// Add this as a frame rectangle.