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

Reimar Döffinger Reimar.Doeffinger
Mon Feb 15 22:53:36 CET 2010


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?



More information about the ffmpeg-devel mailing list