diff options
author | Jun Zhao <mypopydev@gmail.com> | 2018-06-27 15:09:25 +0800 |
---|---|---|
committer | Jun Zhao <jun.zhao@intel.com> | 2018-07-08 23:05:34 +0800 |
commit | eb776a16ea3c02096ee4eff2f12da0f03cb03ef3 (patch) | |
tree | 4c836e95354c6fcb64b97ad0dfe527c1a2c70cfe /libavfilter/vf_minterpolate.c | |
parent | c126065947514ec41f2d3350b8018ab563a054bb (diff) | |
download | ffmpeg-eb776a16ea3c02096ee4eff2f12da0f03cb03ef3.tar.gz |
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>
Diffstat (limited to 'libavfilter/vf_minterpolate.c')
-rw-r--r-- | libavfilter/vf_minterpolate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_minterpolate.c b/libavfilter/vf_minterpolate.c index d53431593d..c6a5e63f90 100644 --- a/libavfilter/vf_minterpolate.c +++ b/libavfilter/vf_minterpolate.c @@ -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; } } } |