liborc question
Peter Maersk-Moller
pmaersk at gmail.com
Sun Sep 27 15:15:57 PDT 2015
Hi
Trying to add some speed-up for handling some gstreamer RGB streams, using
liborc seems the right path for new plugins although it is not necessary
the easiest path. Liborc does not seem to have a functional mailing list so
I hope this is the right place to ask questions.
The goal is to implement the following code using SIMD with liborc
void AddAlphaChannel(u_int8_t *dst, u_int8_t *src, u_int32_t w, u_int32_t h)
{
for (int row=0 ; row < h ; row++)
for (int col=0; col < w ; col++) {
*dst++ = *src++;
*dst++ = *src++;
*dst++ = *src++;
*dst++ = 0xff;
}
}
Obviously the source and destination are arrays with width*height pixels.
Trying to do this using liborc seems to be hard, at least right now. The
code I tried in first go is this
.function AddAlphaChannel
.dest 4 dst orc_uint32
.source 1 src orc_uint8
.const 1 a 255
.temp 1 g
.temp 1 r
.temp 2 bg
.temp 2 ra
loadoffb g src 1
loadoffb r src 2
mergebw bg src g
mergebw ra r a
mergewl dst bg ra
However the code is wrong since the destination array has 4 bytes per pixel
and the source array only has 3 bytes per pixel. Any hints on how to use
liborc on arrays where source and destinations has different number of
bytes per set (per pixel).
Best regards
Peter MM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150928/eb3328c3/attachment.html>
More information about the gstreamer-devel
mailing list