On 2014-01-09 09:38:10 +0100, Anton Khirnov wrote:
> 
> On Fri, 3 Jan 2014 15:54:34 +0100, Janne Grunau <janne-li...@jannau.net> 
> wrote:
> > On 2014-01-03 15:07:44 +0100, Anton Khirnov wrote:
> > > Allocating edges will be removed from generic code, so the encoder must
> > > handle this explicitly.
> > > ---
> > >  libavcodec/mpegvideo.c |   22 ++++++++++++++++++++--
> > >  1 file changed, 20 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> > > index caf8ca2..484dba4 100644
> > > --- a/libavcodec/mpegvideo.c
> > > +++ b/libavcodec/mpegvideo.c
> > > @@ -422,15 +422,21 @@ fail:
> > >   */
> > >  static int alloc_frame_buffer(MpegEncContext *s, Picture *pic)
> > >  {
> > > +    int edges_needed = av_codec_is_encoder(s->avctx->codec);
> > >      int r, ret;
> > >  
> > >      pic->tf.f = &pic->f;
> > >      if (s->codec_id != AV_CODEC_ID_WMV3IMAGE &&
> > >          s->codec_id != AV_CODEC_ID_VC1IMAGE  &&
> > > -        s->codec_id != AV_CODEC_ID_MSS2)
> > > +        s->codec_id != AV_CODEC_ID_MSS2) {
> > > +        if (edges_needed) {
> > > +            pic->f.width  = s->avctx->width  + 2 * EDGE_WIDTH;
> > > +            pic->f.height = s->avctx->height + 2 * EDGE_WIDTH;
> > 
> > is s->avctx->width/height guaranteed to be multiple of the macroblock
> > size? iirc get_buffer aligned the dimension in addition to adding edges.
> > 
> 
> Does it matter here if it's not?
> The edge size is compatible with alignment, so it shouldn't matter whether add
> edges before or after.

yes, I somehow forgot that get_buffer will align the dimensions, patch
ok

Janne
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to