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 767350 - jpegdec: Internal parser map/unmap the same buffer multiple time
jpegdec: Internal parser map/unmap the same buffer multiple time
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.8.2
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-06-07 14:47 UTC by Nicolas Dufresne (ndufresne)
Modified: 2018-11-03 15:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Nicolas Dufresne (ndufresne) 2016-06-07 14:47:51 UTC
The parse in jpegdec rely on gst_adapter_masked_scan_uint32() to find few 2 bytes sequences in the stream. The problem is that the adapter variant of this function will, for every call, map/unmap the GstBuffer. If you combined with a non-sysmem memory (like dmabuf) this will cause a huge performance hit. With 720p@30 video, I get a full i7 core being used with (if I force parsing obviously):

  v4l2src ! jpegdec ! fakesink

I didn't look how to fix it really, one could map the buffer in the adapter before using that function. This would bring the performance to what the byte_scanner version would give. Though, there is probably something even smarter we could do.
Comment 1 Nicolas Dufresne (ndufresne) 2016-06-08 01:49:43 UTC
Looking at pngdec, what they do there is map from the adapter (which merges) the accumulated size and use a ByteReader to actually parse. This makes sense, since fist thing we do with the buffer in handle_frame() is to map it entirely, which will result in a merge anyway. Though, one could argue that we could implement a per Memory streaming to jpeg library instead, and that would be slightly faster,
Comment 2 GStreamer system administrator 2018-11-03 15:09:39 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/277.