diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-09-07 21:23:55 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-09-07 21:23:55 +0000 |
commit | 34017fd9b2a2a74f6b985f1ce3c5f66429f034ad (patch) | |
tree | 45e04064fccb76860adab72bacf12ba108d84ad1 /libavcodec | |
parent | e7eb2033ffcddfa38457cba96477e15e91fbb4d1 (diff) | |
download | ffmpeg-34017fd9b2a2a74f6b985f1ce3c5f66429f034ad.tar.gz |
Move av_picture_data_copy() to libavcore, and rename it
av_image_copy().
Originally committed as revision 25067 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avcodec.h | 10 | ||||
-rw-r--r-- | libavcodec/imgconvert.c | 34 |
2 files changed, 9 insertions, 35 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 1026631513..a9defbd6df 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -32,7 +32,7 @@ #define LIBAVCODEC_VERSION_MAJOR 52 #define LIBAVCODEC_VERSION_MINOR 87 -#define LIBAVCODEC_VERSION_MICRO 3 +#define LIBAVCODEC_VERSION_MICRO 4 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ @@ -3950,15 +3950,15 @@ void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size); */ void av_fast_malloc(void *ptr, unsigned int *size, unsigned int min_size); +#if LIBAVCODEC_VERSION_MAJOR < 53 /** - * Copy image data in src_data to dst_data. - * - * @param dst_linesize linesizes for the image in dst_data - * @param src_linesize linesizes for the image in src_data + * @deprecated Deprecated in favor of av_image_copy(). */ +attribute_deprecated void av_picture_data_copy(uint8_t *dst_data[4], int dst_linesize[4], uint8_t *src_data[4], int src_linesize[4], enum PixelFormat pix_fmt, int width, int height); +#endif /** * Copy image src to dst. Wraps av_picture_data_copy() above. diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 4c4bdb9212..43b50d3f31 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -793,46 +793,20 @@ int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane) { return av_image_get_linesize(pix_fmt, width, plane); } -#endif void av_picture_data_copy(uint8_t *dst_data[4], int dst_linesize[4], uint8_t *src_data[4], int src_linesize[4], enum PixelFormat pix_fmt, int width, int height) { - const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; - - if (desc->flags & PIX_FMT_HWACCEL) - return; - - if (desc->flags & PIX_FMT_PAL) { - av_image_copy_plane(dst_data[0], dst_linesize[0], - src_data[0], src_linesize[0], - width, height); - /* copy the palette */ - memcpy(dst_data[1], src_data[1], 4*256); - } else { - int i, planes_nb = 0; - - for (i = 0; i < desc->nb_components; i++) - planes_nb = FFMAX(planes_nb, desc->comp[i].plane + 1); - - for (i = 0; i < planes_nb; i++) { - int h = height; - int bwidth = av_image_get_linesize(pix_fmt, width, i); - if (i == 1 || i == 2) { - h= -((-height)>>desc->log2_chroma_h); - } - av_image_copy_plane(dst_data[i], dst_linesize[i], - src_data[i], src_linesize[i], - bwidth, h); - } - } + av_image_copy(dst_data, dst_linesize, src_data, src_linesize, + pix_fmt, width, height); } +#endif void av_picture_copy(AVPicture *dst, const AVPicture *src, enum PixelFormat pix_fmt, int width, int height) { - av_picture_data_copy(dst->data, dst->linesize, src->data, + av_image_copy(dst->data, dst->linesize, src->data, src->linesize, pix_fmt, width, height); } |