aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2017-04-10 17:23:49 +0200
committerPaul B Mahol <onemda@gmail.com>2017-04-10 17:37:07 +0200
commitd6b9f2b7da8eff480c4c454841d769b75e30f536 (patch)
tree2998a46eef95bcd444564d9def882ec4bf21dacf
parented9b25a148f228433d65c31ec8d65d5ad1983215 (diff)
downloadffmpeg-d6b9f2b7da8eff480c4c454841d769b75e30f536.tar.gz
avfilter/vf_alphamerge: use av_image_copy_plane()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavfilter/vf_alphamerge.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libavfilter/vf_alphamerge.c b/libavfilter/vf_alphamerge.c
index a8a8d56824..a4aa8dbe16 100644
--- a/libavfilter/vf_alphamerge.c
+++ b/libavfilter/vf_alphamerge.c
@@ -25,6 +25,7 @@
#include <string.h>
+#include "libavutil/imgutils.h"
#include "libavutil/pixfmt.h"
#include "avfilter.h"
#include "bufferqueue.h"
@@ -129,14 +130,11 @@ static void draw_frame(AVFilterContext *ctx,
}
}
} else {
- int y;
const int main_linesize = main_buf->linesize[A];
const int alpha_linesize = alpha_buf->linesize[Y];
- for (y = 0; y < h && y < alpha_buf->height; y++) {
- memcpy(main_buf->data[A] + y * main_linesize,
- alpha_buf->data[Y] + y * alpha_linesize,
- FFMIN(main_linesize, alpha_linesize));
- }
+ av_image_copy_plane(main_buf->data[A], main_linesize,
+ alpha_buf->data[Y], alpha_linesize,
+ FFMIN(main_linesize, alpha_linesize), alpha_buf->height);
}
}