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

Carl Eugen Hoyos cehoyos at ag.or.at
Tue Jan 17 12:06:57 CET 2012

Michael Bradshaw <mbradshaw <at> sorensonmedia.com> writes:

> Attached patch renames copying functions (no longer "yuv" and "rgba", but
> "packed" and "unpacked" instead) and gets rid of the numcomps parameter.
>  This gives a greater sense of flexibility and abstraction when copying the
> buffers, and gets rid of the "which function to use for copying gray"
> confusion.  Functionally, it changes nothing.

I applied these parts, please flame me if I added a bug;-)

> I also broke up some of the longest lines and used indexing variables to
> reduce the line length.  Please comment.


> +        image->comps[compno].data[image_index] = frame->data[0][frame_index];
> +        ++image_index;

Please merge these two lines (imo).


>      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?

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

Carl Eugen

More information about the ffmpeg-devel mailing list