[Webkit-unassigned] [Bug 59670] [Performance] [Chromium] Remove unnecessary memory copies in JPEGImageDecoder::outputScanlines()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 2 09:45:01 PDT 2011


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


Peter Kasting <pkasting at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #91421|review?                     |review-
               Flag|                            |




--- Comment #6 from Peter Kasting <pkasting at google.com>  2011-05-02 09:45:01 PST ---
(From update of attachment 91421)
View in context: https://bugs.webkit.org/attachment.cgi?id=91421&action=review

> Source/WebCore/ChangeLog:9
> +        to copy row pixels from a vector to a ImageFrame because libjpeg-turbo

Nit: "a ImageFrame" -> "an ImageFrame"

> Source/WebCore/ChangeLog:10
> +        can output RBA pixels used by WebKit. This change writes the output

Nit: RBA -> RGBA

> Source/WebCore/ChangeLog:12
> +        this memory copies.

Nit: "this memory copies" -> "the extra copy"

> Source/WebCore/platform/image-decoders/ImageDecoder.h:56
> +        friend class JPEGImageDecoder;

This isn't the right way to do this.

I'm concerned about blindly writing into the buffer.  Do all platforms guarantee the image format is 32bpp ARGB and that the stride is not larger than the actual line width?  If so, you can probably just make getAddr() public.  If not, you'll need a function which returns a pointer to the image data only if the above are met, and NULL otherwise.

> Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp:220
> +                m_info.out_color_space = JCS_EXT_BGRX;

I believe this is only correct for little-endian machines.  For big-endian I think you need XRGB, because libjpeg-turbo writes using byte offsets rather than bit shifts, so it doesn't auto-swap with machine endianness.  (I'm saying this based on trying to decipher http://sourceforge.net/mailarchive/forum.php?thread_name=4D850B59.1050201%40users.sourceforge.net&forum_name=tigervnc-users ).

-- 
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