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 775437 - bayer2rgb: vectorized horiz_upsample cannot be compiled on arm7a
bayer2rgb: vectorized horiz_upsample cannot be compiled on arm7a
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.4.5
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-01 02:06 UTC by Robin Haberkorn
Modified: 2018-11-03 14:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Log of running a pipeline with bayer2rgb and ORC_DEBUG=10 (6.81 KB, text/plain)
2016-12-01 02:06 UTC, Robin Haberkorn
  Details
Proposed patch, enabling bayer_orc_horiz_upsample_unaligned() on ARMv7a (436 bytes, patch)
2016-12-01 02:08 UTC, Robin Haberkorn
none Details | Review
Proposed patch, enabling bayer_orc_horiz_upsample_unaligned() on ARM (429 bytes, patch)
2016-12-01 02:20 UTC, Robin Haberkorn
none Details | Review

Description Robin Haberkorn 2016-12-01 02:06:31 UTC
Created attachment 341096 [details]
Log of running a pipeline with bayer2rgb and ORC_DEBUG=10

I've filed this for v1.4.5 (since this is what I'm using now), but I checked upstream. There is no difference in the relevant code.
The version of liborc used is 0.4.23, but again there does not seem to be any commit upstream that could affect this.

When running a pipeline with bayer2rgb and ORC_DEBUG=10 on an embedded platform (armv7a), bayer_orc_horiz_upsample() cannot be compiled, so orc will use the fallback C version (see orc-log.txt).

I've patched gstbayer2rgb.c, so the alternative bayer_orc_horiz_upsample_unaligned() is used on ARMv7a (see attached patch). This JIT-compiles fine. But frankly, I do not understand the difference between the two variants and why this did the trick. There are no code comments and no explanations. Perhaps one of the maintainers could elaborate on this.

To my even bigger surprise, using the vectorized bayer_orc_horiz_upsample_unaligned() seems to bring no significant speed increase versus the fallback bayer_orc_horiz_upsample() version. But with about 90MB/s of debayered buffers being produced by my pipeline, I might also have run into a memory bandwidth bottleneck here (although the bottleneck would be unlikely low) or into some other bottleneck of course.
In general, the liborc vectorizations do speed up things at least 1,7 times.
Comment 1 Robin Haberkorn 2016-12-01 02:08:12 UTC
Created attachment 341097 [details] [review]
Proposed patch, enabling bayer_orc_horiz_upsample_unaligned() on ARMv7a
Comment 2 Robin Haberkorn 2016-12-01 02:20:18 UTC
Created attachment 341100 [details] [review]
Proposed patch, enabling bayer_orc_horiz_upsample_unaligned() on ARM

Enables bayer_orc_horiz_upsample_unaligned() on all ARM targets, assuming that the underlying issue is ARM-related.
Comment 3 Sebastian Dröge (slomo) 2016-12-01 11:06:35 UTC
ARM does not allow unaligned memory accesses though
Comment 4 Robin Haberkorn 2016-12-01 18:59:52 UTC
(In reply to Sebastian Dröge (slomo) from comment #3)
> ARM does not allow unaligned memory accesses though

Mhh. How comes then that it does not crash at runtime and the image looks OK? Do you even necessarily have to take alignment into account when working with orc opcodes? Perhaps the code generator is already working around unaligned memory accesses on relevant targets.
Comment 5 GStreamer system administrator 2018-11-03 14:01:02 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-bad/issues/488.