Janne Grunau <[email protected]> writes: > This allows us to use avcodec_get_edge_width() for the edge width > without breaking svq1 fate-vsynth tests. > --- > cmdutils.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/cmdutils.c b/cmdutils.c > index 42029d5..c374114 100644 > --- a/cmdutils.c > +++ b/cmdutils.c > @@ -1293,7 +1293,7 @@ static int alloc_buffer(FrameBuffer **pool, > AVCodecContext *s, FrameBuffer **pbu > int i, ret; > int pixel_size; > int h_chroma_shift, v_chroma_shift; > - int edge = 32; // XXX should be avcodec_get_edge_width(), but that fails > on svq1 > + int edge = avcodec_get_edge_width(); > int w = s->width, h = s->height; > > if (!desc) > @@ -1304,12 +1304,13 @@ static int alloc_buffer(FrameBuffer **pool, > AVCodecContext *s, FrameBuffer **pbu > if (!buf) > return AVERROR(ENOMEM); > > + avcodec_align_dimensions(s, &w, &h); > + > if (!(s->flags & CODEC_FLAG_EMU_EDGE)) { > w += 2*edge; > h += 2*edge; > } > > - avcodec_align_dimensions(s, &w, &h); > if ((ret = av_image_alloc(buf->base, buf->linesize, w, h, > s->pix_fmt, 32)) < 0) { > av_freep(&buf); > --
Can you please explain why svq1 breaks if the padding is added first? I don't see why a codec should need to access more than the edge width beyond the actual image. -- Måns Rullgård [email protected] _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
