FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vf_yadif_init.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006 Michael Niedermayer <michaelni@gmx.at>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include "libavutil/attributes.h"
22 #include "libavutil/cpu.h"
23 #include "libavutil/mem.h"
24 #include "libavutil/x86/asm.h"
25 #include "libavutil/x86/cpu.h"
26 #include "libavfilter/yadif.h"
27 
28 void ff_yadif_filter_line_mmxext(void *dst, void *prev, void *cur,
29  void *next, int w, int prefs,
30  int mrefs, int parity, int mode);
31 void ff_yadif_filter_line_sse2(void *dst, void *prev, void *cur,
32  void *next, int w, int prefs,
33  int mrefs, int parity, int mode);
34 void ff_yadif_filter_line_ssse3(void *dst, void *prev, void *cur,
35  void *next, int w, int prefs,
36  int mrefs, int parity, int mode);
37 
38 void ff_yadif_filter_line_16bit_mmxext(void *dst, void *prev, void *cur,
39  void *next, int w, int prefs,
40  int mrefs, int parity, int mode);
41 void ff_yadif_filter_line_16bit_sse2(void *dst, void *prev, void *cur,
42  void *next, int w, int prefs,
43  int mrefs, int parity, int mode);
44 void ff_yadif_filter_line_16bit_ssse3(void *dst, void *prev, void *cur,
45  void *next, int w, int prefs,
46  int mrefs, int parity, int mode);
47 void ff_yadif_filter_line_16bit_sse4(void *dst, void *prev, void *cur,
48  void *next, int w, int prefs,
49  int mrefs, int parity, int mode);
50 
51 void ff_yadif_filter_line_10bit_mmxext(void *dst, void *prev, void *cur,
52  void *next, int w, int prefs,
53  int mrefs, int parity, int mode);
54 void ff_yadif_filter_line_10bit_sse2(void *dst, void *prev, void *cur,
55  void *next, int w, int prefs,
56  int mrefs, int parity, int mode);
57 void ff_yadif_filter_line_10bit_ssse3(void *dst, void *prev, void *cur,
58  void *next, int w, int prefs,
59  int mrefs, int parity, int mode);
60 
62 {
63 #if HAVE_YASM
65  int bit_depth = (!yadif->csp) ? 8
66  : yadif->csp->comp[0].depth_minus1 + 1;
67 
68  if (bit_depth >= 15) {
69 #if ARCH_X86_32
70  if (EXTERNAL_MMXEXT(cpu_flags))
72 #endif /* ARCH_X86_32 */
73  if (EXTERNAL_SSE2(cpu_flags))
75  if (EXTERNAL_SSSE3(cpu_flags))
77  if (EXTERNAL_SSE4(cpu_flags))
79  } else if ( bit_depth >= 9 && bit_depth <= 14) {
80 #if ARCH_X86_32
81  if (EXTERNAL_MMXEXT(cpu_flags))
83 #endif /* ARCH_X86_32 */
84  if (EXTERNAL_SSE2(cpu_flags))
86  if (EXTERNAL_SSSE3(cpu_flags))
88  } else {
89 #if ARCH_X86_32
90  if (EXTERNAL_MMXEXT(cpu_flags))
92 #endif /* ARCH_X86_32 */
93  if (EXTERNAL_SSE2(cpu_flags))
95  if (EXTERNAL_SSSE3(cpu_flags))
97  }
98 #endif /* HAVE_YASM */
99 }