src/misc/picture.c allocates on 16 byte boundaries

This forum is about all development around libVLC.
oviano
Cone that earned his stripes
Cone that earned his stripes
Posts: 120
Joined: 12 Jan 2012 11:12

src/misc/picture.c allocates on 16 byte boundaries

Postby oviano » 07 Nov 2016 07:51

...which causes avcodec to issue this warning:

"plane 0 not aligned, disabling direct rendering"

This is solved by changing the call to vlc_memalign in picture.c to align to 32 bytes instead, as per the patch below.


What does this all mean though?

1. what is direct rendering, in the context of using vmem?
2. are there some benefits in making the above change?
3. are there likely to be some side effects?

- Oliver

Code: Select all

From 22c82f5f70e84f72fb1326d3fe40f2968c4549d9 Mon Sep 17 00:00:00 2001 From: Oliver Collyer <ovcollyer@mac.com> Date: Mon, 7 Nov 2016 09:43:03 +0300 Subject: [PATCH 1/1] align picture buffers on 32-byte boundary --- src/misc/picture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/picture.c b/src/misc/picture.c index 43207ce..f0f2146 100644 --- a/src/misc/picture.c +++ b/src/misc/picture.c @@ -62,7 +62,7 @@ static int AllocatePicture( picture_t *p_pic ) i_bytes += p->i_pitch * p->i_lines; } - uint8_t *p_data = vlc_memalign( 16, i_bytes ); + uint8_t *p_data = vlc_memalign( 32, i_bytes ); if( i_bytes > 0 && p_data == NULL ) { p_pic->i_planes = 0; -- 2.7.4

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: src/misc/picture.c allocates on 16 byte boundaries

Postby Jean-Baptiste Kempf » 07 Dec 2016 00:40

Do you see any performance change?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

oviano
Cone that earned his stripes
Cone that earned his stripes
Posts: 120
Joined: 12 Jan 2012 11:12

Re: src/misc/picture.c allocates on 16 byte boundaries

Postby oviano » 07 Dec 2016 05:37

I haven't measured it. I expect any gain is marginal but I didn't like the warning and this gets rid of it so I presume it's not a bad thing.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 9 guests