Closed
Bug 1194058
Opened 9 years ago
Closed 9 years ago
Add downscale-during-decode support for the GIF decoder
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla43
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: seth, Assigned: seth)
References
(Blocks 1 open bug)
Details
(Whiteboard: [gfx-noted])
Attachments
(2 files)
(deleted),
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Updated•9 years ago
|
Whiteboard: [gfx-noted]
Assignee | ||
Comment 1•9 years ago
|
||
This is a preliminary patch that adds a helper class, Deinterlacer, which
buffers decoded rows of an image until an interlacing pass is over and can then
send them to a Downscaler for downscaling.
Obviously this boils down to buffering an un-downscaled copy of the image. This
means that for interlaced images that use Deinterlacer, DDD doesn't offer any
memory savings during decoding, but the Downscaler can be discarded afterwards,
so memory savings will continue as usual once the decode is complete.
Something similar to this is somewhat inevitable when interlacing is involved.
Conveniently, libpng does this for us internally, but since we implemented the
GIF decoder ourselves, we have to add buffering manually using Deinterlacer.
Attachment #8662246 -
Flags: review?(tnikkel)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → seth
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•9 years ago
|
||
This patch adds DDD support for the GIF decoder. The approach is very simple to
the one used for the PNG decoder.
The new wrinkles are:
- GIFs can have first frame padding, which means we need to compute a scaled
version of the frame rect when allocating a frame.
- GIFs can have interlacing, and we don't currently do any extra buffering to
perform deinterlacing. Part 1 added Deinterlacer, which serves as that extra
buffer. If we determine that the GIF is interlaced, we create a Deinterlacer
and write rows into it until an interlaced pass is complete. Then we use
Deinterlacer::PropagatePassToDownscaler() to downscale all the rows from that
pass at once.
All of this means that when we want to write a decoded row of the image into a
buffer, there are now three possible destinations: mImageData, if we're not
downscaling; our Downscaler's buffer, if we're downscaling but not
deinterlacing; and our Deinterlacer's buffer, if we're downscaling *and*
deinterlacing. GetCurrentRowBuffer() hides this complexity from most of the GIF
decoder code.
Attachment #8662251 -
Flags: review?(tnikkel)
Assignee | ||
Comment 3•9 years ago
|
||
Assignee | ||
Comment 4•9 years ago
|
||
(Woot, after this lands all the decoders will support DDD!)
Updated•9 years ago
|
Attachment #8662246 -
Flags: review?(tnikkel) → review+
Updated•9 years ago
|
Attachment #8662251 -
Flags: review?(tnikkel) → review+
Assignee | ||
Comment 5•9 years ago
|
||
Thanks for the review!
Assignee | ||
Comment 6•9 years ago
|
||
Comment 7•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/5fefb6834270
https://hg.mozilla.org/mozilla-central/rev/3c9f7ca5a12f
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Comment 8•9 years ago
|
||
Possible this bug caused https://bugzilla.mozilla.org/show_bug.cgi?id=1208764 ?
You need to log in
before you can comment on or make changes to this bug.
Description
•