[SCM] libav/experimental: fic: Simplify alpha blending

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Aug 10 16:02:56 UTC 2014


The following commit has been merged in the experimental branch:
commit e299cb2cd37330bf58225d45b06dc179f8dd8dac
Author: Derek Buitenhuis <derek.buitenhuis at gmail.com>
Date:   Tue Apr 22 16:42:11 2014 -0400

    fic: Simplify alpha blending
    
    Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>

diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index f5a2ffe..0f9f798 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -195,7 +195,7 @@ static av_always_inline void fic_alpha_blend(uint8_t *dst, uint8_t *src,
     int i;
 
     for (i = 0; i < size; i++)
-        dst[i] = (dst[i] * (256 - alpha[i]) + src[i] * alpha[i]) >> 8;
+        dst[i] += ((src[i] - dst[i]) * alpha[i]) >> 8;
 }
 
 static void fic_draw_cursor(AVCodecContext *avctx, int cur_x, int cur_y)

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list