Xpra: Ticket #159: swscale memalign

We still get this warning on both server and client:

[swscaler @ 0x2f4c200] Warning: data is not aligned! This can lead to a speedloss

So here, the best solution is probably to just bypass gtk's pixmap/pixbuf and use the raw X11 drawable, hopefully this will be aligned... and if not, we can copy it just once.



Thu, 05 Jul 2012 00:05:49 GMT - Antoine Martin: attachment set

memcopy the pixel data so it is memaligned before we do the colourspace conversion


Thu, 05 Jul 2012 00:06:47 GMT - Antoine Martin: status, description changed


Fri, 06 Jul 2012 10:27:24 GMT - Antoine Martin:

For the client, it looks like there is another solution, at least when we build ffmpeg ourselves (osx, static centos builds - and maybe even win32 if we wanted to, although this one is likely to be tedious and time consuming: ffmpeg win32 tutorial):

./configure --enable-memalign-hack (...)

Note, the docs apparently say (from this cvslog message):

docs: Don't recommend adding --enable-memalign-hack

But this does not seem to work IMO, otherwise, we are we getting all those warnings still?


Mon, 23 Jul 2012 17:21:01 GMT - Antoine Martin:

See also #168


Tue, 18 Sep 2012 05:51:23 GMT - Antoine Martin:

Another solution for the non-GL rendering case is to use ffmpeg's CODEC_CAP_DR1 feature: with overridden get/release_buffer() (needs CODEC_CAP_DR1) the user decides into what buffer the decoder decodes and the decoder tells the user once it does not need the data anymore, the user app can at this point free/reuse/keep the memory as it sees fit Then we can use our xmemalign to do the memory allocation in:

int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);

Wed, 19 Sep 2012 08:10:26 GMT - Antoine Martin: status changed; resolution set

I've looked at the code and ffmpeg allocates memory aligned to 8 bytes and swscale wants it aligned to 16... dumb really. And duplicating all the code in the default get_buffer implementation just to change this alignment would be overkill/bug-prone.

Let's ignore it and rely on accelerated yuv rendering instead.


Sat, 22 Jun 2013 06:30:15 GMT - Antoine Martin:

More info: although the buffer stuff will get solved (at least for the client side, when going from the video decoder to the csc) by #345, this won't solve our problems because this warning comes from the rowstride... which is dictated to us by the X11 server when we create the XImage...


Sat, 23 Jan 2021 04:47:08 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/159