summaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-11-09 23:53:43 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-11-10 00:33:12 +0100
commit873d06c76ea5379076a90329b234e77b54525263 (patch)
treeb082b9fca7a70da5d6579fe9e43ac8ef5bb8d501 /libswscale
parenta340cfef8259e6fdceb8b3560a3f5c6cc73423f7 (diff)
downloadffmpeg-streaming-873d06c76ea5379076a90329b234e77b54525263.zip
ffmpeg-streaming-873d06c76ea5379076a90329b234e77b54525263.tar.gz
swscale/output: Fix alpha shift in yuv2gbrp_full_X_c()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/output.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index ea1ee54..a05fed8 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -1979,10 +1979,8 @@ yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter,
for (j = 0; j < lumFilterSize; j++)
A += alpSrc[j][i] * lumFilter[j];
- A >>= 19;
-
- if (A & 0x100)
- A = av_clip_uint8(A);
+ if (A & 0xF8000000)
+ A = av_clip_uintp2(A, 27);
}
Y -= c->yuv2rgb_y_offset;
@@ -2003,13 +2001,13 @@ yuv2gbrp_full_X_c(SwsContext *c, const int16_t *lumFilter,
dest16[1][i] = B >> SH;
dest16[2][i] = R >> SH;
if (hasAlpha)
- dest16[3][i] = A;
+ dest16[3][i] = A >> (SH - 3);
} else {
dest[0][i] = G >> 22;
dest[1][i] = B >> 22;
dest[2][i] = R >> 22;
if (hasAlpha)
- dest[3][i] = A;
+ dest[3][i] = A >> 19;
}
}
if (SH != 22 && (!isBE(c->dstFormat)) != (!HAVE_BIGENDIAN)) {
OpenPOWER on IntegriCloud