From patchwork Tue Feb 9 21:07:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 25526 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 1F137449E35 for ; Tue, 9 Feb 2021 23:15:28 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EFA3368A192; Tue, 9 Feb 2021 23:15:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 08C4768811C for ; Tue, 9 Feb 2021 23:15:22 +0200 (EET) Received: by mail-ed1-f54.google.com with SMTP id l12so25792266edt.3 for ; Tue, 09 Feb 2021 13:15:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=mBwY9ZXPVUaxNLwe7yjLb+s5/PeHvYax1m7LLqe4v5s=; b=FOlnuL5lOVXHXXyuFdOCXeCvtCCzhBhqL84WdhFITRRr/yOvLqQc8RL1Va39QYXhnr PXX9zsZzbCGXKB3+il4MDMU0rA90IkiPfxpoOzXceq1vrtElz5MAmZzpZEqNxvyp27g+ fC/OWWaz3hcKT2sMIJwc7H0IzBEAgF+4+me4P2dGIsAoGJME9n8Xt0zDnFAf5R6VXqDf yR82d2Jgn1sX3ZFzKCWx4M74qCfSNtGKZ3CjF/lpuOnxsuh3Aqgu6aPffr88NbAzYj4h cjDZNAh6BNXs3/ongnDv5/lh8zdkMSYukFxDFq8doPNgWVuLIzEkImQhreCeANMtnp8u WHbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=mBwY9ZXPVUaxNLwe7yjLb+s5/PeHvYax1m7LLqe4v5s=; b=ue9+l3CnkmSmEJ5FITrIvA9T58w0w58u+KphS1976ABiohsILV7rAnyetceA2Iezm6 V/iN+bXKfi2NmOsVobXM4aJEkv0fb4e1e2/q3yAcbCVAhNJnnsjuZH6cPZrzEn4jgQBx GdNSXXBR2lBp2Z4TffsmMxUZkiQALG8k2brDz1etM82PBf0+BUj+C6k+UzYjLLwbEthM zyg7H75Opu8FSLfp4QBKVxFqjc9QCNHOpjb3nLaIxvVqTN34JUR8qiYW405kJbM8c7CC 6GI6/9uCV1tbKCsTaPjHDFfgNFfduKYzPsY0CYfPyZItmFsaDSSeNjLJ9SmWLbS4rCPT 6JvA== X-Gm-Message-State: AOAM533NRXeCQRcvgnYnfl4maC+mygh9cT/de+CqLi8dWAjk+dnzC+Sd ume+BvABLngb+WpPsoQWrY+7n25feMU= X-Google-Smtp-Source: ABdhPJzb7Q0m4RS6GVQaY6nEn4vh7MoewREh6UM0oL7NnrdvGsjT/AdEAAGXXd5u1cqq4ftviyhBPg== X-Received: by 2002:a2e:95ce:: with SMTP id y14mr15467172ljh.287.1612904877711; Tue, 09 Feb 2021 13:07:57 -0800 (PST) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id u24sm2711117lfu.81.2021.02.09.13.07.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 13:07:57 -0800 (PST) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 9 Feb 2021 23:07:54 +0200 Message-Id: <20210209210754.7618-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avfilter/vf_zscale: add support for setting scaling filter parameters X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" param_a/b are utilized for this. --- libavfilter/vf_zscale.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c index 57199a0878..c195cf0591 100644 --- a/libavfilter/vf_zscale.c +++ b/libavfilter/vf_zscale.c @@ -101,6 +101,8 @@ typedef struct ZScaleContext { char *size_str; double nominal_peak_luminance; int approximate_gamma; + double param_a; + double param_b; char *w_expr; ///< width expression string char *h_expr; ///< height expression string @@ -601,6 +603,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) s->params.resample_filter_uv = s->filter; s->params.nominal_peak_luminance = s->nominal_peak_luminance; s->params.allow_approximate_gamma = s->approximate_gamma; + s->params.filter_param_a = s->params.filter_param_a_uv = s->param_a; + s->params.filter_param_b = s->params.filter_param_b_uv = s->param_b; format_init(&s->src_format, in, desc, s->colorspace_in, s->primaries_in, s->trc_in, s->range_in, s->chromal_in); @@ -897,6 +901,9 @@ static const AVOption zscale_options[] = { { "cin", "set input chroma location", OFFSET(chromal_in), AV_OPT_TYPE_INT, {.i64 = -1}, -1, ZIMG_CHROMA_BOTTOM, FLAGS, "chroma" }, { "npl", "set nominal peak luminance", OFFSET(nominal_peak_luminance), AV_OPT_TYPE_DOUBLE, {.dbl = NAN}, 0, DBL_MAX, FLAGS }, { "agamma", "allow approximate gamma", OFFSET(approximate_gamma), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS }, + { "param_a", "parameter A, which is parameter \"b\" for bicubic, " + "and the number of filter taps for lanczos", OFFSET(param_a), AV_OPT_TYPE_DOUBLE, {.dbl = NAN}, 0, DBL_MAX, FLAGS }, + { "param_b", "parameter B, which is parameter \"c\" for bicubic", OFFSET(param_b), AV_OPT_TYPE_DOUBLE, {.dbl = NAN}, 0, DBL_MAX, FLAGS }, { NULL } };