From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 5565D41234 for ; Thu, 19 May 2022 13:47:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0736A68B4A1; Thu, 19 May 2022 16:47:46 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B30D9689F59 for ; Thu, 19 May 2022 16:47:38 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 5B0782400F5 for ; Thu, 19 May 2022 15:47:38 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id xmrWyKM8IU-c for ; Thu, 19 May 2022 15:47:37 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 9342324017C for ; Thu, 19 May 2022 15:47:36 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id 740033A0763; Thu, 19 May 2022 15:47:36 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 19 May 2022 15:47:28 +0200 Message-Id: <20220519134728.15354-4-anton@khirnov.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220519134728.15354-1-anton@khirnov.net> References: <20220519134728.15354-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] lavfi/vf_v360: implement output mask for barrelsplit 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: The top/bottom of the barrel are each coded as two semicircles inside a square block in the frame. Mask out the parts of the square that lie outside of these semicircles, so they are made transparent when alpha_mask=1. Fixes the other part of #9725. --- libavfilter/vf_v360.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c index 940e6fc5f6..42b1761333 100644 --- a/libavfilter/vf_v360.c +++ b/libavfilter/vf_v360.c @@ -3745,6 +3745,7 @@ static int barrelsplit_to_xyz(const V360Context *s, const float x = (i + 0.5f) / width; const float y = (j + 0.5f) / height; float l_x, l_y, l_z; + int ret; if (x < 2.f / 3.f) { const float scalew = s->fout_pad > 0 ? 1.f - s->fout_pad / (width * 2.f / 3.f) : 1.f - s->out_pad; @@ -3763,6 +3764,8 @@ static int barrelsplit_to_xyz(const V360Context *s, l_x = cos_theta * sin_phi; l_y = sin_theta; l_z = cos_theta * cos_phi; + + ret = 1; } else { const float scalew = s->fout_pad > 0 ? 1.f - s->fout_pad / (width / 3.f) : 1.f - s->out_pad; const float scaleh = s->fout_pad > 0 ? 1.f - s->fout_pad / (height / 4.f) : 1.f - s->out_pad; @@ -3788,13 +3791,14 @@ static int barrelsplit_to_xyz(const V360Context *s, l_x = (0.5f - uf) / scalew; l_y = 0.5f * dir_vert; l_z = (vf - 0.5f) * dir_vert / scaleh; + ret = (l_x * l_x * scalew * scalew + l_z * l_z * scaleh * scaleh) < 0.5f * 0.5f; } vec[0] = l_x; vec[1] = l_y; vec[2] = l_z; - return 1; + return ret; } /** -- 2.34.1 _______________________________________________ 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".