From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 26F40443EA for ; Fri, 10 Feb 2023 13:09:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4B61868BE19; Fri, 10 Feb 2023 15:09:23 +0200 (EET) 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-Google-Smtp-Source: AK7set+UdMcOWgNKcXpFr6Pd6/lxCDox4hDXK49305bByRNsGy0asf/drtpnM7qb1yGgIXq/tSBZ6Q== 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --- 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); -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".