[FFmpeg-cvslog] swscale/utils: If the source has no alpha then disable alpha blendaway

Michael Niedermayer git at videolan.org
Thu Sep 10 15:16:31 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Sep 10 14:03:01 2015 +0200| [816cf5181e35ebb595634762a45c7c94cd7b6760] | committer: Michael Niedermayer

swscale/utils: If the source has no alpha then disable alpha blendaway

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=816cf5181e35ebb595634762a45c7c94cd7b6760
---

 libswscale/utils.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 354ec05..777f85e 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1144,6 +1144,10 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
     desc_src = av_pix_fmt_desc_get(srcFormat);
     desc_dst = av_pix_fmt_desc_get(dstFormat);
 
+    // If the source has no alpha then disable alpha blendaway
+    if (c->src0Alpha)
+        c->alphablend = SWS_ALPHA_BLEND_NONE;
+
     if (!(unscaled && sws_isSupportedEndiannessConversion(srcFormat) &&
           av_pix_fmt_swap_endianness(srcFormat) == dstFormat)) {
     if (!sws_isSupportedInput(srcFormat)) {



More information about the ffmpeg-cvslog mailing list