<html><head></head><body>Maths don't work that way. If you add a multiple of 512 offset to a multiple of 16 pointer, you get a multiple of GCD(512, 16) = 16 pointer. Your plane is aligned to 16 bytes (or 32 bytes with the patch).<br><br><div class="gmail_quote">Le 12 novembre 2018 15:31:16 GMT+02:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 12/11/2018 14:09, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">No. The plane offset from the start of the buffer / the first plane <br>will be a multiple of 512 maybe. But the plane alignment cannot be <br>larger than the containing buffer alignment.<br></blockquote><br>I don't see a problem here.<br><br>If you allocate a 4:4:4 1x1 pixels picture it's adjusted to 32x16 pixels <br>internally. Your lines will be 32 bytes and you'll have 16 of them per <br>plane. Each plane will be 512 bytes after the previous one.<br>If you allocate a 4:2:0 1x1 pixels picture it's adjusted to 32x32 pixels <br>internally. The first plane is 1024 bytes big, the other two are 256 <br>bytes big.<br><br>(this wasn't true when we arbitrarily added the 2 extra lines)<br><br>So with the current picture_Setup() was cannot go lower than 256 bytes <br>aligned for any planes. That's far more than the 64 bytes alignment lavc <br>requires on all planes.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> So we should probably align the allocation to at least 512 for <br> consistency. IMO we should align to page size and forget about the <br> problem going forward, as we can probably never align beyond that.<br><br> Le 12 novembre 2018 13:44:08 GMT+02:00, Steve Lhomme <br> <robux4@ycbcr.xyz> a écrit :<br><br> On 12/11/2018 11:59, Rémi Denis-Courmont wrote:<br><br> As far as I am concerned, the picture buffer could and maybe<br> should be page-aligned anyway. The real question is what the<br> plane and scan line alignment should be, which this patch<br> leaves entirely open. <br><br><br> picture_Allocate() is called after picture_Setup() which aligns lines to<br> at least 32 bytes. Then the amount of lines is also made a multiple of<br> 16. So all the planes are always aligned to 512 bytes.<br><br> Le 12 novembre 2018 11:48:25 GMT+02:00, Francois Cartegnie<br> <fcvlcdev@free.fr> a écrit : Le 12/11/2018 à 09:39, Steve<br> Lhomme a écrit : Code relying on AVX-2 (like dav1d) cannot<br> work without an alignment of 32 bytes at least. Even avcodec<br> has a requirement of 64 (likely to get at least 32 on all<br> planes). So it's probably time to upgrade. picture_Setup<br> ensures a horizontal alignment to 32 bytes and a vertical to<br> 16 bytes. So for all buffers allocated by the core, we have a<br> size multiple of 512 bytes. Didn't we had an issue with some<br> codec*filter*idontremember and anything 16 ? -- Envoyé de mon<br> appareil Android avec Courriel K-9 Mail. Veuillez excuser ma<br> brièveté.<hr> vlc-devel mailing list To unsubscribe or modify your<br> subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a> <hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br><br><br> -- <br> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez <br> excuser ma brièveté.<hr> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>