diff mbox

[FFmpeg-devel,1/3] swscale/output: Implement Luma computation from yuv2ya16_X_c_template() without 64bit

Message ID 20190926154502.24843-1-michael@niedermayer.cc
State Accepted
Commit 4f4ca675e59795c743ab1d0ec9b4f3ece883f650
Headers show

Commit Message

Michael Niedermayer Sept. 26, 2019, 3:45 p.m. UTC
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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer Oct. 16, 2019, 4:16 p.m. UTC | #1
On Thu, Sep 26, 2019 at 05:45:00PM +0200, Michael Niedermayer wrote:
> 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 | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

will apply patchset

[...]
diff mbox

Patch

diff --git a/libswscale/output.c b/libswscale/output.c
index 0e20a0a6b8..60a9bdfe82 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -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) {