summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-26 17:17:15 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-10-16 19:17:57 +0200
commitd260621089763fd09f2b3e97f43d2622759dc6c5 (patch)
tree8e7b1bda9dc1a600278ae8a449acdc820f96f5e0
parent3e6682931b482e7c6ca0d62cacbf8744e5d9ee47 (diff)
downloadffmpeg-streaming-d260621089763fd09f2b3e97f43d2622759dc6c5.zip
ffmpeg-streaming-d260621089763fd09f2b3e97f43d2622759dc6c5.tar.gz
swscale/output: Avoid 64bit in Alpha in yuv2ya16_X_c_template()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libswscale/output.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index ed8a692..d192ea8 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -905,7 +905,7 @@ yuv2ya16_X_c_template(SwsContext *c, const int16_t *lumFilter,
for (i = 0; i < dstW; i++) {
int j;
int Y = -0x40000000;
- int64_t A = 0xffff;
+ int A = 0xffff;
for (j = 0; j < lumFilterSize; j++)
Y += lumSrc[j][i] * lumFilter[j];
@@ -915,11 +915,12 @@ yuv2ya16_X_c_template(SwsContext *c, const int16_t *lumFilter,
Y = av_clip_uint16(Y);
if (hasAlpha) {
- A = 1<<14;
+ A = -0x40000000 + (1<<14);
for (j = 0; j < lumFilterSize; j++)
A += alpSrc[j][i] * lumFilter[j];
A >>= 15;
+ A += 0x8000;
A = av_clip_uint16(A);
}
OpenPOWER on IntegriCloud