From patchwork Thu Sep 26 15:45:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 15313 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 98D4544924E for ; Thu, 26 Sep 2019 18:46:40 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7F6C968A4EF; Thu, 26 Sep 2019 18:46:40 +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 5A5F8689E18 for ; Thu, 26 Sep 2019 18:46:33 +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 1iDVyT-0005nL-1u for ffmpeg-devel@ffmpeg.org; Thu, 26 Sep 2019 17:46:33 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id DVxViDxu0wlysDVxViERze; Thu, 26 Sep 2019 17:45:33 +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=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=jg8nFVCvOkeRVMIyQh4A:9 a=pHzHmUro8NiASowvMSCR:22 a=xoEH_sTeL_Rfw54TyV31:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 26 Sep 2019 17:45:01 +0200 Message-Id: <20190926154502.24843-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190926154502.24843-1-michael@niedermayer.cc> References: <20190926154502.24843-1-michael@niedermayer.cc> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfPPS32Ihbclnaeu1piLIcODZ8j+28x7Yi12rPkwQWcdetzf4BHtuN7jqIqBkpsz927XzyUQBASpmE6ZY/tzb1+svCddBBPHsI15kAdJNtWpwlEef+l2I wqnwmrdg8TM6x6pcWnXwenB9LbD5VIbOONPVGv/Dd0xDgoCGF4q4PH2T Subject: [FFmpeg-devel] [PATCH 2/3] swscale/output: Correct Alpha in yuv2ya16_X_c_template() 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" Untested, no testcase Signed-off-by: Michael Niedermayer --- libswscale/output.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } }