lavfi/unsharp: use av_image_copy_plane().
authorClément Bœsch <ubitux@gmail.com>
Thu, 16 May 2013 11:36:42 +0000 (13:36 +0200)
committerClément Bœsch <ubitux@gmail.com>
Thu, 16 May 2013 11:38:03 +0000 (13:38 +0200)
libavfilter/vf_unsharp.c

index c482d6b..94bc601 100644 (file)
@@ -43,6 +43,7 @@
 #include "internal.h"
 #include "video.h"
 #include "libavutil/common.h"
+#include "libavutil/imgutils.h"
 #include "libavutil/mem.h"
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
@@ -66,11 +67,7 @@ static void apply_unsharp(      uint8_t *dst, int dst_stride,
     const int32_t halfscale = fp->halfscale;
 
     if (!amount) {
-        if (dst_stride == src_stride)
-            memcpy(dst, src, src_stride * height);
-        else
-            for (y = 0; y < height; y++, dst += dst_stride, src += src_stride)
-                memcpy(dst, src, width);
+        av_image_copy_plane(dst, dst_stride, src, src_stride, width, height);
         return;
     }