[Webkit-unassigned] [Bug 98285] Improve image decoding and rendering performance for animated GIFs

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 29 15:30:28 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=98285





--- Comment #1 from Hin-Chung Lam <hclam at google.com>  2012-10-29 15:31:43 PST ---
Based on the dicussion with pkasting@ there are a couple things we can do here in subsequent steps:

1. GIFImageDecoder::frameCount() shouldn't redecode for every new byte received

This is captured in https://bugs.webkit.org/show_bug.cgi?id=98098.

The details of this improvement is that GIFImageReader can parse the entire file and get the frame count progressively without decoding. It will save decoding information along the way.

This means subsequent decoding can be much cheaper and file is parsed once.

The above bug has a preliminary patch implements this parse-once-decode-many algorithm. It is a substantial change and needs a lot of unittesting to back it. 

2. GIFImageDecoder shouldn't be destroyed when cached is cleared

Current implementation of ImageSource.cpp is that it deletes the entire GIFImageDecoder when it is instructed to remove all frame cache. If (1) is landed redecode will be cheaper without parsing.

3. Simplify caching logic for multiframe GIFs

The logic for multiframe caching is too complicated. It has this clear-before-frame logic that allows some of the frames to be removed from cache. This seems overly complicated and doesn't do much. This logic also makes it much harder for us to implement frame skipping.

I propose a simple logic that we decide upfront to cache everything for small GIFs or only the last frame (and background frame) for large GIFs. 

4. Use parsed frame information to skip frames

When a paused GIF image is bring into viewport the image leaps to the current frame. We don't need to decode all frames in between and can safely skip DisposeOverwriteBgcolor and DisposeOverwritePrevious.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list