Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/3] avfilter: move yadif's filter_line init into a dedicated function
@ 2023-02-10 13:06 James Darnley
  2023-02-10 13:06 ` [FFmpeg-devel] [PATCH 2/3] checkasm: add test for yadif James Darnley
  2023-02-10 13:06 ` [FFmpeg-devel] [PATCH 3/3] avfilter/yadif: add avx2 filter_line function James Darnley
  0 siblings, 2 replies; 5+ messages in thread
From: James Darnley @ 2023-02-10 13:06 UTC (permalink / raw)
  To: ffmpeg-devel

---
 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".

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-20 12:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-10 13:06 [FFmpeg-devel] [PATCH 1/3] avfilter: move yadif's filter_line init into a dedicated function James Darnley
2023-02-10 13:06 ` [FFmpeg-devel] [PATCH 2/3] checkasm: add test for yadif James Darnley
2023-02-10 13:06 ` [FFmpeg-devel] [PATCH 3/3] avfilter/yadif: add avx2 filter_line function James Darnley
2023-02-20 12:55   ` James Darnley
2023-02-20 12:55     ` James Darnley

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git