1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

lavfi/minterpolate: fix blending calc issue.

the right blending calc is:
(alpha * Frame_2 + (MAX - alpha) * Frame_1 + 512) >> 10

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
This commit is contained in:
Jun Zhao 2018-06-27 15:09:25 +08:00 committed by Jun Zhao
parent c126065947
commit eb776a16ea

View File

@ -1122,8 +1122,8 @@ static void interpolate(AVFilterLink *inlink, AVFrame *avf_out)
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
avf_out->data[plane][x + y * avf_out->linesize[plane]] =
alpha * mi_ctx->frames[2].avf->data[plane][x + y * mi_ctx->frames[2].avf->linesize[plane]] +
((ALPHA_MAX - alpha) * mi_ctx->frames[1].avf->data[plane][x + y * mi_ctx->frames[1].avf->linesize[plane]] + 512) >> 10;
(alpha * mi_ctx->frames[2].avf->data[plane][x + y * mi_ctx->frames[2].avf->linesize[plane]] +
(ALPHA_MAX - alpha) * mi_ctx->frames[1].avf->data[plane][x + y * mi_ctx->frames[1].avf->linesize[plane]] + 512) >> 10;
}
}
}