]> git.sesse.net Git - ffmpeg/commit
avfilter/vf_overlay: fix alpha blending for planar formats with a transparent background
authorMarton Balint <cus@passwd.hu>
Wed, 2 Aug 2017 23:48:06 +0000 (01:48 +0200)
committerMarton Balint <cus@passwd.hu>
Thu, 10 Aug 2017 20:25:51 +0000 (22:25 +0200)
commit498c90c708446b5d30161e51b97e6fd4255dfad6
tree4425b7f7c80f2cf387b2f6e745466633effd8658
parent3bd2228d05a05eab5f91ac00b01efac9cb07649b
avfilter/vf_overlay: fix alpha blending for planar formats with a transparent background

When the background had an alpha channel, the old code in blend_plane
calculated premultiplied alpha from the destination plane colors instead of the
destination alpha.

Also the calculation of the output alpha should only happen after the color
planes are already finished.

Fixes output of:
ffplay -f lavfi "testsrc2=alpha=32[a];color=black[b];[b][a]overlay[out0]"

Signed-off-by: Marton Balint <cus@passwd.hu>
libavfilter/vf_overlay.c