[FFmpeg-devel] [PATCH 1/1] Reimplement ff_img_copy_plane() as av_img_copy_plane() in libavcore, and deprecate the old function.

Stefano Sabatini stefano.sabatini-lala
Wed Aug 25 15:35:38 CEST 2010


On date Wednesday 2010-08-25 10:10:17 +0200, Michael Niedermayer encoded:
> On Wed, Aug 25, 2010 at 12:30:38AM +0200, Stefano Sabatini wrote:
> [...]
> > @@ -120,3 +120,16 @@ int av_check_image_size(unsigned int w, unsigned int h, int log_offset, void *lo
> >      av_log(&imgutils, AV_LOG_ERROR, "Picture size %ux%u is invalid\n", w, h);
> >      return AVERROR(EINVAL);
> >  }
> > +
> > +void av_copy_image_plane(uint8_t       *dst, int dst_linesize,
> > +                         const uint8_t *src, int src_linesize,
> > +                         int width, int height)
> > +{
> > +    if (!dst || !src)
> > +        return;
> > +    for (;height > 0; height--) {
> > +        memcpy(dst, src, width);
> > +        dst += dst_linesize;
> > +        src += src_linesize;
> > +    }
> > +}
> 
> thats definitly not working with half of the pixel formats and i would
> expect that you test code like this

Can you elaborate on that? Also note that here I'm not adding or
changing the logic, I'm just *moving* the code.

> have the other functions you added to libavcore been tested at all?

Regards.
-- 
FFmpeg = Fundamental & Formidable Mega Philosofic Esoteric Gadget



More information about the ffmpeg-devel mailing list