[vlc-devel] [PATCH 1/1] picture: increase alignment for AVX2 on x86 to 32 byte

Rémi Denis-Courmont remi at remlab.net
Sun Nov 27 17:22:17 CET 2016


Le dimanche 27 novembre 2016, 17:07:47 Janne Grunau a écrit :
> On 2016-11-27 17:54:09 +0200, Rémi Denis-Courmont wrote:
> > Le dimanche 27 novembre 2016, 16:29:15 Janne Grunau a écrit :
> > > Required for direct rendering with AVX2 enabled libavcodec and AVX2
> > > optimizations for the blend deinterlacer.
> > 
> > The value in picture_Setup() does not actually apply in most scenarii,
> > only
> > when the picture is allocated from the heap.
> 
> I need to make sure that that all pictures are aligned properly.
> 
> > libavcodec already has the opportunity to align picture buffer sizes
> > correctly through avcodec_align_dimensions2(), which works a lot
> > better in practice.
> 
> At least the change for the memalign is required. The aligned pitch to
> libavcodec's requirements doesn't help at all if the base bointer is
> only aligned to 16-bytes to begin with.

IMO, the base pointer should be on a page boundary anyway. But if you want to 
align them to 32 bytes, there is no need for all that complicated ifdefery.

Still, that patch does not address the main case, which is that the picture is 
allocated by a video output rather than the generic heap allocator.

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the vlc-devel mailing list