<div dir="ltr">Interesting, thank you Nicolas. Unfortunately, the majority of machine learning models I'm using require BGR or RGB as their input format, so there isn't a lot I can do about it right now. I guess I'll have to look for optimizations elsewhere.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 17, 2020 at 7:38 AM Nicolas Dufresne <<a href="mailto:nicolas@ndufresne.ca">nicolas@ndufresne.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Le vendredi 16 octobre 2020 à 16:10 -0700, Tyler Compton a écrit :<br>
> Hi everyone,<br>
> <br>
> I have a pipeline that, at some point, needs to convert video frames from BGRA to BGR. I was surprised to see about a ~17% increase in CPU usage just from doing this conversion. I wouldn't expect it to be that expensive, considering it's just a matter of stripping off some data for each pixel.<br>
> <br>
> In my application, I have BGRA frames, but never any actual alpha information. Is there perhaps an optimization opportunity because of that?<br>
> <br>
> On average I see about 17% CPU usage when running this pipeline:<br>
> <br>
> videotestsrc is-live=true ! "video/x-raw,format=BGRA,width=1920,height=1080,framerate=30/1" ! fakesink<br>
> <br>
> However, I see around 38% CPU usage just by adding a videoconvert to go from BGRA to BGR:<br>
> <br>
> videotestsrc is-live=true ! "video/x-raw,format=BGRA,width=1920,height=1080,framerate=30/1" ! videoconvert ! "video/x-raw,format=BGR" ! fakesink<br>
<br>
This conversion will move 32bit aligned pixels to 24bits (unaligned)<br>
pixels. Unaligned writes are 3 time slower. Unless you need the<br>
bandwidth gain (even though yuv formats may give a better compression),<br>
I would not recommending using 24bit packed formats in recent<br>
applications. At least not when doing CPU access.<br>
<br>
> <br>
> I'm running GStreamer 1.18.0 on Ubuntu 20.04.<br>
> <br>
> Thanks,<br>
> Tyler<br>
> <br>
> <br>
> _______________________________________________<br>
> gstreamer-devel mailing list<br>
> <a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div>