diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-14 16:56:42 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-14 16:57:09 +0200 |
commit | 41ebb64511dca3ac4ea27fcdca661fbe12f93b26 (patch) | |
tree | 7503177670eb017088292e15657af53b087da487 /libswscale/output.c | |
parent | a4b5e45e2bbc3f2877e4d353893316fb583ed57a (diff) | |
download | ffmpeg-41ebb64511dca3ac4ea27fcdca661fbe12f93b26.tar.gz |
swscale/output: fix alpha scale in the new functions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/output.c')
-rw-r--r-- | libswscale/output.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libswscale/output.c b/libswscale/output.c index 05578181a1..da760d2599 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -1391,9 +1391,9 @@ yuv2rgb_full_2_c_template(SwsContext *c, const int16_t *buf[2], int A; if (hasAlpha) { - A = (abuf0[i] * yalpha1 + abuf1[i] * yalpha)<<3; - if (A & 0xC0000000) - A = av_clip_uintp2(A, 30); + A = (abuf0[i] * yalpha1 + abuf1[i] * yalpha + (1<<18)) >> 19; + if (A & 0x100) + A = av_clip_uint8(A); } yuv2rgb_write_full(c, dest, i, Y, A, U, V, y, target, hasAlpha, err); @@ -1428,9 +1428,9 @@ yuv2rgb_full_1_c_template(SwsContext *c, const int16_t *buf0, int A; if (hasAlpha) { - A = abuf0[i]<<15; - if (A & 0xC0000000) - A = av_clip_uintp2(A, 30); + A = (abuf0[i] + 64) >> 7; + if (A & 0x100) + A = av_clip_uint8(A); } yuv2rgb_write_full(c, dest, i, Y, A, U, V, y, target, hasAlpha, err); @@ -1445,9 +1445,9 @@ yuv2rgb_full_1_c_template(SwsContext *c, const int16_t *buf0, int A; if (hasAlpha) { - A = abuf0[i]<<15; - if (A & 0xC0000000) - A = av_clip_uintp2(A, 30); + A = (abuf0[i] + 64) >> 7; + if (A & 0x100) + A = av_clip_uint8(A); } yuv2rgb_write_full(c, dest, i, Y, A, U, V, y, target, hasAlpha, err); |