[FFmpeg-devel] [PATCH] libopenjpeg renamed copy functions, simplified copying procedure

Michael Bradshaw mbradshaw at sorensonmedia.com
Wed Jan 18 22:50:54 CET 2012


On Tue, Jan 17, 2012 at 4:06 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> > +        image->comps[compno].data[image_index] =
> frame->data[0][frame_index];
> > +        ++image_index;
>
> Please merge these two lines (imo).
>

Fixed.  See attached.


> >      for (x = 0; x < width; ++x) {
> > -        image->comps[compno].data[y * width + x] = frame_ptr[y *
> > (frame->linesize[compno] / 2) + x];
> > +        image->comps[compno].data[image_index] = frame_ptr[frame_index];
> > +        ++image_index;
> > +        ++frame_index;
>
> Can memcpy() be used here?
>

I wish, but libopenjpeg's buffer type is int-based, whereas FFmpeg's is
uint8-based (or uint16-based).  I had an interesting discussion about it
here if you're curious:
http://www.gamedev.net/topic/616050-fastest-way-to-copy-two-buffers-of-different-types/


> Consider sending small, selfcontained patches, they make regression testing
> significantly easier (although that may not be relevant in this case).
>

Will do.  I should've made this one a bunch of smaller patches.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Changed-indexing-in-libopenjpeg-to-shorten-lines.patch
Type: application/octet-stream
Size: 4292 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120118/077663fb/attachment.obj>


More information about the ffmpeg-devel mailing list