From patchwork Thu Sep 26 15:45:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 15312 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id B2C3A44924E for ; Thu, 26 Sep 2019 18:46:39 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9647868A4C3; Thu, 26 Sep 2019 18:46:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe06-3.mx.upcmail.net (vie01a-dmta-pe06-3.mx.upcmail.net [84.116.36.16]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A664D689E18 for ; Thu, 26 Sep 2019 18:46:32 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1iDVyS-0005mJ-7g for ffmpeg-devel@ffmpeg.org; Thu, 26 Sep 2019 17:46:32 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id DVxUiDxsywlysDVxUiERzK; Thu, 26 Sep 2019 17:45:32 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=E5OzWpVl c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=gGDqWtiTXvjMplqLiaEA:9 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 26 Sep 2019 17:45:00 +0200 Message-Id: <20190926154502.24843-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-CMAE-Envelope: MS4wfJhTySc2TXHBRmdcb0t/I+i81LrCrAe7X2Z+CJHubiCfonsOQGfzdHx3ZA9MnxB5CSlIhuAEBED2jnqVTYMnPcgO9q3eFRdTQmsHaj/Zd4eEWnMVCQdh FeZccYmxGVzsHpcC23PDld/IjJgQHrHeuS50EeLJkI9+icFSC+mMOt6K Subject: [FFmpeg-devel] [PATCH 1/3] swscale/output: Implement Luma computation from yuv2ya16_X_c_template() without 64bit X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This also reverts 21838cad2fc44023ad85e35d5c677e2f8d29a0ef The revert is in this commit to avoid 2 fate updates Signed-off-by: Michael Niedermayer --- libswscale/output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) {