Mercurial > mplayer.hg
annotate libmpcodecs/vf_ilpack.c @ 35455:c9c79a011f6f
Fix bug with wrong track number after playlist has been cleared.
This also fixes issues with other associated information if there
is no media opened after playback.
Roughly based on a patch by Hans-Dieter Kosch, hdkosch kabelbw de.
author | ib |
---|---|
date | Sat, 01 Dec 2012 19:18:47 +0000 |
parents | 51b77c9a11ef |
children | b4ce15212bfc |
rev | line source |
---|---|
30421
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
1 /* |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
2 * This file is part of MPlayer. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
3 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
4 * MPlayer is free software; you can redistribute it and/or modify |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
7 * (at your option) any later version. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
8 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
9 * MPlayer is distributed in the hope that it will be useful, |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
12 * GNU General Public License for more details. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
13 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
14 * You should have received a copy of the GNU General Public License along |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
17 */ |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29639
diff
changeset
|
18 |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
19 #include <stdio.h> |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
20 #include <stdlib.h> |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
21 #include <string.h> |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
22 #include <inttypes.h> |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
23 |
17012 | 24 #include "config.h" |
25 #include "mp_msg.h" | |
26 #include "cpudetect.h" | |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
27 |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
28 #include "img_format.h" |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
29 #include "mp_image.h" |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
30 #include "vf.h" |
33448
5e2569e52969
Do not call functions through a function pointer specifying more
reimar
parents:
32702
diff
changeset
|
31 #include "libavutil/attributes.h" |
34198 | 32 #include "libavutil/x86_cpu.h" |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
33 |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
34 typedef void (pack_func_t)(unsigned char *dst, unsigned char *y, |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
35 unsigned char *u, unsigned char *v, int w, int us, int vs); |
11643
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 struct vf_priv_s { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
38 int mode; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
39 pack_func_t *pack[2]; |
11643
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 |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
42 static void pack_nn_C(unsigned char *dst, unsigned char *y, |
33448
5e2569e52969
Do not call functions through a function pointer specifying more
reimar
parents:
32702
diff
changeset
|
43 unsigned char *u, unsigned char *v, int w, |
5e2569e52969
Do not call functions through a function pointer specifying more
reimar
parents:
32702
diff
changeset
|
44 int av_unused us, int av_unused vs) |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
45 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
46 int j; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
47 for (j = w/2; j; j--) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
48 *dst++ = *y++; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
49 *dst++ = *u++; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
50 *dst++ = *y++; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
51 *dst++ = *v++; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
52 } |
11643
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 |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
55 static void pack_li_0_C(unsigned char *dst, unsigned char *y, |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
56 unsigned char *u, unsigned char *v, int w, int us, int vs) |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
57 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
58 int j; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
59 for (j = w/2; j; j--) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
60 *dst++ = *y++; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
61 *dst++ = (u[us+us] + 7*u[0])>>3; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
62 *dst++ = *y++; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
63 *dst++ = (v[vs+vs] + 7*v[0])>>3; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
64 u++; v++; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
65 } |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
66 } |
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 static void pack_li_1_C(unsigned char *dst, unsigned char *y, |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
69 unsigned char *u, unsigned char *v, int w, int us, int vs) |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
70 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
71 int j; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
72 for (j = w/2; j; j--) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
73 *dst++ = *y++; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
74 *dst++ = (3*u[us+us] + 5*u[0])>>3; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
75 *dst++ = *y++; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
76 *dst++ = (3*v[vs+vs] + 5*v[0])>>3; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
77 u++; v++; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
78 } |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
79 } |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
80 |
28290 | 81 #if HAVE_MMX |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
82 static void pack_nn_MMX(unsigned char *dst, unsigned char *y, |
33448
5e2569e52969
Do not call functions through a function pointer specifying more
reimar
parents:
32702
diff
changeset
|
83 unsigned char *u, unsigned char *v, int w, |
5e2569e52969
Do not call functions through a function pointer specifying more
reimar
parents:
32702
diff
changeset
|
84 int av_unused us, int av_unused vs) |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
85 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
86 __asm__ volatile ("" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
87 ASMALIGN(4) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
88 "1: \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
89 "movq (%0), %%mm1 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
90 "movq (%0), %%mm2 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
91 "movq (%1), %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
92 "movq (%2), %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
93 "punpcklbw %%mm6, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
94 "punpcklbw %%mm4, %%mm1 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
95 "punpckhbw %%mm4, %%mm2 \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
96 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
97 "add $8, %0 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
98 "add $4, %1 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
99 "add $4, %2 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
100 "movq %%mm1, (%3) \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
101 "movq %%mm2, 8(%3) \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
102 "add $16, %3 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
103 "decl %4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
104 "jnz 1b \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
105 "emms \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
106 : |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
107 : "r" (y), "r" (u), "r" (v), "r" (dst), "r" (w/8) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
108 : "memory" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
109 ); |
33448
5e2569e52969
Do not call functions through a function pointer specifying more
reimar
parents:
32702
diff
changeset
|
110 pack_nn_C(dst, y, u, v, (w&7), 0, 0); |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
111 } |
11645 | 112 |
29639
26a355ffe458
Add several HAVE_EBX_AVAILABLE conditions where necessary
reimar
parents:
29263
diff
changeset
|
113 #if HAVE_EBX_AVAILABLE |
11645 | 114 static void pack_li_0_MMX(unsigned char *dst, unsigned char *y, |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
115 unsigned char *u, unsigned char *v, int w, int us, int vs) |
11645 | 116 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
117 __asm__ volatile ("" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
118 "push %%"REG_BP" \n\t" |
28290 | 119 #if ARCH_X86_64 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
120 "mov %6, %%"REG_BP" \n\t" |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
121 #else |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
122 "movl 4(%%"REG_d"), %%"REG_BP" \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
123 "movl (%%"REG_d"), %%"REG_d" \n\t" |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
124 #endif |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
125 "pxor %%mm0, %%mm0 \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
126 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
127 ASMALIGN(4) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
128 ".Lli0: \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
129 "movq (%%"REG_S"), %%mm1 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
130 "movq (%%"REG_S"), %%mm2 \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
131 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
132 "movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
133 "movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
134 "punpcklbw %%mm0, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
135 "punpcklbw %%mm0, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
136 "movq (%%"REG_a"), %%mm3 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
137 "movq (%%"REG_b"), %%mm5 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
138 "punpcklbw %%mm0, %%mm3 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
139 "punpcklbw %%mm0, %%mm5 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
140 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
141 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
142 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
143 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
144 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
145 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
146 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
147 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
148 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
149 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
150 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
151 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
152 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
153 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
154 "psrlw $3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
155 "psrlw $3, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
156 "packuswb %%mm4, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
157 "packuswb %%mm6, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
158 "punpcklbw %%mm6, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
159 "punpcklbw %%mm4, %%mm1 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
160 "punpckhbw %%mm4, %%mm2 \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
161 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
162 "movq %%mm1, (%%"REG_D") \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
163 "movq %%mm2, 8(%%"REG_D") \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
164 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
165 "movq 8(%%"REG_S"), %%mm1 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
166 "movq 8(%%"REG_S"), %%mm2 \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
167 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
168 "movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
169 "movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
170 "punpckhbw %%mm0, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
171 "punpckhbw %%mm0, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
172 "movq (%%"REG_a"), %%mm3 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
173 "movq (%%"REG_b"), %%mm5 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
174 "punpckhbw %%mm0, %%mm3 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
175 "punpckhbw %%mm0, %%mm5 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
176 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
177 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
178 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
179 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
180 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
181 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
182 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
183 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
184 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
185 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
186 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
187 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
188 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
189 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
190 "psrlw $3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
191 "psrlw $3, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
192 "packuswb %%mm4, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
193 "packuswb %%mm6, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
194 "punpcklbw %%mm6, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
195 "punpcklbw %%mm4, %%mm1 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
196 "punpckhbw %%mm4, %%mm2 \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
197 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
198 "add $16, %%"REG_S" \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
199 "add $8, %%"REG_a" \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
200 "add $8, %%"REG_b" \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
201 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
202 "movq %%mm1, 16(%%"REG_D") \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
203 "movq %%mm2, 24(%%"REG_D") \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
204 "add $32, %%"REG_D" \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
205 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
206 "decl %%ecx \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
207 "jnz .Lli0 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
208 "emms \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
209 "pop %%"REG_BP" \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
210 : |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
211 : "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16), |
28290 | 212 #if ARCH_X86_64 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
213 "d" ((x86_reg)us), "r" ((x86_reg)vs) |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
214 #else |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
215 "d" (&us) |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
216 #endif |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
217 : "memory" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
218 ); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
219 pack_li_0_C(dst, y, u, v, (w&15), us, vs); |
11645 | 220 } |
221 | |
222 static void pack_li_1_MMX(unsigned char *dst, unsigned char *y, | |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
223 unsigned char *u, unsigned char *v, int w, int us, int vs) |
11645 | 224 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
225 __asm__ volatile ("" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
226 "push %%"REG_BP" \n\t" |
28290 | 227 #if ARCH_X86_64 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
228 "mov %6, %%"REG_BP" \n\t" |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
229 #else |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
230 "movl 4(%%"REG_d"), %%"REG_BP" \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
231 "movl (%%"REG_d"), %%"REG_d" \n\t" |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
232 #endif |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
233 "pxor %%mm0, %%mm0 \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
234 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
235 ASMALIGN(4) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
236 ".Lli1: \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
237 "movq (%%"REG_S"), %%mm1 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
238 "movq (%%"REG_S"), %%mm2 \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
239 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
240 "movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
241 "movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
242 "punpcklbw %%mm0, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
243 "punpcklbw %%mm0, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
244 "movq (%%"REG_a"), %%mm3 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
245 "movq (%%"REG_b"), %%mm5 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
246 "punpcklbw %%mm0, %%mm3 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
247 "punpcklbw %%mm0, %%mm5 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
248 "movq %%mm4, %%mm7 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
249 "paddw %%mm4, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
250 "paddw %%mm7, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
251 "movq %%mm6, %%mm7 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
252 "paddw %%mm6, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
253 "paddw %%mm7, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
254 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
255 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
256 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
257 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
258 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
259 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
260 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
261 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
262 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
263 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
264 "psrlw $3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
265 "psrlw $3, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
266 "packuswb %%mm4, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
267 "packuswb %%mm6, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
268 "punpcklbw %%mm6, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
269 "punpcklbw %%mm4, %%mm1 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
270 "punpckhbw %%mm4, %%mm2 \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
271 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
272 "movq %%mm1, (%%"REG_D") \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
273 "movq %%mm2, 8(%%"REG_D") \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
274 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
275 "movq 8(%%"REG_S"), %%mm1 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
276 "movq 8(%%"REG_S"), %%mm2 \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
277 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
278 "movq (%%"REG_a",%%"REG_d",2), %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
279 "movq (%%"REG_b",%%"REG_BP",2), %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
280 "punpckhbw %%mm0, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
281 "punpckhbw %%mm0, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
282 "movq (%%"REG_a"), %%mm3 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
283 "movq (%%"REG_b"), %%mm5 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
284 "punpckhbw %%mm0, %%mm3 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
285 "punpckhbw %%mm0, %%mm5 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
286 "movq %%mm4, %%mm7 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
287 "paddw %%mm4, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
288 "paddw %%mm7, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
289 "movq %%mm6, %%mm7 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
290 "paddw %%mm6, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
291 "paddw %%mm7, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
292 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
293 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
294 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
295 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
296 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
297 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
298 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
299 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
300 "paddw %%mm3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
301 "paddw %%mm5, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
302 "psrlw $3, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
303 "psrlw $3, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
304 "packuswb %%mm4, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
305 "packuswb %%mm6, %%mm6 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
306 "punpcklbw %%mm6, %%mm4 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
307 "punpcklbw %%mm4, %%mm1 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
308 "punpckhbw %%mm4, %%mm2 \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
309 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
310 "add $16, %%"REG_S" \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
311 "add $8, %%"REG_a" \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
312 "add $8, %%"REG_b" \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
313 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
314 "movq %%mm1, 16(%%"REG_D") \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
315 "movq %%mm2, 24(%%"REG_D") \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
316 "add $32, %%"REG_D" \n\t" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
317 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
318 "decl %%ecx \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
319 "jnz .Lli1 \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
320 "emms \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
321 "pop %%"REG_BP" \n\t" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
322 : |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
323 : "S" (y), "D" (dst), "a" (u), "b" (v), "c" (w/16), |
28290 | 324 #if ARCH_X86_64 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
325 "d" ((x86_reg)us), "r" ((x86_reg)vs) |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
326 #else |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
327 "d" (&us) |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
11648
diff
changeset
|
328 #endif |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
329 : "memory" |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
330 ); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
331 pack_li_1_C(dst, y, u, v, (w&15), us, vs); |
11645 | 332 } |
29639
26a355ffe458
Add several HAVE_EBX_AVAILABLE conditions where necessary
reimar
parents:
29263
diff
changeset
|
333 #endif /* HAVE_EBX_AVAILABLE */ |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
334 #endif |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
335 |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
336 static pack_func_t *pack_nn; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
337 static pack_func_t *pack_li_0; |
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
338 static pack_func_t *pack_li_1; |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
339 |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
340 static void ilpack(unsigned char *dst, unsigned char *src[3], |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
341 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
|
342 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
343 int i; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
344 unsigned char *y, *u, *v; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
345 int ys = srcstride[0], us = srcstride[1], vs = srcstride[2]; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
346 int a, b; |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
347 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
348 y = src[0]; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
349 u = src[1]; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
350 v = src[2]; |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
351 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
352 pack_nn(dst, y, u, v, w, 0, 0); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
353 y += ys; dst += dststride; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
354 pack_nn(dst, y, u+us, v+vs, w, 0, 0); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
355 y += ys; dst += dststride; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
356 for (i=2; i<h-2; i++) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
357 a = (i&2) ? 1 : -1; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
358 b = (i&1) ^ ((i&2)>>1); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
359 pack[b](dst, y, u, v, w, us*a, vs*a); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
360 y += ys; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
361 if ((i&3) == 1) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
362 u -= us; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
363 v -= vs; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
364 } else { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
365 u += us; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
366 v += vs; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
367 } |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
368 dst += dststride; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
369 } |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
370 pack_nn(dst, y, u, v, w, 0, 0); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
371 y += ys; dst += dststride; u += us; v += vs; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
372 pack_nn(dst, y, u, v, w, 0, 0); |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
373 } |
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 |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
376 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
377 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
378 mp_image_t *dmpi; |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
379 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
380 // hope we'll get DR buffer: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
381 dmpi=vf_get_image(vf->next, IMGFMT_YUY2, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
382 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
383 mpi->w, mpi->h); |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
384 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
385 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
|
386 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
387 return vf_next_put_image(vf,dmpi, pts); |
9933
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 |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
390 static int config(struct vf_instance *vf, |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
391 int width, int height, int d_width, int d_height, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
392 unsigned int flags, unsigned int outfmt) |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
393 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
394 /* FIXME - also support UYVY output? */ |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
395 return vf_next_config(vf, width, height, d_width, d_height, flags, IMGFMT_YUY2); |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
396 } |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
397 |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
398 |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
399 static int query_format(struct vf_instance *vf, unsigned int fmt) |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
400 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
401 /* FIXME - really any YUV 4:2:0 input format should work */ |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
402 switch (fmt) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
403 case IMGFMT_YV12: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
404 case IMGFMT_IYUV: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
405 case IMGFMT_I420: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
406 return vf_next_query_format(vf,IMGFMT_YUY2); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
407 } |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
408 return 0; |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
409 } |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
410 |
30638
a7b908875c14
Rename open() vf initialization function to vf_open().
diego
parents:
30633
diff
changeset
|
411 static int vf_open(vf_instance_t *vf, char *args) |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
412 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
413 vf->config=config; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
414 vf->query_format=query_format; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
415 vf->put_image=put_image; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
416 vf->priv = calloc(1, sizeof(struct vf_priv_s)); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
417 vf->priv->mode = 1; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
418 if (args) sscanf(args, "%d", &vf->priv->mode); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
419 |
33448
5e2569e52969
Do not call functions through a function pointer specifying more
reimar
parents:
32702
diff
changeset
|
420 pack_nn = pack_nn_C; |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
421 pack_li_0 = pack_li_0_C; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
422 pack_li_1 = pack_li_1_C; |
28290 | 423 #if HAVE_MMX |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
424 if(gCpuCaps.hasMMX) { |
33448
5e2569e52969
Do not call functions through a function pointer specifying more
reimar
parents:
32702
diff
changeset
|
425 pack_nn = pack_nn_MMX; |
29639
26a355ffe458
Add several HAVE_EBX_AVAILABLE conditions where necessary
reimar
parents:
29263
diff
changeset
|
426 #if HAVE_EBX_AVAILABLE |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
427 pack_li_0 = pack_li_0_MMX; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
428 pack_li_1 = pack_li_1_MMX; |
29639
26a355ffe458
Add several HAVE_EBX_AVAILABLE conditions where necessary
reimar
parents:
29263
diff
changeset
|
429 #endif |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
430 } |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
431 #endif |
11643
3ddfe9316ca9
big updates to ilpack: do proper interpolation rather than just
rfelker
parents:
9933
diff
changeset
|
432 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
433 switch(vf->priv->mode) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
434 case 0: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
435 vf->priv->pack[0] = vf->priv->pack[1] = pack_nn; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
436 break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
437 default: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
438 mp_msg(MSGT_VFILTER, MSGL_WARN, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
439 "ilpack: unknown mode %d (fallback to linear)\n", |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
440 vf->priv->mode); |
35177
51b77c9a11ef
Add comment to silence coverity (and it generally doesn't
reimar
parents:
34198
diff
changeset
|
441 /* Fallthrough */ |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
442 case 1: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
443 vf->priv->pack[0] = pack_li_0; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
444 vf->priv->pack[1] = pack_li_1; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
445 break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
446 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29040
diff
changeset
|
447 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
448 return 1; |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
449 } |
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
450 |
25221 | 451 const vf_info_t vf_info_ilpack = { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
452 "4:2:0 planar -> 4:2:2 packed reinterlacer", |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
453 "ilpack", |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
454 "Richard Felker", |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
455 "", |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
456 vf_open, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
457 NULL |
9933
3548701a13fe
1. new alternate approach to inverse telecine! much better!
rfelker
parents:
diff
changeset
|
458 }; |