# HG changeset patch # User stefano # Date 1283894625 0 # Node ID 0a306a267dbf05b7944f9c820f5dff3ce2038e47 # Parent 1921e24d58866f9c228165eaabf4f1e8d6bdd8fa Reimplement ff_img_copy_plane() as av_image_copy_plane() in libavcore, and deprecate the old function. diff -r 1921e24d5886 -r 0a306a267dbf avcodec.h --- a/avcodec.h Tue Sep 07 20:46:29 2010 +0000 +++ b/avcodec.h Tue Sep 07 21:23:45 2010 +0000 @@ -32,7 +32,7 @@ #define LIBAVCODEC_VERSION_MAJOR 52 #define LIBAVCODEC_VERSION_MINOR 87 -#define LIBAVCODEC_VERSION_MICRO 2 +#define LIBAVCODEC_VERSION_MICRO 3 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff -r 1921e24d5886 -r 0a306a267dbf dsputil.c --- a/dsputil.c Tue Sep 07 20:46:29 2010 +0000 +++ b/dsputil.c Tue Sep 07 21:23:45 2010 +0000 @@ -27,6 +27,7 @@ * DSP utils */ +#include "libavcore/imgutils.h" #include "avcodec.h" #include "dsputil.h" #include "simple_idct.h" @@ -4454,7 +4455,7 @@ c->sv_fmul_scalar[0] = sv_fmul_scalar_2_c; c->sv_fmul_scalar[1] = sv_fmul_scalar_4_c; - c->shrink[0]= ff_img_copy_plane; + c->shrink[0]= av_image_copy_plane; c->shrink[1]= ff_shrink22; c->shrink[2]= ff_shrink44; c->shrink[3]= ff_shrink88; diff -r 1921e24d5886 -r 0a306a267dbf dsputil.h --- a/dsputil.h Tue Sep 07 20:46:29 2010 +0000 +++ b/dsputil.h Tue Sep 07 21:23:45 2010 +0000 @@ -105,7 +105,14 @@ void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block); /* 1/2^n downscaling functions from imgconvert.c */ +#if LIBAVCODEC_VERSION_MAJOR < 53 +/** + * @deprecated Use av_image_copy_plane() instead. + */ +attribute_deprecated void ff_img_copy_plane(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); +#endif + void ff_shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); void ff_shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); void ff_shrink88(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); diff -r 1921e24d5886 -r 0a306a267dbf imgconvert.c --- a/imgconvert.c Tue Sep 07 20:46:29 2010 +0000 +++ b/imgconvert.c Tue Sep 07 21:23:45 2010 +0000 @@ -781,20 +781,14 @@ return dst_pix_fmt; } +#if LIBAVCODEC_VERSION_MAJOR < 53 void ff_img_copy_plane(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height) { - if (!dst || !src) - return; - for(;height > 0; height--) { - memcpy(dst, src, width); - dst += dst_wrap; - src += src_wrap; - } + av_image_copy_plane(dst, dst_wrap, src, src_wrap, width, height); } -#if LIBAVCODEC_VERSION_MAJOR < 53 int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane) { return av_image_get_linesize(pix_fmt, width, plane); @@ -819,13 +813,13 @@ if (i == 1 || i == 2) { h= -((-height)>>desc->log2_chroma_h); } - ff_img_copy_plane(dst_data[i], dst_linesize[i], + av_image_copy_plane(dst_data[i], dst_linesize[i], src_data[i], src_linesize[i], bwidth, h); } break; case FF_PIXEL_PALETTE: - ff_img_copy_plane(dst_data[0], dst_linesize[0], + av_image_copy_plane(dst_data[0], dst_linesize[0], src_data[0], src_linesize[0], width, height); /* copy the palette */