[FFmpeg-devel] [PATCH3/3] avfilter YUV aligment 32bytesaligment for Y only and 16 bytes for UV.

Michael Niedermayer michaelni
Wed Nov 10 17:22:34 CET 2010


On Wed, Sep 22, 2010 at 09:13:23AM -0700, Richard Buteau wrote:
> 
> 
> > -----Original Message-----
> > From: ffmpeg-devel-bounces at mplayerhq.hu [mailto:ffmpeg-devel-
> > bounces at mplayerhq.hu] On Behalf Of M?ns Rullg?rd
> > Sent: Wednesday, September 22, 2010 10:19 AM
> > To: FFmpeg development discussions and patches
> > Subject: Re: [FFmpeg-devel] [PATCH3/3] avfilter YUV aligment
> > 32bytesaligment for Y only and 16 bytes for UV.
> > 
> > "Richard Buteau" <rbuteau at rgbnetworks.com> writes:
> > 
> > >> On Tue, 21 Sep 2010 20:43:30 +0100
> > >> M?ns Rullg?rd <mans at mansr.com> wrote:
> > >>
> > >> > "Richard Buteau" <rbuteau at rgbnetworks.com> writes:
> > >> >
> > >> > >> "Richard Buteau" <rbuteau at rgbnetworks.com> writes:
> > >> > >>
> > >> > >>> Hi all,
> > >> > >>> Some encoder don't support linesize[] that aren't multiple. As
> > an
> > >> > >>> example they expect 720/360/360 for yuv image or 732/368/368.
> > >> > >>> the avfilter align all linesize on 16 byte, this make a yuv
> > 720/368/368.
> > >> > >>> 720 isn't a multiple of 368.
> > >> > >>> I added alignment on 32bytes for Y only so it's always
> > 732/368/368
> > >> > >>
> > >> > >> Why?  Nothing requires alignment greater than 16.  If something
> > did,
> > >> > >> this patch would be the wrong way to fix it.
> > >> > >
> > >> > > The other option to preserve 2:1 ratio between linesize[0] and
> > >> > > linesize[1]/linesize[2]
> > >> >
> > >> > What makes you believe such a requirement exists?
> > >> >
> > >> > Also, don't top-post and do quote properly.
> > >> >
> > >>
> > >> I do remember seeing this comment in libavcodec/utils.c in
> > >> avcodec_default_get_buffer:
> > >>
> > >> // NOTE: do not align linesizes individually, this breaks e.g.
> > >> assumptions
> > >> // that linesize[0] == 2*linesize[1] in the MPEG-encoder for 4:2:2
> > >>
> > >> Nothing in libavfilter should be making this assumption, but I can't
> > be
> > >> sure about other code.
> > > Does that count as a requirement?
> > 
> > That could be seen as a bug.  Either way, your patch makes no sense.
> 
> Maybe it doesn't make sense but it works. Would you be more helpful and elaborate on how you would fix this?
> Have you heard of Intel Avx? it can benefit from 32bytes alignment.
> So far I found 3 other codecs in ffmpeg that expect linesize[0] == 2*linesize[1]

could you tell us which codecs that are and maybe provide examples to reproduce
so we can judge if its better to maintain linesize relations or to modify the
codecs

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101110/d0984d74/attachment.pgp>



More information about the ffmpeg-devel mailing list