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  int cpu_flags = av_get_cpu_flags();
64  int bit_depth = (!yadif->csp) ? 8
65  : yadif->csp->comp[0].depth_minus1 + 1;
66 
67  if (bit_depth >= 15) {
68 #if ARCH_X86_32
69  if (EXTERNAL_MMXEXT(cpu_flags))
71 #endif /* ARCH_X86_32 */
72  if (EXTERNAL_SSE2(cpu_flags))
74  if (EXTERNAL_SSSE3(cpu_flags))
76  if (EXTERNAL_SSE4(cpu_flags))
78  } else if ( bit_depth >= 9 && bit_depth <= 14) {
79 #if ARCH_X86_32
80  if (EXTERNAL_MMXEXT(cpu_flags))
82 #endif /* ARCH_X86_32 */
83  if (EXTERNAL_SSE2(cpu_flags))
85  if (EXTERNAL_SSSE3(cpu_flags))
87  } else {
88 #if ARCH_X86_32
89  if (EXTERNAL_MMXEXT(cpu_flags))
91 #endif /* ARCH_X86_32 */
92  if (EXTERNAL_SSE2(cpu_flags))
94  if (EXTERNAL_SSSE3(cpu_flags))
96  }
97 }
memory handling functions
void ff_yadif_filter_line_ssse3(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode)
void ff_yadif_filter_line_16bit_sse4(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode)
Macro definitions for various function/variable attributes.
#define EXTERNAL_SSE4(flags)
Definition: cpu.h:63
void ff_yadif_filter_line_10bit_sse2(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode)
if()
Definition: avfilter.c:975
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
Definition: pixdesc.h:100
#define av_cold
Definition: attributes.h:74
mode
Definition: f_perms.c:27
void ff_yadif_filter_line_16bit_mmxext(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode)
void(* filter_line)(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode)
Required alignment for filter_line.
Definition: yadif.h:60
#define EXTERNAL_SSE2(flags)
Definition: cpu.h:56
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)
uint16_t depth_minus1
Number of bits in the component minus 1.
Definition: pixdesc.h:57
void ff_yadif_filter_line_sse2(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode)
void ff_yadif_filter_line_16bit_ssse3(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode)
void ff_yadif_filter_line_mmxext(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode)
mcdeint parity
Definition: vf_mcdeint.c:275
void ff_yadif_filter_line_10bit_mmxext(void *dst, void *prev, void *cur, void *next, int w, int prefs, int mrefs, int parity, int mode)
#define EXTERNAL_SSSE3(flags)
Definition: cpu.h:62
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:76
#define EXTERNAL_MMXEXT(flags)
Definition: cpu.h:54
const AVPixFmtDescriptor * csp
Definition: yadif.h:66
void ff_yadif_filter_line_16bit_sse2(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)
Definition: vf_yadif_init.c:61