From patchwork Fri Oct 22 10:16:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 31211 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp1625215ioa; Fri, 22 Oct 2021 03:17:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDinHJOifC9uULCOm8auGmfg+G3mpC8oKHGU1TTtbHdaQ+tXMeCuu588vnXBRjBkIgpiRc X-Received: by 2002:aa7:de8f:: with SMTP id j15mr15892643edv.347.1634897840045; Fri, 22 Oct 2021 03:17:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634897840; cv=none; d=google.com; s=arc-20160816; b=xnjy5pG9oSkCJrZDTusTqvQTaqgxsOctTu4CnRZ+OhW9D+uiW5UXetxrYvapZfsuIQ t1DClKGy3oaaPsmQ2dqendJqXuv4QbSsWnjAZEla2j5ZldLMfPkznggF/qd7uq33LY5C gy3m9UMeVgrT3BSnt+7YGnOag38gnQ+yvnmT9hy0QQL8s6+iBGR83QmsrscMrBbpzaDc dnC2V+VXMb0qchXF6yn4sPMNg59XK29FDoDpm/t7ijrHGv9bXTsnSelHr2YZBkEPRsDX BXyGtM4vNAImmDlZ7QNYc6kesA9YmdqV/+0VuugDkmm30r8C2D4FZ3tt1e/+vwYnqBWh Fy0w== 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=e2Ep8H6WgXCXLq5mnWsP8Ba5dgsSx1mSwXk+ry3TR5Y=; b=lDHkldBTc/HpvGnA3d5amva8ZqdvTvLomBQ3MMNnZcFZOZmRzZxLC8KJzELL+iok/D jkD+KXjU3FZCh8zUoOT429ydBvTJ2XRP+0Zhgc4YEJuDOSeJDpSZcvzL98i4Aa7oyx2G J2aofCY8A8QL9gRw4FG/jwaWXvW7Mw7ZQXdlt5vgdhfiTWtjOxIQJQ5NB2WeltwWShts SkRFOHBjzXbzvaA7Qbmlo2E+j7JI3YVn1LR2+EM7drxtnykCaV88z3gOKcVGS/7UGkSK zK7i0shb5Uuxwfx4t0buHPNmJJpxNYwREGxAKvZtIsgHl75AdL1cWbOhiEgKUqID0oOC A4Vg== 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 f15si14341207edf.490.2021.10.22.03.17.19; Fri, 22 Oct 2021 03:17:20 -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 8AFDB68A926; Fri, 22 Oct 2021 13:17:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DC54268A901 for ; Fri, 22 Oct 2021 13:17:00 +0300 (EEST) X-IronPort-AV: E=McAfee;i="6200,9189,10144"; a="229543944" X-IronPort-AV: E=Sophos;i="5.87,172,1631602800"; d="scan'208";a="229543944" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2021 03:16:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,172,1631602800"; d="scan'208";a="495620330" Received: from otc-skl-e5-server.sh.intel.com ([10.239.43.106]) by orsmga008.jf.intel.com with ESMTP; 22 Oct 2021 03:16:57 -0700 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Fri, 22 Oct 2021 18:16:33 +0800 Message-Id: <20211022101634.25023-2-jianhua.wu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211022101634.25023-1-jianhua.wu@intel.com> References: <20211022101634.25023-1-jianhua.wu@intel.com> Subject: [FFmpeg-devel] [PATCH v2 2/3] avfilter/x86/vf_exposure: add ff_exposure_avx2 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: YkDjG3uXkFil Signed-off-by: Wu Jianhua --- libavfilter/x86/vf_exposure.asm | 5 +++++ libavfilter/x86/vf_exposure_init.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/libavfilter/x86/vf_exposure.asm b/libavfilter/x86/vf_exposure.asm index 3351c6fb3b..a0d25afbc4 100644 --- a/libavfilter/x86/vf_exposure.asm +++ b/libavfilter/x86/vf_exposure.asm @@ -52,4 +52,9 @@ cglobal exposure, 2, 2, 4, ptr, length, black, scale %if ARCH_X86_64 INIT_XMM sse EXPOSURE + +%if HAVE_AVX2_EXTERNAL +INIT_YMM avx2 +EXPOSURE +%endif %endif diff --git a/libavfilter/x86/vf_exposure_init.c b/libavfilter/x86/vf_exposure_init.c index de1b360f6c..80dae6164e 100644 --- a/libavfilter/x86/vf_exposure_init.c +++ b/libavfilter/x86/vf_exposure_init.c @@ -24,6 +24,7 @@ #include "libavfilter/exposure.h" void ff_exposure_sse(float *ptr, int length, float black, float scale); +void ff_exposure_avx2(float *ptr, int length, float black, float scale); av_cold void ff_exposure_init_x86(ExposureContext *s) { @@ -32,5 +33,10 @@ av_cold void ff_exposure_init_x86(ExposureContext *s) #if ARCH_X86_64 if (EXTERNAL_SSE(cpu_flags)) s->exposure_func = ff_exposure_sse; + +#if HAVE_AVX2_EXTERNAL + if (EXTERNAL_AVX2_FAST(cpu_flags)) + s->exposure_func = ff_exposure_avx2; +#endif #endif }