# HG changeset patch # User stefano # Date 1283894625 0 # Node ID 478992775cf83dd5ddaca1c48833d75e8c09e17d # Parent 0899fc09d43cf11d4cb88215508093998296c28a Reimplement ff_img_copy_plane() as av_image_copy_plane() in libavcore, and deprecate the old function. diff -r 0899fc09d43c -r 478992775cf8 avcore.h --- a/avcore.h Tue Sep 07 19:15:17 2010 +0000 +++ b/avcore.h Tue Sep 07 21:23:45 2010 +0000 @@ -27,7 +27,7 @@ #include "libavutil/avutil.h" #define LIBAVCORE_VERSION_MAJOR 0 -#define LIBAVCORE_VERSION_MINOR 7 +#define LIBAVCORE_VERSION_MINOR 8 #define LIBAVCORE_VERSION_MICRO 0 #define LIBAVCORE_VERSION_INT AV_VERSION_INT(LIBAVCORE_VERSION_MAJOR, \ diff -r 0899fc09d43c -r 478992775cf8 imgutils.c --- a/imgutils.c Tue Sep 07 19:15:17 2010 +0000 +++ b/imgutils.c Tue Sep 07 21:23:45 2010 +0000 @@ -139,6 +139,19 @@ return AVERROR(EINVAL); } +void av_image_copy_plane(uint8_t *dst, int dst_linesize, + const uint8_t *src, int src_linesize, + int bytewidth, int height) +{ + if (!dst || !src) + return; + for (;height > 0; height--) { + memcpy(dst, src, bytewidth); + dst += dst_linesize; + src += src_linesize; + } +} + #if FF_API_OLD_IMAGE_NAMES void av_fill_image_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], const AVPixFmtDescriptor *pixdesc) diff -r 0899fc09d43c -r 478992775cf8 imgutils.h --- a/imgutils.h Tue Sep 07 19:15:17 2010 +0000 +++ b/imgutils.h Tue Sep 07 21:23:45 2010 +0000 @@ -78,6 +78,19 @@ uint8_t *ptr, const int linesizes[4]); /** + * Copy image plane from src to dst. + * That is, copy "height" number of lines of "bytewidth" bytes each. + * The first byte of each successive line is separated by *_linesize + * bytes. + * + * @param dst_linesize linesize for the image plane in dst + * @param src_linesize linesize for the image plane in src + */ +void av_image_copy_plane(uint8_t *dst, int dst_linesize, + const uint8_t *src, int src_linesize, + int bytewidth, int height); + +/** * Check if the given dimension of an image is valid, meaning that all * bytes of the image can be addressed with a signed int. *