-#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)
-{
- av_image_copy_plane(dst, dst_wrap, src, src_wrap, width, height);
-}
-
-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)
-{
- int i;
- const PixFmtInfo *pf = &pix_fmt_info[pix_fmt];
- const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
-
- switch(pf->pixel_type) {
- case FF_PIXEL_PACKED:
- case FF_PIXEL_PLANAR:
- for(i = 0; i < pf->nb_channels; i++) {
- int h;
- int bwidth = av_image_get_linesize(pix_fmt, width, i);
- h = height;
- 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);
- }
- break;
- case FF_PIXEL_PALETTE:
- 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);
- break;
- }
-}
-