From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 70BDA44B45 for ; Sun, 18 May 2025 20:52:34 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 7D96068DB24; Sun, 18 May 2025 23:52:20 +0300 (EEST) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id C062A68DA53 for ; Sun, 18 May 2025 23:52:12 +0300 (EEST) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-43cfe574976so24952925e9.1 for ; Sun, 18 May 2025 13:52:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747601531; x=1748206331; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=nT4HOBjLJ2xs4RViowz7uxkKJX+jyPZ7MfyeiM+PhKw=; b=GoLrRTFaSyAPCBwITB5o2SavQaDC3R91zlZ7Oeq1aeiNJfLV9ytPuVnhjsN1UEEh1+ wPnNn/EtAGwXyzulSV145dxWAfNtS7xwOHayXIUHdeM4mjcjCLQbC3sfDS4AoAdFLQYK +JKU7IALPlVPEmZWoIVnnG9096qcFm8CF+R+1ZIZsQhkNeYpkxbAJG+p1mrPH1la/kDv pJE6+HUwq+O/6OrztRdTza+wQhhJhuiqHe4QNgmoX0DWxQXw6+izB5O6iKmYutVxsPc3 T0++n+17fnkAZN0Y/aZluE7msYukFjzXyJ/z4jBjLNEjAhTMnPxgRE5D2EuP3pLYhuzt Pb1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747601531; x=1748206331; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nT4HOBjLJ2xs4RViowz7uxkKJX+jyPZ7MfyeiM+PhKw=; b=pKYwPJcEkMKmUrkESw01yzjeO7A39nGHsbXjKiyED4c+Ovp0nI4chOkDSGOcFifC4u nOVkGBehZ7vNKAh2xSN8xgLeCCzrGaRtfUBmgxjr7+at4o90sHmCi5uMexACS0dU51H/ xSl4Fl2nAHcrZuscuxjg05M/MPc9G1CTkXFWgFHiLxaUm7ClRduS184RgeocRfJvDPaZ C3TvCYOBzeR4h8RfIG/auk7/jshaUQ8vD0n69scvXo2F+eRE91aDEOyqlAidMP77HLdX aOSq7gvGal/aCkBJE/wWnu5iyYphgikYmoa8JF9TaaX11wVOJZjc4BVL/87pm/xvlbBv w8lw== X-Gm-Message-State: AOJu0Yz2kpldV+6LcCSgPfCAPe1ICqqyyVKrcE5cpH/1fuP0FJvnoNGR ddVWrr7aeLPm8Yp19nwOv28XMwb0UI6u8YpnG1vgss3ekHhpPd65RFwVaGoqSQS6 X-Gm-Gg: ASbGnctOKZwgjTuoH8+v0gVOMqrggb6vkM+116ILnZ6sQl+D4hYId7/BHGeX1zVY2q3 yz8eoTigPV89VJ2LrN7W8jrM8ymRdenzKsC9K6fFRWxGRoFLf9gJeIujrx2Zhet4GV7iXFoFeu3 LKJDnr1FNp0XFN+f5xuDM+KILFYG5YLwcw45tF2WHxORPY2nLSr1G//y8EJH7uJcSUSqkRTFawk /Ds6k4AsNKLTxePy1W16U2Zzna5FfrZL0tpemgYwvwXxKw/4onvFhiZ3uoAFugzDTy/qeCA4H5V 5X7ZxqwvwNFPKy8oZOEJz40MAk+AjYE7a8TYeQbEnPFoMWQy6domHmbV5ji4ialXoH2pY48Zbmo cx8YaT+WezDTeF/rv58u19p7lkLycucf7 X-Google-Smtp-Source: AGHT+IERzWJoOYHmCS5JyD7VEtjjsfeTl0Lva1pMc2ERYRHypiV57bcLunmL79JzoPs6aW/eA7sd8A== X-Received: by 2002:a05:600c:1c03:b0:43d:2313:7b49 with SMTP id 5b1f17b1804b1-442fd627744mr95966875e9.12.1747601531337; Sun, 18 May 2025 13:52:11 -0700 (PDT) Received: from localhost.localdomain (20.238-74-193.fia-dyn.isp.proximus.be. [193.74.238.20]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-442fd583f20sm113389525e9.28.2025.05.18.13.52.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 May 2025 13:52:10 -0700 (PDT) From: Ramiro Polla To: ffmpeg-devel@ffmpeg.org Date: Sun, 18 May 2025 22:52:08 +0200 Message-Id: <20250518205209.30343-2-ramiro.polla@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250518205209.30343-1-ramiro.polla@gmail.com> References: <20250518205209.30343-1-ramiro.polla@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] swscale/swscale_unscaled: fix packed30togbra10() for formats with bpc between 9-14 bits X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Currently, packed30togbra10() always sets the alpha value to 0xFFFF, without taking the bit depth into consideration. This commit restricts the alpha value to the bit depth. --- libswscale/swscale_unscaled.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index 307e5471a9..8d71a88c23 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -818,6 +818,7 @@ static void packed30togbra10(const uint8_t *src, int srcStride, int x, h, i; int dst_alpha = dst[3] != NULL; int scale_high = bpc - 10, scale_low = 10 - scale_high; + uint16_t alpha_val = (1U << bpc) - 1; for (h = 0; h < srcSliceH; h++) { uint32_t *src_line = (uint32_t *)(src + srcStride * h); unsigned component; @@ -834,7 +835,7 @@ static void packed30togbra10(const uint8_t *src, int srcStride, dst[1][x] = av_bswap16(component << scale_high | component >> scale_low); component = p & 0x3FF; dst[2][x] = av_bswap16(component << scale_high | component >> scale_low); - dst[3][x] = 0xFFFF; + dst[3][x] = av_bswap16(alpha_val); src_line++; } } else { @@ -860,7 +861,7 @@ static void packed30togbra10(const uint8_t *src, int srcStride, dst[1][x] = component << scale_high | component >> scale_low; component = p & 0x3FF; dst[2][x] = component << scale_high | component >> scale_low; - dst[3][x] = 0xFFFF; + dst[3][x] = alpha_val; src_line++; } } else { -- 2.30.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".