[FFmpeg-devel,2/3] swscale/output: Correct Alpha in yuv2ya16_X_c_template()

Submitted by Michael Niedermayer on Sept. 26, 2019, 3:45 p.m.

Details

Message ID 20190926154502.24843-2-michael@niedermayer.cc
State Accepted
Commit 3e6682931b482e7c6ca0d62cacbf8744e5d9ee47
Headers show

Commit Message

Michael Niedermayer Sept. 26, 2019, 3:45 p.m.
Untested, no testcase

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libswscale/output.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libswscale/output.c b/libswscale/output.c
index 60a9bdfe82..ed8a69287c 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<<14;
+        int64_t A = 0xffff;
 
         for (j = 0; j < lumFilterSize; j++)
             Y += lumSrc[j][i] * lumFilter[j];
@@ -915,6 +915,7 @@  yuv2ya16_X_c_template(SwsContext *c, const int16_t *lumFilter,
         Y = av_clip_uint16(Y);
 
         if (hasAlpha) {
+            A = 1<<14;
             for (j = 0; j < lumFilterSize; j++)
                 A += alpSrc[j][i] * lumFilter[j];
 
@@ -923,7 +924,7 @@  yuv2ya16_X_c_template(SwsContext *c, const int16_t *lumFilter,
         }
 
         output_pixel(&dest[2 * i    ], Y);
-        output_pixel(&dest[2 * i + 1], hasAlpha ? A : 65535);
+        output_pixel(&dest[2 * i + 1], A);
     }
 }