From patchwork Mon May 31 07:55:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 27997 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp2656764iof; Mon, 31 May 2021 00:57:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGNpIWMOJlbnNx3bJaiVAXuzOSBOenYJHg89nhJWWj2T89KFdwM6t5tymSwhx53Lrr+ePk X-Received: by 2002:a17:906:16d2:: with SMTP id t18mr21562233ejd.277.1622447832576; Mon, 31 May 2021 00:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622447832; cv=none; d=google.com; s=arc-20160816; b=XrI0NlJJSFXMP4rk29C6czlMuYUD93DgOPffdm+G0jn7sHulFlBTMdZIutWFnSy879 +8wj05xKodC2BnLxevETCg4mnI4QOhNAqCrJGAAMAJ1Oxsu6yy6/9EiN6HTLV3Eb/hPG CeG7e9PXQCm4X88E3j3mztcwx9GZWCu0nLYmw3O4ud2xssjcDAva2DS90+2zMNL6xD3v ZvZ23PYM16iRlcJwrFDmDjJ8lV9OuT6YCBctADp3Gr7HkMHQgU6Ydr7ZElnU9KIArTZC vEytuv7xxCt2Mg23cPpLCJcT9XAqbYjTcS09wvenGuFFmeXLuz2v8bQiJtRynM7QEP30 9Z/Q== 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=4sukXWGaXWqSQZtTovtFiZOWKyCEGzCISR+5STjhQFY=; b=F/wgwuAwjVwVtew/iYwtI1B5d74Cl2fLT4BGhVACcOp420EuiLekzPSDBEx6pSDx70 V4SHBA6sZndEgbpB09EKTK0RCx864am50ZlOGYVmoph5/tM248Ik6HaXESvnUBSRl4Km nw73nzBXS158OitFtTnzRk98rAx7INUYMKhbxPXEXfFHzyKxCtuNhTatfUwSxxWelUM6 VZXUTImFmsHJULghsu2X9wBmthe2zjBvL4TKI5r8Sv+nMDyWf0EKKEwSfCJfrieyaeZI 91VxNVqL/X/6ckmoybSN+4B4g08XXnoHWPtT6tL1DQepDA7LCIFs7qMcI02ncdwAQngR 8kyQ== 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 a4si12718414ejj.485.2021.05.31.00.57.12; Mon, 31 May 2021 00:57:12 -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 C81256881C5; Mon, 31 May 2021 10:55:39 +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 17739688128 for ; Mon, 31 May 2021 10:55:29 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id AC66724042A for ; Mon, 31 May 2021 09:55:26 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id FQNW7C2EkNlA for ; Mon, 31 May 2021 09:55:26 +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 504402406A2 for ; Mon, 31 May 2021 09:55:22 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id 31B563A18DA; Mon, 31 May 2021 09:55:21 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 31 May 2021 09:55:13 +0200 Message-Id: <20210531075515.19544-22-anton@khirnov.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210531075515.19544-1-anton@khirnov.net> References: <20210531075515.19544-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 22/24] lavfi/vf_scale: pass only the private context to scale_slice() 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: S6XBk6X9ZvOG Not the input link. The function does nothing with the link except extract the private context from it. --- libavfilter/vf_scale.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index 8516919556..37899de6a1 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -625,9 +625,8 @@ static int request_frame_ref(AVFilterLink *outlink) return ff_request_frame(outlink->src->inputs[1]); } -static int scale_slice(AVFilterLink *link, AVFrame *out_buf, AVFrame *cur_pic, struct SwsContext *sws, int y, int h, int mul, int field) +static int scale_slice(ScaleContext *scale, AVFrame *out_buf, AVFrame *cur_pic, struct SwsContext *sws, int y, int h, int mul, int field) { - ScaleContext *scale = link->dst->priv; const uint8_t *in[4]; uint8_t *out[4]; int in_stride[4],out_stride[4]; @@ -795,8 +794,8 @@ scale: INT_MAX); if (scale->interlaced>0 || (scale->interlaced<0 && in->interlaced_frame)) { - scale_slice(link, out, in, scale->isws[0], 0, (link->h+1)/2, 2, 0); - scale_slice(link, out, in, scale->isws[1], 0, link->h /2, 2, 1); + scale_slice(scale, out, in, scale->isws[0], 0, (link->h+1)/2, 2, 0); + scale_slice(scale, out, in, scale->isws[1], 0, link->h /2, 2, 1); } else if (scale->nb_slices) { int i, slice_h, slice_start, slice_end = 0; const int nb_slices = FFMIN(scale->nb_slices, link->h); @@ -804,10 +803,10 @@ scale: slice_start = slice_end; slice_end = (link->h * (i+1)) / nb_slices; slice_h = slice_end - slice_start; - scale_slice(link, out, in, scale->sws, slice_start, slice_h, 1, 0); + scale_slice(scale, out, in, scale->sws, slice_start, slice_h, 1, 0); } } else { - scale_slice(link, out, in, scale->sws, 0, link->h, 1, 0); + scale_slice(scale, out, in, scale->sws, 0, link->h, 1, 0); } av_frame_free(&in);