#159 closed enhancement (wontfix)
swscale memalign
Reported by: | Antoine Martin | Owned by: | Antoine Martin |
---|---|---|---|
Priority: | minor | Milestone: | 0.5 |
Component: | core | Version: | trunk |
Keywords: | Cc: |
Description (last modified by )
We still get this warning on both server and client:
[swscaler @ 0x2f4c200] Warning: data is not aligned! This can lead to a speedloss
- on the client, this can be solved by using GL client rendering (#147) which will simply skip colourspace conversion
- on the server, we could use the patch attached to copy the buffer to a memaligned address before use but this would be quite expensive (copying a lot of data for every frame - let's try to get some numbers using the automated tests to compare) and duplicates what pixbuf is already doing in
get_rgb_rawdata
:pixbuf.get_from_drawable(pixmap, pixmap.get_colormap(), x, y, 0, 0, width, height)
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.
Attachments (1)
Change History (8)
Changed 9 years ago by
Attachment: | xpra-264-server-memalign.patch added |
---|
comment:1 Changed 9 years ago by
Description: | modified (diff) |
---|---|
Status: | new → accepted |
comment:2 Changed 9 years ago by
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?
comment:4 Changed 8 years ago by
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);
comment:5 Changed 8 years ago by
Resolution: | → wontfix |
---|---|
Status: | accepted → closed |
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.
comment:6 Changed 8 years ago by
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
...
comment:7 Changed 6 weeks ago by
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/159
memcopy the pixel data so it is memaligned before we do the colourspace conversion