From patchwork Fri Jun 16 09:29:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 42152 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c526:b0:117:ac03:c9de with SMTP id gm38csp1392404pzb; Fri, 16 Jun 2023 02:33:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4NaH9R6WfGfonHWwtrchCKs7iRzTHxaE+sjiMtRlAA/rrm1Ur7XkzH0v+fLaggUF/3ctI7 X-Received: by 2002:a17:907:7f9f:b0:982:7b47:14e6 with SMTP id qk31-20020a1709077f9f00b009827b4714e6mr1259873ejc.12.1686908023503; Fri, 16 Jun 2023 02:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686908023; cv=none; d=google.com; s=arc-20160816; b=eH2JLOj6TmjbG6g6sdNN7AgP9zqJyWCY8pPz/2Qy0/E2vbZPj59pR4RiCXODud5TdV nmnahnTWrVWA27zfvIZmF++cv/J3mjZgQJ7tIhapo7ZfvWAlF+gNnQWeiXW1HcYLVW+L vsFyfJ5XijWy8Lsl9eNDsr7bVZn24tUlSnPBGZrTgmFfwkYGp3BzCApNNeykKawNv29O SOHB6QWmJCH8xITx4Kc9yITJl/9z2RXmLoPlxUDkMvAyl6P0o4ShWibbVPTyv3lVWpF8 4C5bERpMJwVOAWj6NQ6pSk958lAjzROSHvxA5lgET4eh9pz3zhmXxtjThe9jmDloPJyB z5XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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:dkim-signature:delivered-to; bh=FMN4Jq1L/ozAZYjOVgYsHNdUJosSyJI8Rb+IcxCldtY=; b=ubyVo4XEsOc6HZX8W29XDe9ayluz8P9nihG1rhabFZV4aZlSbfCFZaw6RbnzUeTsjG GLknjZlDPPfMRhG0IPHPYjditWNVjOQSXbkqE7AXPMzPgrsqbEoVLLa4QV9tFxN8B1TD gQw3guImtNYSYnEavfGVXiH3Eu7yFP8QflON7M+XKDGsgKZTWApPUTplJ8QxjNSifxMk wNQ24LBSykRGPrdgMkZuH797G3DyKiSMTR1pmjRN5qhK3Xt52we1vyJa7MGGcKcBnW3Z o4hp60b3+MO4f8reRw/iHom1gopO2KbFhDpgSyTXUn/nNLSal4x3eNYZBw5FPIh9XmpY RCSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=fT13E767; 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 y15-20020a1709060a8f00b0098658f7c1ebsi288827ejf.372.2023.06.16.02.33.43; Fri, 16 Jun 2023 02:33: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; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=fT13E767; 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 7812368C62C; Fri, 16 Jun 2023 12:30:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6DA4E68C5E5 for ; Fri, 16 Jun 2023 12:30:30 +0300 (EEST) Received: from localhost (217-74-0-168.hsi.r-kom.net [217.74.0.168]) by haasn.dev (Postfix) with ESMTPSA id 33A9A426BF; Fri, 16 Jun 2023 11:30:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1686907830; bh=CAdoohvrzuZk8G4lBSyuQJRUmcaeQMGXsWuNUiwVpSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fT13E76777U5DWLA17oRJIpFyeXpSSYR8Z4JqA8qHXKaj5p/KbK2nWhAEcn8R5dkc 8iZa64d2LfeO5/teME0I0vfy2zHRkpr10dBjQqnma3NOVodpaBwQx2u01eOoxghWLP HGilSSEFIB3JyIHJBxB76QeJ8h+CwUmERaTpMAkg= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Fri, 16 Jun 2023 11:29:56 +0200 Message-ID: <20230616092959.5247-19-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230616092959.5247-1-ffmpeg@haasn.xyz> References: <20230616092959.5247-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 19/22] lavfi/vf_libplacebo: skip cache selectively per-input 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 Cc: Niklas Haas Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3Oqv4k1Nh7Bh From: Niklas Haas It may be the case that we want to skip the single frame cache for some inputs but not others. --- libavfilter/vf_libplacebo.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index a30b244843..b78391441a 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -182,7 +182,6 @@ typedef struct LibplaceboContext { float antiringing; int sigmoid; int skip_aa; - int skip_cache; float polar_cutoff; int disable_linear; int disable_builtin; @@ -471,7 +470,6 @@ static int update_settings(AVFilterContext *ctx) .num_hooks = s->num_hooks, .skip_anti_aliasing = s->skip_aa, - .skip_caching_single_frame = s->skip_cache, .polar_cutoff = s->polar_cutoff, .disable_linear_scaling = s->disable_linear, .disable_builtin_scalers = s->disable_builtin, @@ -881,8 +879,10 @@ static int output_frame(AVFilterContext *ctx, int64_t pts) s->params.blend_params = NULL; for (int i = 0; i < s->nb_inputs; i++) { LibplaceboInput *in = &s->inputs[i]; + int high_fps = av_cmp_q(in->link->frame_rate, outlink->frame_rate) > 0; if (in->qstatus != PL_QUEUE_OK) continue; + s->params.skip_caching_single_frame = high_fps; update_crops(ctx, in, &target, out->pts * av_q2d(outlink->time_base)); pl_render_image_mix(in->renderer, &in->mix, &target, &s->params); s->params.skip_target_clearing = true; @@ -1196,9 +1196,6 @@ static int libplacebo_config_output(AVFilterLink *outlink) if (s->fps.num) { outlink->frame_rate = s->fps; outlink->time_base = av_inv_q(s->fps); - s->skip_cache = av_cmp_q(inlink->frame_rate, s->fps) > 0; - } else { - s->skip_cache = true; } /* Static variables */