mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-12-01 07:20:58 +00:00
avfilter/vf_alphamerge: use av_image_copy_plane()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
ed9b25a148
commit
d6b9f2b7da
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user