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 0F9684C9E6 for ; Thu, 7 Aug 2025 10:15:57 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 1AED068C03F; Thu, 7 Aug 2025 13:15:53 +0300 (EEST) Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id E4F3468C03F for ; Thu, 7 Aug 2025 13:15:45 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 577AFiGU006758 for ; Thu, 7 Aug 2025 12:15:44 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 59B842EFE3; Thu, 7 Aug 2025 12:15:44 +0200 (CEST) Date: Thu, 7 Aug 2025 12:15:44 +0200 From: Nicolas George To: FFmpeg development discussions and patches Message-ID: References: <20250807025358.49096-1-jestrada.list@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250807025358.49096-1-jestrada.list@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Thu, 07 Aug 2025 12:15:44 +0200 (CEST) Subject: Re: [FFmpeg-devel] [PATCH] avfilter: add alphamerge_cuda filter 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: Jorge Estrada (HE12025-08-06): > This patch adds the alphamerge_cuda video filter Thanks, but sorry, no: this is wrong, although not by your fault. Your filter supports only planar formats. Changing a whole plane in a planar format should involve a little reference counting gymnastics and updating a pointer, no data copy. See : # `vf_alphamerge` was added in July 2012 (82ecae8a70), it used memcpy() to # replace the alpha plane of the frame, that was later (d6b9f2b7da) # updated to use av_image_copy_plane(). # # But in March 2013 (c4e8821732), we gained the ability to share plane # data between multiple frames, thanks to refcounted buffers. # `vf_alphamerge` could have used that ability, but it was never done, # probably because `vf_alphamerge` came from the FFmpeg side while the # refcounting came from the libav side. # # `vf_alphamerge` needs to be updated to only create a new reference to # the alpha plane of the input frame and use it in the output frame. No # data copy involved at all. The same probably applies to vf_extractplanes.c, although the excuse of having been added before refcounting is not valid for this one. These are rather low-hanging fruits. Regards, -- Nicolas George _______________________________________________ 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".