From patchwork Fri Oct 22 08:52:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 31207 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp1557231ioa; Fri, 22 Oct 2021 01:53:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXN0DE1I4RGHQJVo+aBRo1zhZ6ErPK00LuqLD5/dbCsk57xa3XZ5RzO6JVa3ts1XkOFHaT X-Received: by 2002:a17:906:5d13:: with SMTP id g19mr13588400ejt.172.1634892809469; Fri, 22 Oct 2021 01:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634892809; cv=none; d=google.com; s=arc-20160816; b=p6nDHSG55eFhs46+DlFv1yxtUeqBV90YUebRrjAqkdzfKQM+S8dd9g993MpTpOL/mV z9EeSIv6dYJwqXo/1mQ7SeJcESzZzuysStuIomFXQGbTGzcbEHH+IRwFMuBX256gA7CE G6gK83EPmuJxX5GahB9IKo8WECCTJyNAAoVp9WW06v5C0uGb1+ylip9zje2qH+4s6cFS 88Iz9/sOuWfJ6Gixz2IvJbYqlChq85FXZ8kT7QNjk4f1Ulr7hd2YODRNNOQnZ9EYBQF8 Uv9rQqisXK5pWCzywL715ORPVCwLWpMF539bh2IUx/ryofjCina93P13zxiuOsIYfyrm VF6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=95ZIbQlpUfxrUjgtSFvAJicSt7WDEiwOyH1ib5Y2/kQ=; b=Dz6/je/mugayyhAijcXPOCRyESDy69xchZn5dQh6imq0SovR/rpV+b87T8T1RzQ7M2 zQO7myciBgXOXNRFynxM/E7RjwQrPTmgA75v/+4UF43BdCMgnj4GaWRtg30NdOPOabwQ TUh2yck9iGEbpqZjc+/QrPOBzr3IT6cRJZ2eYGicnM56xOMUsQtxcC8RJ7WXkX3WQ6Ak d1XDdMEdKSN9A//DCJEIGfK8Mrd79PWOrUSCoKSrF5o07mVu4QuithXdQGvFPoxySKRZ PDvTnLtcPleRa2sz7oSW8g+uMKkyx5M8ED/R7EWNOgyID4u8kmQN6DRnIhyq8j8ah0n6 AaXg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id w12si15859520edc.118.2021.10.22.01.53.29; Fri, 22 Oct 2021 01:53:29 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A646168A84C; Fri, 22 Oct 2021 11:53:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AFB9468A71A for ; Fri, 22 Oct 2021 11:53:02 +0300 (EEST) X-IronPort-AV: E=McAfee;i="6200,9189,10144"; a="216176985" X-IronPort-AV: E=Sophos;i="5.87,172,1631602800"; d="scan'208";a="216176985" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2021 01:52:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,172,1631602800"; d="scan'208";a="495586622" Received: from otc-skl-e5-server.sh.intel.com ([10.239.43.106]) by orsmga008.jf.intel.com with ESMTP; 22 Oct 2021 01:52:51 -0700 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Fri, 22 Oct 2021 16:52:30 +0800 Message-Id: <20211022085231.93931-3-jianhua.wu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211022085231.93931-1-jianhua.wu@intel.com> References: <20211022085231.93931-1-jianhua.wu@intel.com> Subject: [FFmpeg-devel] [PATCH 3/4] avfilter/vf_exposure: calculate scale when initializing filter 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: Wu Jianhua MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 6lwHVofbHtZC Signed-off-by: Wu Jianhua --- libavfilter/vf_exposure.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavfilter/vf_exposure.c b/libavfilter/vf_exposure.c index 045ae710d3..9fd9f88293 100644 --- a/libavfilter/vf_exposure.c +++ b/libavfilter/vf_exposure.c @@ -57,6 +57,7 @@ static int exposure_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_job void ff_exposure_init(ExposureContext *s) { + s->scale = 1.f / (exp2f(-s->exposure) - s->black); s->exposure_func = exposure_c; if (ARCH_X86) @@ -66,9 +67,7 @@ void ff_exposure_init(ExposureContext *s) static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { AVFilterContext *ctx = inlink->dst; - ExposureContext *s = ctx->priv; - s->scale = 1.f / (exp2f(-s->exposure) - s->black); ff_filter_execute(ctx, exposure_slice, frame, NULL, FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));