After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 512544 - preallocate output buffer in pngenc
preallocate output buffer in pngenc
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.7
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-01-28 11:23 UTC by Alessandro Decina
Modified: 2008-01-29 18:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pre-allocate the output buffer (3.69 KB, patch)
2008-01-28 11:24 UTC, Alessandro Decina
committed Details | Review

Description Alessandro Decina 2008-01-28 11:23:36 UTC
pngenc does (g_memdup() + memcpy() + gst_buffer_merge()) * image->height during encoding.
The patch preallocates the output buffer so that g_memdup() and gst_buffer_merge() aren't needed anymore. This greatly improves performances.
Comment 1 Alessandro Decina 2008-01-28 11:24:11 UTC
Created attachment 103872 [details] [review]
pre-allocate the output buffer
Comment 2 Wim Taymans 2008-01-29 18:43:35 UTC
        Patch by: Alessandro Decina <alessandro at nnva dot org>

        * ext/libpng/gstpngenc.c: (user_write_data), (gst_pngenc_chain):
        * ext/libpng/gstpngenc.h:
        Preallocate the output buffer so that g_memdup() and
        gst_buffer_merge() aren't needed anymore. This greatly improves
        performances and fixes #512544.