]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/x86/vf_tinterlace_init.c
Merge commit '4de220d2e3751c459f8739a08ac6ca52e63eba30'
[ffmpeg] / libavfilter / x86 / vf_tinterlace_init.c
index 2b10e1b74c3bfab1f30fb668246bee2084265f88..209812964d0ed0131e08f3a7d86bd5866ea933ba 100644 (file)
 #include "libavfilter/tinterlace.h"
 
 void ff_lowpass_line_sse2(uint8_t *dstp, ptrdiff_t linesize,
-                          const uint8_t *srcp,
-                          ptrdiff_t mref, ptrdiff_t pref);
+                          const uint8_t *srcp, ptrdiff_t mref,
+                          ptrdiff_t pref, int clip_max);
 void ff_lowpass_line_avx (uint8_t *dstp, ptrdiff_t linesize,
-                          const uint8_t *srcp,
-                          ptrdiff_t mref, ptrdiff_t pref);
+                          const uint8_t *srcp, ptrdiff_t mref,
+                          ptrdiff_t pref, int clip_max);
+
+void ff_lowpass_line_16_sse2(uint8_t *dstp, ptrdiff_t linesize,
+                             const uint8_t *srcp, ptrdiff_t mref,
+                             ptrdiff_t pref, int clip_max);
+void ff_lowpass_line_16_avx (uint8_t *dstp, ptrdiff_t linesize,
+                             const uint8_t *srcp, ptrdiff_t mref,
+                             ptrdiff_t pref, int clip_max);
 
 void ff_lowpass_line_complex_sse2(uint8_t *dstp, ptrdiff_t linesize,
-                                  const uint8_t *srcp,
-                                  ptrdiff_t mref, ptrdiff_t pref);
+                                  const uint8_t *srcp, ptrdiff_t mref,
+                                  ptrdiff_t pref, int clip_max);
+
+void ff_lowpass_line_complex_12_sse2(uint8_t *dstp, ptrdiff_t linesize,
+                                     const uint8_t *srcp, ptrdiff_t mref,
+                                     ptrdiff_t pref, int clip_max);
 
 av_cold void ff_tinterlace_init_x86(TInterlaceContext *s)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (EXTERNAL_SSE2(cpu_flags)) {
-        if (!(s->flags & TINTERLACE_FLAG_CVLPF))
-            s->lowpass_line = ff_lowpass_line_sse2;
-        else
-            s->lowpass_line = ff_lowpass_line_complex_sse2;
+    if (s->csp->comp[0].depth > 8) {
+        if (EXTERNAL_SSE2(cpu_flags)) {
+            if (!(s->flags & TINTERLACE_FLAG_CVLPF))
+                s->lowpass_line = ff_lowpass_line_16_sse2;
+            else
+                s->lowpass_line = ff_lowpass_line_complex_12_sse2;
+        }
+        if (EXTERNAL_AVX(cpu_flags))
+            if (!(s->flags & TINTERLACE_FLAG_CVLPF))
+                s->lowpass_line = ff_lowpass_line_16_avx;
+    } else {
+        if (EXTERNAL_SSE2(cpu_flags)) {
+            if (!(s->flags & TINTERLACE_FLAG_CVLPF))
+                s->lowpass_line = ff_lowpass_line_sse2;
+            else
+                s->lowpass_line = ff_lowpass_line_complex_sse2;
+        }
+        if (EXTERNAL_AVX(cpu_flags))
+            if (!(s->flags & TINTERLACE_FLAG_CVLPF))
+                s->lowpass_line = ff_lowpass_line_avx;
     }
-    if (EXTERNAL_AVX(cpu_flags))
-        if (!(s->flags & TINTERLACE_FLAG_CVLPF))
-            s->lowpass_line = ff_lowpass_line_avx;
 }