From patchwork Fri Feb 10 13:06:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Darnley X-Patchwork-Id: 40345 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:5494:b0:bf:7b3a:fd32 with SMTP id i20csp1355060pzk; Fri, 10 Feb 2023 05:09:30 -0800 (PST) X-Google-Smtp-Source: AK7set+DTwfV1k/VevaZ98qVGCfwFhCkLAr/2X45xfLD+lnMyaQIfUe0ntDwz04NHqHI7YVukTVQ X-Received: by 2002:a50:f68c:0:b0:4ab:2521:7b8e with SMTP id d12-20020a50f68c000000b004ab25217b8emr4662772edn.23.1676034570569; Fri, 10 Feb 2023 05:09:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676034570; cv=none; d=google.com; s=arc-20160816; b=xvovMELwqvi18QaFGFfMaAMmYyt6fzqr4xdJ6SNfK4IoscN07rO1CR+vKG8RkHSRuh S7fzg3nxKp5JIX01c+bsy3EP4EwbTIi9eyy7i2MsU8Sem0aGY9W5m1zOKvi4My2x4MhD XHRUP4ZREjH2V13ENzuTmLNqmkTTxUEhZ/81qfCdN8zvxTeYWEJChndNTkGevQaTaVMq K93Jw29hp6ea1PnNYUIAFV9kuD6KixOqEZ3i4yo2HLX+KjImr3boq6mP1a0CkRu8zyhD Nb04re2N+rBwosYinXWljT3mTKKEGqoIggyHEAAO+SS2Z4dZ9unYNne9dHnFSaOTDdIE ZqDQ== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=lzAd56k5AUc5b3kVORS1rWImR25qonyttG9C48A/Y5M=; b=LjERKDWgnXclKJ6LY74AEpKRmm7pvZVv0/Zfv1OK0Tw0RKtL0QpFwy/tVxjXdyxSmD ziWzfUOBdhvC9uhYlsuP92ol1tUPFv03gCxpbTH62DH9lvYJWiZAL+/+I8RkYomS0hyd rqxgVgph2h0fzBwnS7R2NdLWePxJKs75YmgXT1M0mV/PiahIcSJHiZar2lBxPuvf9fxY 1ZuNbElaytSc+Dd5CtpotAhmA826SoYv7lbUMISf9HNWqjLV4IJP9ZMED//6ZgJMl8zS XzPCaahRLXfz1RIpvWRQYIOxzBKzh9DXQyaX1TuvCp51/h1S0EPeNa5VdhKwhN6bhLpE Nh9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@obe-tv.20210112.gappssmtp.com header.s=20210112 header.b=6WzwkoaJ; 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 d11-20020aa7d5cb000000b00490ff375640si5326052eds.518.2023.02.10.05.09.27; Fri, 10 Feb 2023 05:09:30 -0800 (PST) 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=@obe-tv.20210112.gappssmtp.com header.s=20210112 header.b=6WzwkoaJ; 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 91CC368BDB9; Fri, 10 Feb 2023 15:09:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 94C4668BDB9 for ; Fri, 10 Feb 2023 15:09:16 +0200 (EET) Received: by mail-ed1-f52.google.com with SMTP id m8so4663151edd.10 for ; Fri, 10 Feb 2023 05:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=obe-tv.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=DPGkuBvm/0ukywpWHRDkcwEYD7LVps8SFlsCt2hhp5E=; b=6WzwkoaJQK3zpAGbJnXm3BsEd2X7axyBTKMTztU8iLCFMHxx4cgKuuCaIGLM9hdHAl tXT/tcNDXgxSL0hlGw1kbYbHsGMyZNRzsEh1H+TgfR3jJrZ6xVad3DsKlVWr0AZ2NRmz JsR6c8IxsaTVA6jxAmw1fiKDs+bANMWj+oTVBgug7WMOf/77wrbpNM9ww4Y4hBlPjQZx cu8GXDQKBJKlalTLthqqxMlsodsv48ATcXe+4WFRcBdS0wA1TkCwzKQSRQN+6N5os76C uBXN2SemlCPd+0SgxPcecW3RJCLXHL/2tzckbrb5jfBoso53Xd/592nWavtdzCr3h+vN u4rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DPGkuBvm/0ukywpWHRDkcwEYD7LVps8SFlsCt2hhp5E=; b=Ax3/78Eg85fNOj1sIcrJavQCi2rAV+amlsdY7o94FCs5WdQ1zltMUwHe7JvGD3bp7y Byxk6CAFi216nJ80NEO5oOFowyTL9r2/qL33xxbRLHlggvqu9LheCX4IvLVORAPpLXDO 9eP3vPQHv71Jzs/N/7Lgg3lAuDtJTeKxW4wihRg2Z+H2DMXsTgQ1I5mPitdnNQW7itzv uZbeobhWLUoIOJ/DOnvQ8pNv+p9mBZRta9ofOoFKeVVwY2qZF/DDSMlAe2p7BGlfqAhj QwhxYENbmhBWXFWKIzQUjNi4eXY6CM8FG51GLBLrE2GosXx8SPacr0g8pi+lZWneS5Hm jquA== X-Gm-Message-State: AO0yUKX2xdmaCl8P87CUbrkYpOyfwHEwis9tCYUHj44kS7usRdQZaOD4 buigGqiqaYEM6ayjaLk7vxKtuc977lZq+AppCDDUbA== X-Received: by 2002:a50:f68c:0:b0:4ab:2521:7b8e with SMTP id d12-20020a50f68c000000b004ab25217b8emr4661956edn.23.1676034555992; Fri, 10 Feb 2023 05:09:15 -0800 (PST) Received: from Dana.systemlords.lan (d51A44418.access.telenet.be. [81.164.68.24]) by smtp.gmail.com with ESMTPSA id x13-20020a50d60d000000b004aab23dec5csm2204059edi.4.2023.02.10.05.09.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 05:09:15 -0800 (PST) From: James Darnley To: ffmpeg-devel@ffmpeg.org Date: Fri, 10 Feb 2023 14:06:55 +0100 Message-Id: <20230210130657.455866-1-jdarnley@obe.tv> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] avfilter: move yadif's filter_line init into a dedicated function 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: OO4Jfxni/qOx --- libavfilter/vf_yadif.c | 13 +++++++++---- libavfilter/x86/vf_yadif_init.c | 4 +--- libavfilter/yadif.h | 3 ++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index afa4d1d53d..1f9434f961 100644 --- a/libavfilter/vf_yadif.c +++ b/libavfilter/vf_yadif.c @@ -303,7 +303,14 @@ static int config_output(AVFilterLink *outlink) s->csp = av_pix_fmt_desc_get(outlink->format); s->filter = filter; - if (s->csp->comp[0].depth > 8) { + ff_yadif_init_filter_line(s, s->csp->comp[0].depth); + + return 0; +} + +av_cold void ff_yadif_init_filter_line(YADIFContext *s, int bit_depth) +{ + if (bit_depth > 8) { s->filter_line = filter_line_c_16bit; s->filter_edges = filter_edges_16bit; } else { @@ -312,10 +319,8 @@ static int config_output(AVFilterLink *outlink) } #if ARCH_X86 - ff_yadif_init_x86(s); + ff_yadif_init_x86(s, bit_depth); #endif - - return 0; } diff --git a/libavfilter/x86/vf_yadif_init.c b/libavfilter/x86/vf_yadif_init.c index 257c3f9199..d648f0f835 100644 --- a/libavfilter/x86/vf_yadif_init.c +++ b/libavfilter/x86/vf_yadif_init.c @@ -47,11 +47,9 @@ void ff_yadif_filter_line_10bit_ssse3(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode); -av_cold void ff_yadif_init_x86(YADIFContext *yadif) +av_cold void ff_yadif_init_x86(YADIFContext *yadif, int bit_depth) { int cpu_flags = av_get_cpu_flags(); - int bit_depth = (!yadif->csp) ? 8 - : yadif->csp->comp[0].depth; if (bit_depth >= 15) { if (EXTERNAL_SSE2(cpu_flags)) diff --git a/libavfilter/yadif.h b/libavfilter/yadif.h index c928911b35..5d8309b403 100644 --- a/libavfilter/yadif.h +++ b/libavfilter/yadif.h @@ -86,7 +86,8 @@ typedef struct YADIFContext { int current_field; ///< YADIFCurrentField } YADIFContext; -void ff_yadif_init_x86(YADIFContext *yadif); +void ff_yadif_init_filter_line(YADIFContext *s, int bit_depth); +void ff_yadif_init_x86(YADIFContext *yadif, int bit_depth); int ff_yadif_filter_frame(AVFilterLink *link, AVFrame *frame);