diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-07-27 13:51:36 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-07-27 20:07:48 +0000 |
commit | 60a7fac61b815610f8fd7d8a24c5fd764b245f4e (patch) | |
tree | e3cea40f8fbf8622f9d32d628a5bf15ef2a9f99a /libavcodec/utvideoenc.c | |
parent | 84e345b38e581980b6ee2efb6d05ea3d25d4f88d (diff) | |
download | ffmpeg-60a7fac61b815610f8fd7d8a24c5fd764b245f4e.tar.gz |
utvideoenc: use av_image_copy_plane()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/utvideoenc.c')
-rw-r--r-- | libavcodec/utvideoenc.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c index acb25c3899..3e4c714291 100644 --- a/libavcodec/utvideoenc.c +++ b/libavcodec/utvideoenc.c @@ -24,6 +24,7 @@ * Ut Video encoder */ +#include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "internal.h" @@ -230,20 +231,6 @@ static void mangle_rgb_planes(uint8_t *dst[4], int dst_stride, uint8_t *src, } } -/* Write data to a plane, no prediction applied */ -static void write_plane(uint8_t *src, uint8_t *dst, int stride, - int width, int height) -{ - int i, j; - - for (j = 0; j < height; j++) { - for (i = 0; i < width; i++) - *dst++ = src[i]; - - src += stride; - } -} - /* Write data to a plane with left prediction */ static void left_predict(uint8_t *src, uint8_t *dst, int stride, int width, int height) @@ -383,8 +370,9 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src, for (i = 0; i < c->slices; i++) { sstart = send; send = height * (i + 1) / c->slices; - write_plane(src + sstart * stride, dst + sstart * width, - stride, width, send - sstart); + av_image_copy_plane(dst + sstart * width, width, + src + sstart * stride, stride, + width, send - sstart); } break; case PRED_LEFT: |