[FFmpeg-devel] [PATCH] move sqv1, flv alignment hack to align_dimensions

Michael Niedermayer michaelni
Mon Feb 15 23:14:14 CET 2010


On Mon, Feb 15, 2010 at 10:53:36PM +0100, Reimar D?ffinger wrote:
> On Mon, Feb 15, 2010 at 10:49:14PM +0100, Michael Niedermayer wrote:
> > On Mon, Feb 15, 2010 at 08:45:54PM +0100, Reimar D?ffinger wrote:
> > > Hello,
> > > I don't see the point in doing this in default_get_buffer which leaves all
> > > applications using their own allocation still crashing without any advantage
> > > I can see - align_dimensions already has codec-specific hacks for the height,
> > > so why not for width as well.
> > 
> > >  utils.c |   21 ++++++++++-----------
> > >  1 file changed, 10 insertions(+), 11 deletions(-)
> > > fba4a2e1f6979fc51a9ded9e6ce6c0144012e8f4  alignhack.diff
> > > Index: libavcodec/utils.c
> > > ===================================================================
> > > --- libavcodec/utils.c	(revision 21839)
> > > +++ libavcodec/utils.c	(working copy)
> > > @@ -140,6 +140,16 @@
> > >          h_align= 16;
> > >          if(s->codec_id == CODEC_ID_MPEG2VIDEO || s->codec_id == CODEC_ID_MJPEG || s->codec_id == CODEC_ID_AMV || s->codec_id == CODEC_ID_THP)
> > >              h_align= 32; // interlaced is rounded up to 2 MBs
> > > +//STRIDE_ALIGN is 8 for SSE* but this does not work for SVQ1 chroma planes
> > > +//we could change STRIDE_ALIGN to 16 for x86/sse but it would increase the
> > > +//picture size unneccessarily in some cases. The solution here is not
> > > +//pretty and better ideas are welcome!
> > > +#if HAVE_MMX
> > > +        if(s->codec_id == CODEC_ID_SVQ1 || s->codec_id == CODEC_ID_VP5 ||
> > > +           s->codec_id == CODEC_ID_VP6 || s->codec_id == CODEC_ID_VP6F ||
> > > +           s->codec_id == CODEC_ID_VP6A)
> > > +            w_align= 32;
> > > +#endif
> > 
> > svq1 is yuv 4:1:0 32luma is 8 chroma
> 
> Ok, deal:
> You tell me if you think this is a good idea in principle.
> If yes, I will test and verify it properly and send an
> updated patch, ok?

the align_dimensions() should return a stride align value too and that should
be used. that is align_dimensions2()
if bumping up w_align works too, then i dont mind at all but its a hack
and we should at least document the exact meaning of align_dimensions
returned values ...

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

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100215/45414ab5/attachment.pgp>



More information about the ffmpeg-devel mailing list