]> git.sesse.net Git - ffmpeg/commitdiff
swscale/output: Implement Luma computation from yuv2ya16_X_c_template() without 64bit
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 26 Sep 2019 15:10:49 +0000 (17:10 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 16 Oct 2019 17:17:57 +0000 (19:17 +0200)
This also reverts 21838cad2fc44023ad85e35d5c677e2f8d29a0ef
The revert is in this commit to avoid 2 fate updates

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libswscale/output.c

index 0e20a0a6b8e643ea392c09a6c40d9349ad52b509..60a9bdfe82efd4b01545d68ca749ae29ef74f02c 100644 (file)
@@ -904,13 +904,14 @@ yuv2ya16_X_c_template(SwsContext *c, const int16_t *lumFilter,
 
     for (i = 0; i < dstW; i++) {
         int j;
-        int64_t Y = 1 << 18;
+        int Y = -0x40000000;
         int64_t A = 0xffff<<14;
 
         for (j = 0; j < lumFilterSize; j++)
             Y += lumSrc[j][i] * lumFilter[j];
 
         Y >>= 15;
+        Y += (1<<3) + 0x8000;
         Y = av_clip_uint16(Y);
 
         if (hasAlpha) {