Mercurial > mplayer.hg
annotate libmpcodecs/vf_ilpack.c @ 18721:722ac20fac5f
sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
part 2: cosmetic changes
author | rathann |
---|---|
date | Thu, 15 Jun 2006 22:59:40 +0000 |
parents | 7b408d60de9e |
children | 497ebe3ecc2b |
rev | line source |
---|---|
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
1 #include <stdio.h> |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
2 #include <stdlib.h> |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
3 #include <string.h> |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
4 #include <inttypes.h> |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
5 |
17012 | 6 #include "config.h" |
7 #include "mp_msg.h" | |
8 #include "cpudetect.h" | |
18104
7b408d60de9e
add support for intel mac. mp3lib is not fixed yet.
nplourde
parents:
17906
diff
changeset
|
9 #include "asmalign.h" |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
10 |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
11 #include "img_format.h" |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
12 #include "mp_image.h" |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
13 #include "vf.h" |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
14 |
17012 | 15 #include "libvo/fastmemcpy.h" |
16 #include "postproc/rgb2rgb.h" | |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
17 |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
18 typedef void (pack_func_t)(unsigned char *dst, unsigned char *y, |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
19 unsigned char *u, unsigned char *v, int w, int us, int vs); |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
20 |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
21 struct vf_priv_s { |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
22 int mode; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
23 pack_func_t *pack[2]; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
24 }; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
25 |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
26 static void pack_nn_C(unsigned char *dst, unsigned char *y, |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
27 unsigned char *u, unsigned char *v, int w) |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
28 { |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
29 int j; |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
30 for (j = w/2; j; j--) { |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
31 *dst++ = *y++; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
32 *dst++ = *u++; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
33 *dst++ = *y++; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
34 *dst++ = *v++; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
35 } |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
36 } |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
37 |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
38 static void pack_li_0_C(unsigned char *dst, unsigned char *y, |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
39 unsigned char *u, unsigned char *v, int w, int us, int vs) |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
40 { |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
41 int j; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
42 for (j = w/2; j; j--) { |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
43 *dst++ = *y++; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
44 *dst++ = (u[us+us] + 7*u[0])>>3; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
45 *dst++ = *y++; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
46 *dst++ = (v[vs+vs] + 7*v[0])>>3; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
47 u++; v++; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
48 } |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
49 } |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
50 |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
51 static void pack_li_1_C(unsigned char *dst, unsigned char *y, |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
52 unsigned char *u, unsigned char *v, int w, int us, int vs) |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
53 { |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
54 int j; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
55 for (j = w/2; j; j--) { |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
56 *dst++ = *y++; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
57 *dst++ = (3*u[us+us] + 5*u[0])>>3; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
58 *dst++ = *y++; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
59 *dst++ = (3*v[vs+vs] + 5*v[0])>>3; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
60 u++; v++; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
61 } |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
62 } |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
63 |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
64 #ifdef HAVE_MMX |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
65 static void pack_nn_MMX(unsigned char *dst, unsigned char *y, |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
66 unsigned char *u, unsigned char *v, int w) |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
67 { |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
68 int j; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
69 asm volatile ("" |
18104
7b408d60de9e
add support for intel mac. mp3lib is not fixed yet.
nplourde
parents:
17906
diff
changeset
|
70 ASMALIGN16 |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
71 "1: \n\t" |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
72 "movq (%0), %%mm1 \n\t" |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
73 "movq (%0), %%mm2 \n\t" |
11648 | 74 "movq (%1), %%mm4 \n\t" |
75 "movq (%2), %%mm6 \n\t" | |
76 "punpcklbw %%mm6, %%mm4 \n\t" | |
77 "punpcklbw %%mm4, %%mm1 \n\t" | |
78 "punpckhbw %%mm4, %%mm2 \n\t" | |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
79 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
80 "add $8, %0 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
81 "add $4, %1 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
82 "add $4, %2 \n\t" |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
83 "movq %%mm1, (%3) \n\t" |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
84 "movq %%mm2, 8(%3) \n\t" |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
85 "add $16, %3 \n\t" |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
86 "decl %4 \n\t" |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
87 "jnz 1b \n\t" |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
88 "emms \n\t" |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
89 : |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
90 : "r" (y), "r" (u), "r" (v), "r" (dst), "r" (w/8) |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
91 : "memory" |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
92 ); |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
93 pack_nn_C(dst, y, u, v, (w&7)); |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
94 } |
11645 | 95 |
96 static void pack_li_0_MMX(unsigned char *dst, unsigned char *y, | |
97 unsigned char *u, unsigned char *v, int w, int us, int vs) | |
98 { | |
99 asm volatile ("" | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
100 "push %%"REG_BP" \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
101 #ifdef ARCH_X86_64 |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
102 "mov %6, %%"REG_BP" \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
103 #else |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
104 "movl 4(%%"REG_d"), %%"REG_BP" \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
105 "movl (%%"REG_d"), %%"REG_d" \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
106 #endif |
11645 | 107 "pxor %%mm0, %%mm0 \n\t" |
108 | |
18104
7b408d60de9e
add support for intel mac. mp3lib is not fixed yet.
nplourde
parents:
17906
diff
changeset
|
109 ASMALIGN16 |
11645 | 110 ".Lli0: \n\t" |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
111 "movq (%%"REG_S"), %%mm1 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
112 "movq (%%"REG_S"), %%mm2 \n\t" |
11645 | 113 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
114 "movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
115 "movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t" |
11645 | 116 "punpcklbw %%mm0, %%mm4 \n\t" |
117 "punpcklbw %%mm0, %%mm6 \n\t" | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
118 "movq (%%"REG_a"), %%mm3 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
119 "movq (%%"REG_b"), %%mm5 \n\t" |
11645 | 120 "punpcklbw %%mm0, %%mm3 \n\t" |
121 "punpcklbw %%mm0, %%mm5 \n\t" | |
122 "paddw %%mm3, %%mm4 \n\t" | |
123 "paddw %%mm5, %%mm6 \n\t" | |
124 "paddw %%mm3, %%mm4 \n\t" | |
125 "paddw %%mm5, %%mm6 \n\t" | |
126 "paddw %%mm3, %%mm4 \n\t" | |
127 "paddw %%mm5, %%mm6 \n\t" | |
128 "paddw %%mm3, %%mm4 \n\t" | |
129 "paddw %%mm5, %%mm6 \n\t" | |
130 "paddw %%mm3, %%mm4 \n\t" | |
131 "paddw %%mm5, %%mm6 \n\t" | |
132 "paddw %%mm3, %%mm4 \n\t" | |
133 "paddw %%mm5, %%mm6 \n\t" | |
134 "paddw %%mm3, %%mm4 \n\t" | |
135 "paddw %%mm5, %%mm6 \n\t" | |
136 "psrlw $3, %%mm4 \n\t" | |
137 "psrlw $3, %%mm6 \n\t" | |
11648 | 138 "packuswb %%mm4, %%mm4 \n\t" |
139 "packuswb %%mm6, %%mm6 \n\t" | |
140 "punpcklbw %%mm6, %%mm4 \n\t" | |
141 "punpcklbw %%mm4, %%mm1 \n\t" | |
142 "punpckhbw %%mm4, %%mm2 \n\t" | |
11645 | 143 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
144 "movq %%mm1, (%%"REG_D") \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
145 "movq %%mm2, 8(%%"REG_D") \n\t" |
11645 | 146 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
147 "movq 8(%%"REG_S"), %%mm1 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
148 "movq 8(%%"REG_S"), %%mm2 \n\t" |
11645 | 149 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
150 "movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
151 "movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t" |
11645 | 152 "punpckhbw %%mm0, %%mm4 \n\t" |
153 "punpckhbw %%mm0, %%mm6 \n\t" | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
154 "movq (%%"REG_a"), %%mm3 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
155 "movq (%%"REG_b"), %%mm5 \n\t" |
11645 | 156 "punpckhbw %%mm0, %%mm3 \n\t" |
157 "punpckhbw %%mm0, %%mm5 \n\t" | |
158 "paddw %%mm3, %%mm4 \n\t" | |
159 "paddw %%mm5, %%mm6 \n\t" | |
160 "paddw %%mm3, %%mm4 \n\t" | |
161 "paddw %%mm5, %%mm6 \n\t" | |
162 "paddw %%mm3, %%mm4 \n\t" | |
163 "paddw %%mm5, %%mm6 \n\t" | |
164 "paddw %%mm3, %%mm4 \n\t" | |
165 "paddw %%mm5, %%mm6 \n\t" | |
166 "paddw %%mm3, %%mm4 \n\t" | |
167 "paddw %%mm5, %%mm6 \n\t" | |
168 "paddw %%mm3, %%mm4 \n\t" | |
169 "paddw %%mm5, %%mm6 \n\t" | |
170 "paddw %%mm3, %%mm4 \n\t" | |
171 "paddw %%mm5, %%mm6 \n\t" | |
172 "psrlw $3, %%mm4 \n\t" | |
173 "psrlw $3, %%mm6 \n\t" | |
11648 | 174 "packuswb %%mm4, %%mm4 \n\t" |
175 "packuswb %%mm6, %%mm6 \n\t" | |
176 "punpcklbw %%mm6, %%mm4 \n\t" | |
177 "punpcklbw %%mm4, %%mm1 \n\t" | |
178 "punpckhbw %%mm4, %%mm2 \n\t" | |
11645 | 179 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
180 "add $16, %%"REG_S" \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
181 "add $8, %%"REG_a" \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
182 "add $8, %%"REG_b" \n\t" |
11645 | 183 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
184 "movq %%mm1, 16(%%"REG_D") \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
185 "movq %%mm2, 24(%%"REG_D") \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
186 "add $32, %%"REG_D" \n\t" |
11645 | 187 |
188 "decl %%ecx \n\t" | |
189 "jnz .Lli0 \n\t" | |
190 "emms \n\t" | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
191 "pop %%"REG_BP" \n\t" |
11645 | 192 : |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
193 : "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16), |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
194 #ifdef ARCH_X86_64 |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
195 "d" ((long)us), "r" ((long)vs) |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
196 #else |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
197 "d" (&us) |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
198 #endif |
11645 | 199 : "memory" |
200 ); | |
201 pack_li_0_C(dst, y, u, v, (w&15), us, vs); | |
202 } | |
203 | |
204 static void pack_li_1_MMX(unsigned char *dst, unsigned char *y, | |
205 unsigned char *u, unsigned char *v, int w, int us, int vs) | |
206 { | |
207 asm volatile ("" | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
208 "push %%"REG_BP" \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
209 #ifdef ARCH_X86_64 |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
210 "mov %6, %%"REG_BP" \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
211 #else |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
212 "movl 4(%%"REG_d"), %%"REG_BP" \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
213 "movl (%%"REG_d"), %%"REG_d" \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
214 #endif |
11645 | 215 "pxor %%mm0, %%mm0 \n\t" |
216 | |
18104
7b408d60de9e
add support for intel mac. mp3lib is not fixed yet.
nplourde
parents:
17906
diff
changeset
|
217 ASMALIGN16 |
11645 | 218 ".Lli1: \n\t" |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
219 "movq (%%"REG_S"), %%mm1 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
220 "movq (%%"REG_S"), %%mm2 \n\t" |
11645 | 221 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
222 "movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
223 "movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t" |
11645 | 224 "punpcklbw %%mm0, %%mm4 \n\t" |
225 "punpcklbw %%mm0, %%mm6 \n\t" | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
226 "movq (%%"REG_a"), %%mm3 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
227 "movq (%%"REG_b"), %%mm5 \n\t" |
11645 | 228 "punpcklbw %%mm0, %%mm3 \n\t" |
229 "punpcklbw %%mm0, %%mm5 \n\t" | |
230 "movq %%mm4, %%mm7 \n\t" | |
231 "paddw %%mm4, %%mm4 \n\t" | |
232 "paddw %%mm7, %%mm4 \n\t" | |
233 "movq %%mm6, %%mm7 \n\t" | |
234 "paddw %%mm6, %%mm6 \n\t" | |
235 "paddw %%mm7, %%mm6 \n\t" | |
236 "paddw %%mm3, %%mm4 \n\t" | |
237 "paddw %%mm5, %%mm6 \n\t" | |
238 "paddw %%mm3, %%mm4 \n\t" | |
239 "paddw %%mm5, %%mm6 \n\t" | |
240 "paddw %%mm3, %%mm4 \n\t" | |
241 "paddw %%mm5, %%mm6 \n\t" | |
242 "paddw %%mm3, %%mm4 \n\t" | |
243 "paddw %%mm5, %%mm6 \n\t" | |
244 "paddw %%mm3, %%mm4 \n\t" | |
245 "paddw %%mm5, %%mm6 \n\t" | |
246 "psrlw $3, %%mm4 \n\t" | |
247 "psrlw $3, %%mm6 \n\t" | |
11648 | 248 "packuswb %%mm4, %%mm4 \n\t" |
249 "packuswb %%mm6, %%mm6 \n\t" | |
250 "punpcklbw %%mm6, %%mm4 \n\t" | |
251 "punpcklbw %%mm4, %%mm1 \n\t" | |
252 "punpckhbw %%mm4, %%mm2 \n\t" | |
11645 | 253 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
254 "movq %%mm1, (%%"REG_D") \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
255 "movq %%mm2, 8(%%"REG_D") \n\t" |
11645 | 256 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
257 "movq 8(%%"REG_S"), %%mm1 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
258 "movq 8(%%"REG_S"), %%mm2 \n\t" |
11645 | 259 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
260 "movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
261 "movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t" |
11645 | 262 "punpckhbw %%mm0, %%mm4 \n\t" |
263 "punpckhbw %%mm0, %%mm6 \n\t" | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
264 "movq (%%"REG_a"), %%mm3 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
265 "movq (%%"REG_b"), %%mm5 \n\t" |
11645 | 266 "punpckhbw %%mm0, %%mm3 \n\t" |
267 "punpckhbw %%mm0, %%mm5 \n\t" | |
268 "movq %%mm4, %%mm7 \n\t" | |
269 "paddw %%mm4, %%mm4 \n\t" | |
270 "paddw %%mm7, %%mm4 \n\t" | |
271 "movq %%mm6, %%mm7 \n\t" | |
272 "paddw %%mm6, %%mm6 \n\t" | |
273 "paddw %%mm7, %%mm6 \n\t" | |
274 "paddw %%mm3, %%mm4 \n\t" | |
275 "paddw %%mm5, %%mm6 \n\t" | |
276 "paddw %%mm3, %%mm4 \n\t" | |
277 "paddw %%mm5, %%mm6 \n\t" | |
278 "paddw %%mm3, %%mm4 \n\t" | |
279 "paddw %%mm5, %%mm6 \n\t" | |
280 "paddw %%mm3, %%mm4 \n\t" | |
281 "paddw %%mm5, %%mm6 \n\t" | |
282 "paddw %%mm3, %%mm4 \n\t" | |
283 "paddw %%mm5, %%mm6 \n\t" | |
284 "psrlw $3, %%mm4 \n\t" | |
285 "psrlw $3, %%mm6 \n\t" | |
11648 | 286 "packuswb %%mm4, %%mm4 \n\t" |
287 "packuswb %%mm6, %%mm6 \n\t" | |
288 "punpcklbw %%mm6, %%mm4 \n\t" | |
289 "punpcklbw %%mm4, %%mm1 \n\t" | |
290 "punpckhbw %%mm4, %%mm2 \n\t" | |
11645 | 291 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
292 "add $16, %%"REG_S" \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
293 "add $8, %%"REG_a" \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
294 "add $8, %%"REG_b" \n\t" |
11645 | 295 |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
296 "movq %%mm1, 16(%%"REG_D") \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
297 "movq %%mm2, 24(%%"REG_D") \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
298 "add $32, %%"REG_D" \n\t" |
11645 | 299 |
300 "decl %%ecx \n\t" | |
301 "jnz .Lli1 \n\t" | |
302 "emms \n\t" | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
303 "pop %%"REG_BP" \n\t" |
11645 | 304 : |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
305 : "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16), |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
306 #ifdef ARCH_X86_64 |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
307 "d" ((long)us), "r" ((long)vs) |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
308 #else |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
309 "d" (&us) |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
310 #endif |
11645 | 311 : "memory" |
312 ); | |
313 pack_li_1_C(dst, y, u, v, (w&15), us, vs); | |
314 } | |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
315 #endif |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
316 |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
317 static pack_func_t *pack_nn; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
318 static pack_func_t *pack_li_0; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
319 static pack_func_t *pack_li_1; |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
320 |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
321 static void ilpack(unsigned char *dst, unsigned char *src[3], |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
322 int dststride, int srcstride[3], int w, int h, pack_func_t *pack[2]) |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
323 { |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
324 int i; |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
325 unsigned char *y, *u, *v; |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
326 int ys = srcstride[0], us = srcstride[1], vs = srcstride[2]; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
327 int a, b; |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
328 |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
329 y = src[0]; |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
330 u = src[1]; |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
331 v = src[2]; |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
332 |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
333 pack_nn(dst, y, u, v, w, 0, 0); |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
334 y += ys; dst += dststride; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
335 pack_nn(dst, y, u+us, v+vs, w, 0, 0); |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
336 y += ys; dst += dststride; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
337 for (i=2; i<h-2; i++) { |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
338 a = (i&2) ? 1 : -1; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
339 b = (i&1) ^ ((i&2)>>1); |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
340 pack[b](dst, y, u, v, w, us*a, vs*a); |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
341 y += ys; |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
342 if ((i&3) == 1) { |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
343 u -= us; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
344 v -= vs; |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
345 } else { |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
346 u += us; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
347 v += vs; |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
348 } |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
349 dst += dststride; |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
350 } |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
351 pack_nn(dst, y, u, v, w, 0, 0); |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
352 y += ys; dst += dststride; u += us; v += vs; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
353 pack_nn(dst, y, u, v, w, 0, 0); |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
354 } |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
355 |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
356 |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17012
diff
changeset
|
357 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts) |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
358 { |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
359 mp_image_t *dmpi; |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
360 |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
361 // hope we'll get DR buffer: |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
362 dmpi=vf_get_image(vf->next, IMGFMT_YUY2, |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
363 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
364 mpi->w, mpi->h); |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
365 |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
366 ilpack(dmpi->planes[0], mpi->planes, dmpi->stride[0], mpi->stride, mpi->w, mpi->h, vf->priv->pack); |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
367 |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17012
diff
changeset
|
368 return vf_next_put_image(vf,dmpi, pts); |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
369 } |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
370 |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
371 static int config(struct vf_instance_s* vf, |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
372 int width, int height, int d_width, int d_height, |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
373 unsigned int flags, unsigned int outfmt) |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
374 { |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
375 /* FIXME - also support UYVY output? */ |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
376 return vf_next_config(vf, width, height, d_width, d_height, flags, IMGFMT_YUY2); |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
377 } |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
378 |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
379 |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
380 static int query_format(struct vf_instance_s* vf, unsigned int fmt) |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
381 { |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
382 /* FIXME - really any YUV 4:2:0 input format should work */ |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
383 switch (fmt) { |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
384 case IMGFMT_YV12: |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
385 case IMGFMT_IYUV: |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
386 case IMGFMT_I420: |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
387 return vf_next_query_format(vf,IMGFMT_YUY2); |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
388 } |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
389 return 0; |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
390 } |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
391 |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
392 static int open(vf_instance_t *vf, char* args) |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
393 { |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
394 vf->config=config; |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
395 vf->query_format=query_format; |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
396 vf->put_image=put_image; |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
397 vf->priv = calloc(1, sizeof(struct vf_priv_s)); |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
398 vf->priv->mode = 1; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
399 if (args) sscanf(args, "%d", &vf->priv->mode); |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
400 |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
401 pack_nn = (pack_func_t *)pack_nn_C; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
402 pack_li_0 = pack_li_0_C; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
403 pack_li_1 = pack_li_1_C; |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
404 #ifdef HAVE_MMX |
11645 | 405 if(gCpuCaps.hasMMX) { |
406 pack_nn = (pack_func_t *)pack_nn_MMX; | |
407 pack_li_0 = pack_li_0_MMX; | |
408 pack_li_1 = pack_li_1_MMX; | |
409 } | |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
410 #endif |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
411 |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
412 switch(vf->priv->mode) { |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
413 case 0: |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
414 vf->priv->pack[0] = vf->priv->pack[1] = pack_nn; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
415 break; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
416 default: |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
417 mp_msg(MSGT_VFILTER, MSGL_WARN, |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
418 "ilpack: unknown mode %d (fallback to linear)\n", |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
419 vf->priv->mode); |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
420 case 1: |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
421 vf->priv->pack[0] = pack_li_0; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
422 vf->priv->pack[1] = pack_li_1; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
423 break; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
424 } |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
425 |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
426 return 1; |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
427 } |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
428 |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
429 vf_info_t vf_info_ilpack = { |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
430 "4:2:0 planar -> 4:2:2 packed reinterlacer", |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
431 "ilpack", |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
432 "Richard Felker", |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
433 "", |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
434 open, |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
435 NULL |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
436 }; |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
437 |