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 D40A04A93E for ; Wed, 24 Apr 2024 11:38:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5F14E68D2A1; Wed, 24 Apr 2024 14:38:36 +0300 (EEST) Received: from btbn.de (btbn.de [144.76.60.213]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C97F568D26B for ; Wed, 24 Apr 2024 14:38:29 +0300 (EEST) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id F279C28190F0B for ; Wed, 24 Apr 2024 13:38:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1713958709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IT+3ybofd9Vdc0ujXE+w3PCj2HOHu5vOeTB/XgVI8SI=; b=GVoy2669cyNoFmR3zFnFM9IO4/xEy61/rlmfXYbikEyoiQzvbP/IpEGbcX3owo9Kf6c8qU PiXKNL2Lrf9qPTK5wUEiQ+Ed8v5SEmH3kHgWLMlMiSf8VTAy1yRJHGUqDVB5l7i/UhU/cm CJSDBXglmmfoz2vFPjEnYItnCdde3NJlr7gCukJV3eegnACoAbG7rYjAu0RKkNrOZLa/Le x/815h4PtxAw7LkT53JIEslkxKQHiIdfy/VyjzOuqoBBETWeelHSUy7Gk/PNFe8MjUJXm8 cgR3VMOiz8Q7MOXvPknP7XGohdmj0Rt/BwOPgCfPTL/LcWechYhGvS2tn07lYw== Message-ID: Date: Wed, 24 Apr 2024 13:38:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240424110257.38715-1-ffmpeg@haasn.xyz> Content-Language: en-US, de-DE From: Timo Rothenpieler In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 0/5] replace scale2ref by scale=rw:rh 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 24/04/2024 13:18, Gyan Doshi wrote: > > > On 2024-04-24 04:21 pm, Niklas Haas wrote: >> As discussed in my previous series for fixing scale2ref[1], this filter >> is fundamentally broken, and the only real fix would be to switch to >> activate(), or ideally FFFrameSync. >> >> [1] https://ffmpeg.org//pipermail/ffmpeg-devel/2024-March/323382.html >> >> The main thing making this difficult is the fact that scale2ref also >> wants to output ref frames to its secondary output, which FFFrameSync >> does not support, and which is ultimately at least part of the root >> cause of trac #10795. >> >> Since this is in principle completely unnecessary (users can just >> 'split' the ref input and have it be consumed by vf_scale), and to make >> the design of this filter a bit more robust and maintainable, switch to >> an approach where vf_scale itself gains the ability to reference >> a secondary input stream, using the "ref_*" series of variables. >> >> This makes the current [i][ri]scale2ref[o][ro] equivalent to the only >> slightly more verbose [ri]split[t][ro]; [i][t]scale=rw:rh[o]. (And >> conversely, it is no longer necessary to use nullsink to consume an >> unused [ro]) > > In principle, a good idea, but how does this impact memory use and speed > in the not-so-uncommon scenario where multiple overlay targets are > scaled 2 ref and then overlaid > e.g. > > in current flow: > > [a][base]scale2ref[a][ref]; > [b][ref]scale2ref[b][ref[; > [c][ref]scale2ref[c][ref[; > [d][ref]scale2ref[d][ref[; > [ref][a]overlay[ref]; > [ref][b]overlay[ref]; > [ref][c]overlay[ref]; > [ref][d]overlay[ref]; > > in new flow: > > [base]split=5[base][refa][refb][refc][refd]; > [a][refa]scale[a]; > [b][refb]scale[b]; > [c][refc]scale[c]; > [d][refd]scale[d]; > [base][a]overlay[outa]; > [outa][b]overlay[outb]; > [outb][c]overlay[outc]; > [outc][d]overlay[out]; Given that scale never modifies the reference, it just ups the refcount of those frames in the split filter, and will thus not change the memory-use whatsoever. _______________________________________________ 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".