diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2011-10-31 11:32:11 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2011-11-02 21:44:13 +0100 |
commit | 0b3e9d5dc61bb705d93db1e87d78d8d5131905c6 (patch) | |
tree | 2678dcc81060e2275393530d298bd7050adedb42 /libavfilter | |
parent | 91dfb7385271b5fb18b0b4fddfbcf934c6cb6954 (diff) | |
download | ffmpeg-0b3e9d5dc61bb705d93db1e87d78d8d5131905c6.tar.gz |
vf_overlay: adopts FAST_DIV255 macro for calculating destination alpha
Ease readability, improve exactness.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_overlay.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c index 06967c2db5..6fa10aec8e 100644 --- a/libavfilter/vf_overlay.c +++ b/libavfilter/vf_overlay.c @@ -452,7 +452,8 @@ static void blend_slice(AVFilterContext *ctx, alpha = (alpha_v + alpha_h) >> 1; } else alpha = a[0]; - *d = (*d * (0xff - alpha) + *s++ * alpha + 128) >> 8; + *d = FAST_DIV255(*d * (255 - alpha) + *s * alpha); + s++; d++; a += 1 << hsub; } |