From patchwork Mon Oct 10 16:10:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 38674 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp443314pzb; Mon, 10 Oct 2022 09:11:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM522KbS0D0+oUijdI/fOkvP5YpvX5K+jmhPF5/aup2vU8ULbAiApqzVODcdnfWfTKrFxCF2 X-Received: by 2002:a50:fb0f:0:b0:458:df03:c3aa with SMTP id d15-20020a50fb0f000000b00458df03c3aamr18304071edq.83.1665418303429; Mon, 10 Oct 2022 09:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665418303; cv=none; d=google.com; s=arc-20160816; b=x1i8lpchn2FE2cVg6b0dRaulbrBN0DgM42zYKQOzW540jSmxIKvd9TDT8WK7HGnnoZ B6uoAIQE8TqrQ6bnodwh2L15s6R7ylzsab41BbnOmLyBMn7831F84WMPTdC4mK51E4hx Y5rv7YGxyVjR11WpL4qa72zVuF3KZpMsjAXzDN9waq1hff479DyP6fw8e26GIjlaqiGs zwTP6RTC6QuYrRIm4PFfrHX2X866ZsPwaxH4GwnBq3HHMxelNyKWX0EIGh94bsAKLLsc pSdeQSGCqeXkNPsMygP2HzTEmtPKj64Yh28rpE2/MGUfsKdZ/GBfbB12fU3KjBhLBIhv rVzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=cZ7RTSVrGiL3QKHSMlbBxY8nOb7449UCQPV3okd1ynU=; b=SDJNeOo4zLIpcD+7B4ueRoG8REvimfL6zT7I8fMUefEJsMHRVpNtyDwLoZNTujYn2L NaaO/WGDgsUKd9pOc0JFmfHkjmaZxiOLL87Jgb8Kq90Y+vwh+eTironO+AdXXAv87HBk l5fSmCeOr2gYjCnPWyu3hWF3UNz734YWD6TwK7guY0wuWXHpS2DXZ/DEYjgFRqJ/V0NT X4xwRVxC7ca/AMQ/r029x2ZjPtMNlM82lxJZzdMLOh8375ByfrtlvGXjg5//hV3hyB0t yIQL/kCZ7SPOVz5IMJzOn6UEK5F98CNUJbZfW6P2WMtwKC/kRrXZzdJaLnINji6E4pjg KtqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j11-20020a05640211cb00b00451e1aae675si12737881edw.547.2022.10.10.09.11.43; Mon, 10 Oct 2022 09:11:43 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C698D68BCCD; Mon, 10 Oct 2022 19:11:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F080A68BCD3 for ; Mon, 10 Oct 2022 19:11:10 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 64CA12404F7 for ; Mon, 10 Oct 2022 18:11:10 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id JVlUi2DGyM8d for ; Mon, 10 Oct 2022 18:11:07 +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 21F272400F4 for ; Mon, 10 Oct 2022 18:11:07 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 010533A015F for ; Mon, 10 Oct 2022 18:11:02 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Oct 2022 18:10:48 +0200 Message-Id: <20221010161055.18948-1-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/8] lavfi/f_drawgraph: forward input frame durations 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: dcu3xgO0g6gB --- libavfilter/f_drawgraph.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/f_drawgraph.c b/libavfilter/f_drawgraph.c index 000255fc52..d29a7fb60a 100644 --- a/libavfilter/f_drawgraph.c +++ b/libavfilter/f_drawgraph.c @@ -168,7 +168,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) AVDictionaryEntry *e; AVFrame *out = s->out; AVFrame *clone = NULL; - int64_t in_pts, out_pts; + int64_t in_pts, out_pts, in_duration; int i; if (s->slide == 4 && s->nb_values >= s->values_size[0] / sizeof(float)) { @@ -320,6 +320,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) s->x++; in_pts = in->pts; + in_duration = in->duration; av_frame_free(&in); @@ -336,6 +337,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) return AVERROR(ENOMEM); clone->pts = s->prev_pts = out_pts; + clone->duration = av_rescale_q(in_duration, inlink->time_base, outlink->time_base); return ff_filter_frame(outlink, clone); } From patchwork Mon Oct 10 16:10:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 38672 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp443246pzb; Mon, 10 Oct 2022 09:11:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4s129964Z4I4/Ke1Gm3MBUULBQf/TpQUDMDDaZjh7uHr+KOmhfHZsuiHJQqBaUIG2I80ZD X-Received: by 2002:a17:907:1c23:b0:78d:2a74:e2f8 with SMTP id nc35-20020a1709071c2300b0078d2a74e2f8mr15851371ejc.621.1665418294100; Mon, 10 Oct 2022 09:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665418294; cv=none; d=google.com; s=arc-20160816; b=KeoHRBfrUxG45B/P4furM4gGLplB1ruMfvEOjODfecaLSyd7Me5IzqYoyJOFF6xXEb GYK8YU4tazL39Us0AGWE/4hr+HRwuOUTNmyIlOyTfdCvC9Tw9LrjKkpnpVYpxCQEomf4 pqmAVKAKb6XxzzmpA0rN/RoZozwyzjVdVmxne/tflEeKGMgSVemofiL+WOLbug2FF5dI 32/E+ljwchtQYu4U0qug/J0KEYVy5Wo+vT3+4amUACAnsbFDoxr6F5rbxX6naLjppBC4 +o55EwZ4O5dzlxG/ydbl0zJ8aCz3QnciUv2xXCMiN3idoHOr1AaEJ08M/JYF+dptPV3h a7oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=KiWOFxg1ZabgbFSHYg/aEgbO5NoDHoGAwWZcKNpNbn8=; b=pR1Rs3IQM86AfdeYqwYrfZTrk5mfjXkLHfIHMn0PQqKcHgO2F9Rvdzus6r/mXQMx4x mYrOFSzs5U7tjtS5OjncmcuhKo0WyTfjwvhlPE7hUuqoIK/Q2u97JxDIpLICAWFTv6TQ GC7UuE5tyKe2i26avN2Se9WxeMHJsPd+NIkC2P/zlO/C4SzIas55My12UNPMM3NMW98B q9sp0BY+w3F9v5YsMuM3Z3mRF6FwWje2TtIAaSruepb3rU/Biz4D5aXCG9mT86tBHzMM dPHtaznA86rOPxpLNsZIDNK98yclaAkPdy9HXzQclnd0MJTtncr91iaiaagZ7Jqc6Szn QdDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i3-20020a170906264300b0078334ccc570si10477279ejc.328.2022.10.10.09.11.33; Mon, 10 Oct 2022 09:11:34 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CD6AB68BD10; Mon, 10 Oct 2022 19:11:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E743D68BCCD for ; Mon, 10 Oct 2022 19:11:10 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 8EFF32406C7 for ; Mon, 10 Oct 2022 18:11:09 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id ixjOZOVX6asg for ; Mon, 10 Oct 2022 18:11:07 +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 2CE6F2404E4 for ; Mon, 10 Oct 2022 18:11:07 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 03ED33A0520 for ; Mon, 10 Oct 2022 18:11:02 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Oct 2022 18:10:49 +0200 Message-Id: <20221010161055.18948-2-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221010161055.18948-1-anton@khirnov.net> References: <20221010161055.18948-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/8] lavfi/settb: rescale input frame durations 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3tV0mrUZr+yG --- libavfilter/settb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavfilter/settb.c b/libavfilter/settb.c index 5f589004f8..23cb02689b 100644 --- a/libavfilter/settb.c +++ b/libavfilter/settb.c @@ -128,6 +128,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) AVFilterLink *outlink = ctx->outputs[0]; frame->pts = rescale_pts(inlink, outlink, frame->pts); + frame->duration = av_rescale_q(frame->duration, inlink->time_base, outlink->time_base); return ff_filter_frame(outlink, frame); } From patchwork Mon Oct 10 16:10:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 38676 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp443452pzb; Mon, 10 Oct 2022 09:12:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7/yAtIjCM/GUsmq84aR4SEZ2obP1r3B8weLYkbdRL6Feb0Mew2NWTxeaZuUaC4GKg7Nsjx X-Received: by 2002:a17:907:2d91:b0:78d:8747:71b4 with SMTP id gt17-20020a1709072d9100b0078d874771b4mr12930996ejc.545.1665418324544; Mon, 10 Oct 2022 09:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665418324; cv=none; d=google.com; s=arc-20160816; b=lhtDaIX4V37eDNMPQuCJfrdXOXvoUv/Bw5KxjJe85qbZVnbsCJzBIDkvYSrSeQ00em oLAAJXPPLtpRExEhNnttF6W9Zz8os2aeXruw1c5NvOwqbttwjqw+50uQXLgyrDaNNKVL CoSX3d7GpXEVqG4OEAZmYsK0YhBEgiDs57Fcu/GtxJb2BpWfFrN6/CsAoSe8Qxzw9RF8 MCtSpGrb9XTZLa5LxND/FFJw5WMWXv/8cFYuKLGHkQ6Nc9XrgkhNqOQBcLeV0WWQciEB kww9vZ0rkGa8xPHfyvDCP5FDkZ2FCPp7VHqnJABgxExGC/bv3YEvLE0g7RZNOgqzGeF8 kjVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=AAKrmMXpmClx1+5lNChBNyaR2hjgCU6fq0IH++7rYzo=; b=ESk69YfKb2WN8ZSaHjLT0v60httwg06xBq9imBmJxE7kA38DkM4n65uKQFADmU6tyK aYr6BVZ/NGry35z2RAMB+fzqpGzXxe9cGNcB3yP1IEvzs9X9AjvmDQAIvI8vkqoyka+N 9QJbp8TompoVuAKvk0a9SB5QLrCp9VnEseK8NT6zNFQlHFZf3y9DiAo97iw44J4gSldA gAYcZ/MEMmoBoKAPZqYDW0UYHAbdXzlPI9LEH1Xpv/3bSAL3CB5pJ10Ng4qelazyjK5y r8rFsDS5GePfyF2vtQ/uedVk+5SkxpKtaieHHuVtSYCrGBKjViErXn8CmFpQc6ctoC9s HmvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id o7-20020a170906358700b007818378f560si8812213ejb.383.2022.10.10.09.12.04; Mon, 10 Oct 2022 09:12:04 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AE59368BD26; Mon, 10 Oct 2022 19:11:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AD47D68BCD3 for ; Mon, 10 Oct 2022 19:11:11 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 4E7FF2404F8 for ; Mon, 10 Oct 2022 18:11:11 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id zbVZn7yARfSX for ; Mon, 10 Oct 2022 18:11:10 +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 2F6312404F5 for ; Mon, 10 Oct 2022 18:11:07 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 04E513A0D7F for ; Mon, 10 Oct 2022 18:11:02 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Oct 2022 18:10:50 +0200 Message-Id: <20221010161055.18948-3-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221010161055.18948-1-anton@khirnov.net> References: <20221010161055.18948-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/8] lavfi/vf_tinterlace: set frame durations 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 07licnqarquV This filter is supposed to produce CFR output. --- libavfilter/vf_tinterlace.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index 399adc102d..7c54861de4 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -510,6 +510,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) } out->pts = av_rescale_q(out->pts, tinterlace->preout_time_base, outlink->time_base); + out->duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base); ret = ff_filter_frame(outlink, out); return ret; From patchwork Mon Oct 10 16:10:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 38673 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp443262pzb; Mon, 10 Oct 2022 09:11:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5keP7HTlrrJtFczdc4lyXUDPRFgtg3yRhazTHePXaxfCS+5eXOxvWdRSoexbagbszHLjS5 X-Received: by 2002:a17:907:72cc:b0:78d:a3d9:f46c with SMTP id du12-20020a17090772cc00b0078da3d9f46cmr7121687ejc.559.1665418295802; Mon, 10 Oct 2022 09:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665418295; cv=none; d=google.com; s=arc-20160816; b=szqNn/PwiqvOOeXFtfEtZpJMX+R1S+iMaefdKOMziLmDPtzl+4PmPiFf5KCye0o8E2 wAN0RbKVaRaUJzzHMF9wkIeBqIPl6HE5L15CVNOttbvSX7AParzXQpgDuDH1hwx2DnCn sNxjaO1IExTm7rVWyx7M5J9ww/mJ0GOZVOVI1Un4bWIPPOlrZPWIBNBnzwktb1wCZx9s 7h44JzXqw5pEl/bD3qKa+bWfI7t+CTHCJl0yIhXsLN9VwTrn2cdktZB8VEeHMuBJLObs M1g/1aI/NJaPIrOXYdEHq1oKrRHpNLcmTh9bUvHPMISN2nQA5WH6Ha6vJa99ioTryM3w RpTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=IdJHTm2chOLwpdGSYAO4xwaXSSJ9I9Z59PPImD4LOgI=; b=ukmFX+4/5XmI4VXye0rbvvSGCXieKMeZT8m/ETbPXfnZrU83bpLpwe27wvZ6KgWRyx cXgecRsPJ7+g7RUyx7ceWP9GkBivSyh6SN5dmneLjaS1QaKWgw3Zz5G53th6QKM+ptsA 8gUjahLMkbLGYl97Tuw8wZ1r/OrHBce7v5L/5fi2LO1+FkbDLfxEHecKDR3+8Lfh3/Cy TXh7h+1oUYz1BaMJtR7w+YEuCXU5qcTzna4eYBy5xv7bg6pdw6h2PH++1/3LFv5F2uo6 0Vqn8tnGtDG90vP86aDusxAakk0tlD7LM+Q0Z7mQYgVq3TrbNyDkYaV4JNCtOOT3TdQz XhyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dr20-20020a170907721400b007879808e995si10859324ejc.55.2022.10.10.09.11.21; Mon, 10 Oct 2022 09:11:35 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B339668BCF4; Mon, 10 Oct 2022 19:11:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E48A868BC16 for ; Mon, 10 Oct 2022 19:11:10 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id F10632404E4 for ; Mon, 10 Oct 2022 18:11:09 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id lvbATyzspfAo for ; Mon, 10 Oct 2022 18:11:09 +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 302CE2404F7 for ; Mon, 10 Oct 2022 18:11:07 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 05EC43A0DA0 for ; Mon, 10 Oct 2022 18:11:02 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Oct 2022 18:10:51 +0200 Message-Id: <20221010161055.18948-4-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221010161055.18948-1-anton@khirnov.net> References: <20221010161055.18948-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/8] lavfi/vf_coreimage: set frame durations 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0aHxwpXCli7q This filter is supposed to produce CFR output. --- libavfilter/vf_coreimage.m | 1 + 1 file changed, 1 insertion(+) diff --git a/libavfilter/vf_coreimage.m b/libavfilter/vf_coreimage.m index 5b025c2388..874bdc8c56 100644 --- a/libavfilter/vf_coreimage.m +++ b/libavfilter/vf_coreimage.m @@ -300,6 +300,7 @@ static int request_frame(AVFilterLink *link) } frame->pts = ctx->pts; + frame->duration = 1; frame->key_frame = 1; frame->interlaced_frame = 0; frame->pict_type = AV_PICTURE_TYPE_I; From patchwork Mon Oct 10 16:10:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 38679 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp443726pzb; Mon, 10 Oct 2022 09:12:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7zT8I1mIvg7pnD3019iqKQgtk+D7UYygEYP1w5PneWvaYFvVGlAYcUgilg6X+BztDRgMg8 X-Received: by 2002:a17:907:a073:b0:78d:51c4:5b8c with SMTP id ia19-20020a170907a07300b0078d51c45b8cmr13786534ejc.355.1665418360841; Mon, 10 Oct 2022 09:12:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665418360; cv=none; d=google.com; s=arc-20160816; b=yErSjOHYIr2pp/f+LqSg4FjAJRCYqCLl2Po479+cyklWc5SoZrYQRmLBXlIwA6ZMUL nKaVtNL59UMIxPEw9iJtqdk8T65tZ/2ygLh0tXujpA5QIsX/PQ96vf64u9wbo2JKCwu3 xM+ngu3UthWQL9EmEV9rdUIkpfY1un0zzZvPVEE+jW+rhgCMyWSl8T0vLrEvWNfgVrpQ mxNYDWbIlUxxwnDXH24hiT7W3A56FtYMxBLZWDhQHs5KuezjnBNmYk7a2vGqKoXvUiu/ zOgtQTF8Ec4whJqp/omJ9GOuC91ZuF/g0OQJrjDWwCoiJtoMJiLvYk9uSukC5+8d5fV3 zrDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=IaTNwJbM/Zj8p4Wnk5RB4GXYpvRSmOyzTAY8FJBTZ94=; b=hOt76V3VJP/eKy+kR27lNOTOcvG0XNVSgTOGNqabbMoqsIKJeOMbQ/tcmJBEt6m922 pfeRLg7DMETK4mQL7QgNCbv0cjU+zK6EDamuefd5UxWBA6KuUFCXhpc7eSp8fu8EB67P g/K+HIC4FftyGYIOe5WNkFk1KGdP60cy3Xpw5F0Zi0ausp/GgshFkq6sMbRO/1lSyIu9 Lw8gFkqxu6H6cxV+ODEjvp1X3AhxcPtwAeummLOZ0xSCm3CU3JCIEdbVX9YfbfP7tS/j zuIDEVkSTwtEBOS0RJ3ntWOhUh/EBCvGiCE/jtQlurcDtlsWaRCbWMtH4HP8G/rP58cR payg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id s21-20020a508d15000000b00459ff7667b4si10825266eds.203.2022.10.10.09.12.34; Mon, 10 Oct 2022 09:12:40 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D6C7D68BC16; Mon, 10 Oct 2022 19:11:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 33A9D68BD22 for ; Mon, 10 Oct 2022 19:11:16 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 4BC9E2405EC for ; Mon, 10 Oct 2022 18:11:12 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id lDZgIPqwWP6G for ; Mon, 10 Oct 2022 18:11:11 +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 6F7752405F9 for ; Mon, 10 Oct 2022 18:11:08 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 06F983A13BB for ; Mon, 10 Oct 2022 18:11:02 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Oct 2022 18:10:52 +0200 Message-Id: <20221010161055.18948-5-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221010161055.18948-1-anton@khirnov.net> References: <20221010161055.18948-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/8] lavfi/vf_decimate: use inverse of output framerate as timebase 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: tidMV7ztiYCD This filter currently keeps the input timebase, but produces CFR output. It is thus simpler to use 1/output fps as the output timebase. Also, set output frame durations. --- libavfilter/vf_decimate.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c index 01404e6fec..f61e501c96 100644 --- a/libavfilter/vf_decimate.c +++ b/libavfilter/vf_decimate.c @@ -43,7 +43,6 @@ typedef struct DecimateContext { AVFrame *last; ///< last frame from the previous queue AVFrame **clean_src; ///< frame queue for the clean source int got_frame[2]; ///< frame request flag for each input stream - AVRational ts_unit; ///< timestamp units for the output frames int64_t last_pts; ///< last output timestamp int64_t start_pts; ///< base for output timestamps uint32_t eof; ///< bitmask for end of stream @@ -213,6 +212,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) /* push all frames except the drop */ ret = 0; for (i = 0; i < dm->cycle && dm->queue[i].frame; i++) { + AVRational in_tb = ctx->inputs[INPUT_MAIN]->time_base; if (i == drop) { if (dm->ppsrc) av_frame_free(&dm->clean_src[i]); @@ -221,7 +221,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) AVFrame *frame = dm->queue[i].frame; dm->queue[i].frame = NULL; if (frame->pts != AV_NOPTS_VALUE && dm->start_pts == AV_NOPTS_VALUE) - dm->start_pts = frame->pts; + dm->start_pts = av_rescale_q(frame->pts, in_tb, outlink->time_base); + if (dm->ppsrc) { av_frame_free(&frame); frame = dm->clean_src[i]; @@ -229,8 +230,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) continue; dm->clean_src[i] = NULL; } - frame->pts = av_rescale_q(outlink->frame_count_in, dm->ts_unit, (AVRational){1,1}) + + frame->pts = outlink->frame_count_in + (dm->start_pts == AV_NOPTS_VALUE ? 0 : dm->start_pts); + frame->duration = 1; dm->last_pts = frame->pts; ret = ff_filter_frame(outlink, frame); if (ret < 0) @@ -404,7 +406,7 @@ static int config_output(AVFilterLink *outlink) fps = av_mul_q(fps, (AVRational){dm->cycle - 1, dm->cycle}); av_log(ctx, AV_LOG_VERBOSE, "FPS: %d/%d -> %d/%d\n", inlink->frame_rate.num, inlink->frame_rate.den, fps.num, fps.den); - outlink->time_base = inlink->time_base; + outlink->time_base = av_inv_q(fps); outlink->frame_rate = fps; outlink->sample_aspect_ratio = inlink->sample_aspect_ratio; if (dm->ppsrc) { @@ -414,7 +416,6 @@ static int config_output(AVFilterLink *outlink) outlink->w = inlink->w; outlink->h = inlink->h; } - dm->ts_unit = av_inv_q(av_mul_q(fps, outlink->time_base)); return 0; } From patchwork Mon Oct 10 16:10:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 38675 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp443385pzb; Mon, 10 Oct 2022 09:11:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7gtBmrPFCjLOctdujmb6UHe9vJhZjfEdKOOoYfkz+KQXrvneHq7vOGKnX72hWOqTHXEqQa X-Received: by 2002:a05:6402:249f:b0:453:eb1b:1f8b with SMTP id q31-20020a056402249f00b00453eb1b1f8bmr18307881eda.235.1665418314026; Mon, 10 Oct 2022 09:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665418314; cv=none; d=google.com; s=arc-20160816; b=vZgy1NfJm5aBjW5wdj2rcP2gmSMy7PEzFyqwXdKu21S1qAJgus/5/3Qrr2NLtY9n7X 9GfbyW9qQskErKMsnOczYmsnWoVFlb26XuR1eDbNiS+XACEc4FSpqPQdCJ9gJtftpfbO 8NjpTyaadQD7GpI927kiSn31nCooh9SNh+UMxyNnqCt9e/FwJk4dREcysydHYgrBpbou R5uJLOto6gLsXC84sHl/5lI1exoyZpE7h+cA9/A2H7pkBgPwIDGVI+QQCSAJqW/mU6Qu i4SAjjYQ8GSqfF67MhN5msWZO+IhWw4xyfWdvOt4if8ILma2zzsWI42Eultijukemrle sidw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=wxTPOEGzDqwrniQlv/bTjkb8TthTQHPtHBijH0nDVdQ=; b=At1aBET7JwGPXkZdqxIWH8APhesrTAzqst8FaW+39xSa2bZUIDB5YLnkObOZKnwUF6 psKonzWuyIuxG1NT+2i8Va83qSrrJXSYutYCS94fdXbu/FRwC8STkhaVFAaQB5F7wIzx GGDfEX/f9hCoLTPhQIOb0kIRkyOIjqbLl0QQS8nKEJ1mO4NK84ao0aQgxjjyZu9om78I aL/JJE/WC1EXO5WREfZF2oM1afHO0K2RpUeVNIjJ1ZJnBoCagU8o66SEOK2nTr9n8ZR1 ZSty4Cxwjf/5e2xMODDo1KvMiQlnnU1Ynek62LqLzr3XBAB50YR+e4HM/EMUSnEpa0bA ksyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g11-20020a1709065d0b00b007804b5a2c48si11211374ejt.521.2022.10.10.09.11.53; Mon, 10 Oct 2022 09:11:54 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C066068BD1B; Mon, 10 Oct 2022 19:11:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4A16468BCD3 for ; Mon, 10 Oct 2022 19:11:11 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id DA4442400F4 for ; Mon, 10 Oct 2022 18:11:10 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id aI6c22sH2qMu for ; Mon, 10 Oct 2022 18:11:10 +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 351222404F8 for ; Mon, 10 Oct 2022 18:11:07 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 128723A15EA for ; Mon, 10 Oct 2022 18:11:02 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Oct 2022 18:10:53 +0200 Message-Id: <20221010161055.18948-6-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221010161055.18948-1-anton@khirnov.net> References: <20221010161055.18948-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 6/8] lavfi/vf_estdif: drop an unused function parameter 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: lzFLHPAW3yD9 --- libavfilter/vf_estdif.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_estdif.c b/libavfilter/vf_estdif.c index 45089a01da..9a3195fefb 100644 --- a/libavfilter/vf_estdif.c +++ b/libavfilter/vf_estdif.c @@ -433,7 +433,7 @@ static int deinterlace_slice(AVFilterContext *ctx, void *arg, return 0; } -static int filter(AVFilterContext *ctx, int is_second, AVFrame *in) +static int filter(AVFilterContext *ctx, AVFrame *in) { ESTDIFContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; @@ -510,7 +510,7 @@ static int config_input(AVFilterLink *inlink) } s->pts = s->prev->pts * 2; - ret = filter(ctx, 0, s->prev); + ret = filter(ctx, s->prev); if (ret < 0 || s->mode == 0) { av_frame_free(&s->prev); s->prev = in; @@ -518,7 +518,7 @@ static int config_input(AVFilterLink *inlink) } s->pts = s->prev->pts + in->pts; - ret = filter(ctx, 1, s->prev); + ret = filter(ctx, s->prev); av_frame_free(&s->prev); s->prev = in; return ret; From patchwork Mon Oct 10 16:10:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 38677 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp443574pzb; Mon, 10 Oct 2022 09:12:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5s24zkmeuyfHSrC8yX+/YpXR60BPuKo4f24pvOdM8Y8TLFIW25Q8GnQRNsED/dDMH8cDMX X-Received: by 2002:a05:6402:5255:b0:459:ebaa:c2b8 with SMTP id t21-20020a056402525500b00459ebaac2b8mr18439257edd.150.1665418338014; Mon, 10 Oct 2022 09:12:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665418338; cv=none; d=google.com; s=arc-20160816; b=t6aqlI+1jki22Os+145llzU3hwq19KeZM6tzROGg8ERrvSZbd4fNNKcWhvt0KUtk5C gCvuZU2cLGJym1PDeEj+f688J6OhyIpk+MASujWHU5fb/S7AabEfjU2r3CP5A8vkhTid IFMVw7iZdPCj84pvKomAVa+8Nf/CuP++l6gPfMtoALGB2ryqr0QrgjTCjQ13SCT+lPvK mGwY9VlIwP/zR9OvFoEw8mWy1tue65I3urQeMP9McRy3sOms3xbaS35/MWIoH7adBgG6 1d/V2eTt3TuUFr2xJ7PYQ7W2yxVjLypCpBh9xSME+uTjUn1A5D5OYI+nvUTIbM+xn/Rp cszQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=l4b86QmzyrGd97D2EZ9yPhoqnB1qeXkIZmkejRZDUPA=; b=wDrwfg+F6dMkTxqscF2z1/PbwNQBFvCt2ZWfWcqU2kjcXaHF2qf3KTkrnsWRMk64oD FB6wEcri2auvwzlFYAwU1AQl8XFOoU7TC5dJ4YCnr9pOK/X08gXVRR4gmiKexdi0q17G drF64F6FCTayojQ4p90RmMaNL6UvC7zTEM016uNfx+74WEaZv51B4MnitrDG/BeWJPHn GtlMB1HBciOoPVzwIkip12Tkkj4ZMgqgGMnRmn5vuMbPUK1Gr+uTYd5fssBWel8DnIMz MWn1PPE2RsPM6UH1qdlaBF6M6IczAKikUuSWbNckVBGMEILLgaayBJxJlVxj9oy+VFYQ nSww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id sa4-20020a1709076d0400b0078d4dcceb5dsi11061829ejc.717.2022.10.10.09.12.14; Mon, 10 Oct 2022 09:12:18 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DB02468BD32; Mon, 10 Oct 2022 19:11:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2CD3568BBD2 for ; Mon, 10 Oct 2022 19:11:16 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id AB91D2404F5 for ; Mon, 10 Oct 2022 18:11:11 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 75KTaSyQI4iV for ; Mon, 10 Oct 2022 18:11:10 +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 3DDE9240591 for ; Mon, 10 Oct 2022 18:11:07 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 13A323A168C for ; Mon, 10 Oct 2022 18:11:02 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Oct 2022 18:10:54 +0200 Message-Id: <20221010161055.18948-7-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221010161055.18948-1-anton@khirnov.net> References: <20221010161055.18948-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 7/8] lavfi/vf_estdif: drop a redundant context variable 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: FUG5Do4Bdy7I It is only used in filter() and always set immediately before filter() is called, so it can be passed as a parameter instead. --- libavfilter/vf_estdif.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libavfilter/vf_estdif.c b/libavfilter/vf_estdif.c index 9a3195fefb..9e826fd424 100644 --- a/libavfilter/vf_estdif.c +++ b/libavfilter/vf_estdif.c @@ -48,7 +48,6 @@ typedef struct ESTDIFContext { int max; int nb_planes; int nb_threads; - int64_t pts; AVFrame *prev; void (*interpolate)(struct ESTDIFContext *s, uint8_t *dst, @@ -433,7 +432,7 @@ static int deinterlace_slice(AVFilterContext *ctx, void *arg, return 0; } -static int filter(AVFilterContext *ctx, AVFrame *in) +static int filter(AVFilterContext *ctx, AVFrame *in, int64_t pts) { ESTDIFContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; @@ -445,7 +444,7 @@ static int filter(AVFilterContext *ctx, AVFrame *in) return AVERROR(ENOMEM); av_frame_copy_props(out, in); out->interlaced_frame = 0; - out->pts = s->pts; + out->pts = pts; td.out = out; td.in = in; ff_filter_execute(ctx, deinterlace_slice, &td, NULL, @@ -509,16 +508,14 @@ static int config_input(AVFilterLink *inlink) return ret; } - s->pts = s->prev->pts * 2; - ret = filter(ctx, s->prev); + ret = filter(ctx, s->prev, s->prev->pts * 2); if (ret < 0 || s->mode == 0) { av_frame_free(&s->prev); s->prev = in; return ret; } - s->pts = s->prev->pts + in->pts; - ret = filter(ctx, s->prev); + ret = filter(ctx, s->prev, s->prev->pts + in->pts); av_frame_free(&s->prev); s->prev = in; return ret; From patchwork Mon Oct 10 16:10:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 38678 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp443624pzb; Mon, 10 Oct 2022 09:12:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7iTU6/UE2p30EKjoEXV+uYAlFtjojokEoo4woGq1NKtlm6YHyMZl22IfF4eWD6vNJq7cuT X-Received: by 2002:a05:6402:2748:b0:459:15fe:a868 with SMTP id z8-20020a056402274800b0045915fea868mr18297430edd.157.1665418345061; Mon, 10 Oct 2022 09:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665418345; cv=none; d=google.com; s=arc-20160816; b=YrKSdYYDf4vS/Tij/bMbUUTo1mxHic+pAFmf9nPhR4nqQjSotKgKE8RJGujX1nJOEr icVNxBfg5uo1FfUo2oOjpQXt4YwXr/pWrbGGdHi8NdFdw6aPhE7L6k3u9Wc6XzNyI73+ +aGXGxu8CvdizaxoJoZViYz47cCEJ+0JOBoeDayvPLjLyi/ZvU8+1qeSzKmzTIWmeqsm oSQqfEp4iu823sW5CS5dCDPvPa4LqRWmI+0hMI+8CqPG7/f1jsH+0Ce2/MZOcpujYaqR 6iVQ2zr3WzMkU14008VusIpdOS0rP6OTzPErlX82mrKU/hmugeDt8vdaxPzDBX144Kum e2VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=xHNu2VGyePAMggANDGQcn/7Tr8MSevI8AiTu+tqHvBw=; b=cuUjpjl4f6bc4synIKam3XMk4EOupyjwJI2Mbe4JO91OJjG05mnGibiTDFLT4cj08y MrwwOgHmfJLxlJZ0cepbb8aJ9uXkyAooU91BQamrUXpMiVctDyWcYyetybicQ8TJAFzi A/l4ZfqRhIqBzOpZApROV+vMXFavUwVN7TUphuPToWffQvcC4iOx6kRRrCldG1MafP9a katbd3aR7dCoJDHJjv1KdLV3xbnqaxVMSB8CXvhZSkyGfLftCOGi88irpL8B31K9S0bl wad0oO8IRh4BZ8hTbrNuGpeAg4d6VZ/OsB5tXbv5akTIFY/n1tEsyAugfjtQUHHmx0GQ IWLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id mp11-20020a1709071b0b00b0076fb816dae7si12539173ejc.97.2022.10.10.09.12.24; Mon, 10 Oct 2022 09:12:25 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id ED29668BD2E; Mon, 10 Oct 2022 19:11:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3181D68BD1F for ; Mon, 10 Oct 2022 19:11:16 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id D2753240591 for ; Mon, 10 Oct 2022 18:11:11 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id zqh-lg7vmGhU for ; Mon, 10 Oct 2022 18:11:11 +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 65E9D2405EC for ; Mon, 10 Oct 2022 18:11:07 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 1F57F3A169F for ; Mon, 10 Oct 2022 18:11:02 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Oct 2022 18:10:55 +0200 Message-Id: <20221010161055.18948-8-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221010161055.18948-1-anton@khirnov.net> References: <20221010161055.18948-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 8/8] lavfi/vf_estdif: set frame durations 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: rnooYqey/0G4 --- libavfilter/vf_estdif.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_estdif.c b/libavfilter/vf_estdif.c index 9e826fd424..0164f4638a 100644 --- a/libavfilter/vf_estdif.c +++ b/libavfilter/vf_estdif.c @@ -432,7 +432,7 @@ static int deinterlace_slice(AVFilterContext *ctx, void *arg, return 0; } -static int filter(AVFilterContext *ctx, AVFrame *in, int64_t pts) +static int filter(AVFilterContext *ctx, AVFrame *in, int64_t pts, int64_t duration) { ESTDIFContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; @@ -445,6 +445,7 @@ static int filter(AVFilterContext *ctx, AVFrame *in, int64_t pts) av_frame_copy_props(out, in); out->interlaced_frame = 0; out->pts = pts; + out->duration = duration; td.out = out; td.in = in; ff_filter_execute(ctx, deinterlace_slice, &td, NULL, @@ -503,19 +504,21 @@ static int config_input(AVFilterLink *inlink) if ((s->deint && !s->prev->interlaced_frame) || ctx->is_disabled) { s->prev->pts *= 2; + s->prev->duration *= 2; ret = ff_filter_frame(ctx->outputs[0], s->prev); s->prev = in; return ret; } - ret = filter(ctx, s->prev, s->prev->pts * 2); + ret = filter(ctx, s->prev, s->prev->pts * 2, + s->prev->duration * (s->mode ? 1 : 2)); if (ret < 0 || s->mode == 0) { av_frame_free(&s->prev); s->prev = in; return ret; } - ret = filter(ctx, s->prev, s->prev->pts + in->pts); + ret = filter(ctx, s->prev, s->prev->pts + in->pts, in->duration); av_frame_free(&s->prev); s->prev = in; return ret;