Mercurial > mplayer.hg
annotate libmpcodecs/vf_phase.c @ 34140:a08f68ee111e
Fix compilation: Partly revert r34227.
author | cehoyos |
---|---|
date | Fri, 21 Oct 2011 08:49:48 +0000 |
parents | 7af3e6f901fd |
children | 327e3968a50b |
rev | line source |
---|---|
30421
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
1 /* |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
2 * This file is part of MPlayer. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
3 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
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:
29263
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:
29263
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:
29263
diff
changeset
|
7 * (at your option) any later version. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
8 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
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:
29263
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:
29263
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:
29263
diff
changeset
|
12 * GNU General Public License for more details. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
13 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
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:
29263
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:
29263
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:
29263
diff
changeset
|
17 */ |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
18 |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
19 #include <stdio.h> |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
20 #include <stdlib.h> |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
21 #include <string.h> |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
22 #include <limits.h> |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
23 |
17012 | 24 #include "config.h" |
25 #include "mp_msg.h" | |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
26 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
27 #include "img_format.h" |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
28 #include "mp_image.h" |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
29 #include "vf.h" |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
30 |
17012 | 31 #include "libvo/fastmemcpy.h" |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
32 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
33 enum mode { PROGRESSIVE, TOP_FIRST, BOTTOM_FIRST, |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
34 TOP_FIRST_ANALYZE, BOTTOM_FIRST_ANALYZE, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
35 ANALYZE, FULL_ANALYZE, AUTO, AUTO_ANALYZE }; |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
36 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
37 #define fixed_mode(p) ((p)<=BOTTOM_FIRST) |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
38 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
39 struct vf_priv_s |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
40 { |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
41 enum mode mode; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
42 int verbose; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
43 unsigned char *buf[3]; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
44 }; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
45 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
46 /* |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
47 * Copy fields from either current or buffered previous frame to the |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
48 * output and store the current frame unmodified to the buffer. |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
49 */ |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
50 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
51 static void do_plane(unsigned char *to, unsigned char *from, |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
52 int w, int h, int ts, int fs, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
53 unsigned char **bufp, enum mode mode) |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
54 { |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
55 unsigned char *buf, *end; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
56 int top; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25221
diff
changeset
|
57 |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
58 if(!*bufp) |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
59 { |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
60 mode=PROGRESSIVE; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
61 if(!(*bufp=malloc(h*w))) return; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
62 } |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
63 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
64 for(end=to+h*ts, buf=*bufp, top=1; to<end; from+=fs, to+=ts, buf+=w, top^=1) |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
65 { |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
18004
diff
changeset
|
66 fast_memcpy(to, mode==(top?BOTTOM_FIRST:TOP_FIRST)?buf:from, w); |
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
18004
diff
changeset
|
67 fast_memcpy(buf, from, w); |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
68 } |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
69 } |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
70 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
71 /* |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
72 * This macro interpolates the value of both fields at a point halfway |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
73 * between lines and takes the squared difference. In field resolution |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
74 * the point is a quarter pixel below a line in one field and a quarter |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
75 * pixel above a line in other. |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
76 * |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
77 * (the result is actually multiplied by 25) |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
78 */ |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
79 |
17094 | 80 #define diff(a, as, b, bs) (t=((*a-b[bs])<<2)+a[as<<1]-b[-bs], t*t) |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
81 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
82 /* |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
83 * Find which field combination has the smallest average squared difference |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
84 * between the fields. |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
85 */ |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
86 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
87 static enum mode analyze_plane(unsigned char *old, unsigned char *new, |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
88 int w, int h, int os, int ns, enum mode mode, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
89 int verbose, int fields) |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
90 { |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
91 double bdiff, pdiff, tdiff, scale; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
92 int bdif, tdif, pdif; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
93 int top, t; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
94 unsigned char *end, *rend; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
95 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
96 if(mode==AUTO) |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
97 mode=fields&MP_IMGFIELD_ORDERED?fields&MP_IMGFIELD_TOP_FIRST? |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
98 TOP_FIRST:BOTTOM_FIRST:PROGRESSIVE; |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
99 else if(mode==AUTO_ANALYZE) |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
100 mode=fields&MP_IMGFIELD_ORDERED?fields&MP_IMGFIELD_TOP_FIRST? |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
101 TOP_FIRST_ANALYZE:BOTTOM_FIRST_ANALYZE:FULL_ANALYZE; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25221
diff
changeset
|
102 |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
103 if(fixed_mode(mode)) |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
104 bdiff=pdiff=tdiff=65536.0; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
105 else |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
106 { |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
107 bdiff=pdiff=tdiff=0.0; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
108 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
109 for(end=new+(h-2)*ns, new+=ns, old+=os, top=0; |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
110 new<end; new+=ns-w, old+=os-w, top^=1) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
111 { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
112 pdif=tdif=bdif=0; |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
113 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
114 switch(mode) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
115 { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
116 case TOP_FIRST_ANALYZE: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
117 if(top) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
118 for(rend=new+w; new<rend; new++, old++) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
119 pdif+=diff(new, ns, new, ns), |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
120 tdif+=diff(new, ns, old, os); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
121 else |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
122 for(rend=new+w; new<rend; new++, old++) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
123 pdif+=diff(new, ns, new, ns), |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
124 tdif+=diff(old, os, new, ns); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
125 break; |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
126 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
127 case BOTTOM_FIRST_ANALYZE: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
128 if(top) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
129 for(rend=new+w; new<rend; new++, old++) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
130 pdif+=diff(new, ns, new, ns), |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
131 bdif+=diff(old, os, new, ns); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
132 else |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
133 for(rend=new+w; new<rend; new++, old++) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
134 pdif+=diff(new, ns, new, ns), |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
135 bdif+=diff(new, ns, old, os); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
136 break; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25221
diff
changeset
|
137 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
138 case ANALYZE: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
139 if(top) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
140 for(rend=new+w; new<rend; new++, old++) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
141 tdif+=diff(new, ns, old, os), |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
142 bdif+=diff(old, os, new, ns); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
143 else |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
144 for(rend=new+w; new<rend; new++, old++) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
145 bdif+=diff(new, ns, old, os), |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
146 tdif+=diff(old, os, new, ns); |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
147 break; |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
148 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
149 default: /* FULL_ANALYZE */ |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
150 if(top) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
151 for(rend=new+w; new<rend; new++, old++) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
152 pdif+=diff(new, ns, new, ns), |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
153 tdif+=diff(new, ns, old, os), |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
154 bdif+=diff(old, os, new, ns); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
155 else |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
156 for(rend=new+w; new<rend; new++, old++) |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
157 pdif+=diff(new, ns, new, ns), |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
158 bdif+=diff(new, ns, old, os), |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
159 tdif+=diff(old, os, new, ns); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
160 } |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
161 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
162 pdiff+=(double)pdif; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
163 tdiff+=(double)tdif; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
164 bdiff+=(double)bdif; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
165 } |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
166 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
167 scale=1.0/(w*(h-3))/25.0; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
168 pdiff*=scale; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
169 tdiff*=scale; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
170 bdiff*=scale; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25221
diff
changeset
|
171 |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
172 if(mode==TOP_FIRST_ANALYZE) |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
173 bdiff=65536.0; |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
174 else if(mode==BOTTOM_FIRST_ANALYZE) |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
175 tdiff=65536.0; |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
176 else if(mode==ANALYZE) |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
177 pdiff=65536.0; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25221
diff
changeset
|
178 |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
179 if(bdiff<pdiff && bdiff<tdiff) |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
180 mode=BOTTOM_FIRST; |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
181 else if(tdiff<pdiff && tdiff<bdiff) |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
182 mode=TOP_FIRST; |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
183 else |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
184 mode=PROGRESSIVE; |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
185 } |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
186 |
17969
843e0427b5b9
Change 'if(verbose)' to the more appropriate mp_msg_test.
diego
parents:
17906
diff
changeset
|
187 if( mp_msg_test(MSGT_VFILTER,MSGL_V) ) |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
188 { |
18004
bcd805923554
Part2 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu with LOTS of modifications by me
reynaldo
parents:
17969
diff
changeset
|
189 mp_msg(MSGT_VFILTER, MSGL_INFO, "%c", mode==BOTTOM_FIRST?'b':mode==TOP_FIRST?'t':'p'); |
bcd805923554
Part2 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu with LOTS of modifications by me
reynaldo
parents:
17969
diff
changeset
|
190 if(tdiff==65536.0) mp_msg(MSGT_VFILTER, MSGL_INFO," N/A "); else mp_msg(MSGT_VFILTER, MSGL_INFO," %8.2f", tdiff); |
bcd805923554
Part2 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu with LOTS of modifications by me
reynaldo
parents:
17969
diff
changeset
|
191 if(bdiff==65536.0) mp_msg(MSGT_VFILTER, MSGL_INFO," N/A "); else mp_msg(MSGT_VFILTER, MSGL_INFO," %8.2f", bdiff); |
bcd805923554
Part2 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu with LOTS of modifications by me
reynaldo
parents:
17969
diff
changeset
|
192 if(pdiff==65536.0) mp_msg(MSGT_VFILTER, MSGL_INFO," N/A "); else mp_msg(MSGT_VFILTER, MSGL_INFO," %8.2f", pdiff); |
bcd805923554
Part2 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu with LOTS of modifications by me
reynaldo
parents:
17969
diff
changeset
|
193 mp_msg(MSGT_VFILTER, MSGL_INFO," \n"); |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
194 } |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
195 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
196 return mode; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
197 } |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
198 |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
199 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
200 { |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
201 mp_image_t *dmpi; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
202 int w; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
203 enum mode mode; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
204 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
205 if(!(dmpi=vf_get_image(vf->next, mpi->imgfmt, |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
206 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
|
207 mpi->w, mpi->h))) |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
208 return 0; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
209 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
210 w=dmpi->w; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
211 if(!(dmpi->flags&MP_IMGFLAG_PLANAR)) |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
212 w*=dmpi->bpp/8; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
213 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
214 mode=vf->priv->mode; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
215 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
216 if(!vf->priv->buf[0]) |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
217 mode=PROGRESSIVE; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
218 else |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
219 mode=analyze_plane(vf->priv->buf[0], mpi->planes[0], |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
220 w, dmpi->h, w, mpi->stride[0], mode, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
221 vf->priv->verbose, mpi->fields); |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
222 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
223 do_plane(dmpi->planes[0], mpi->planes[0], |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
224 w, dmpi->h, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
225 dmpi->stride[0], mpi->stride[0], |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
226 &vf->priv->buf[0], mode); |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
227 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
228 if(dmpi->flags&MP_IMGFLAG_PLANAR) |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
229 { |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
230 do_plane(dmpi->planes[1], mpi->planes[1], |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
231 dmpi->chroma_width, dmpi->chroma_height, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
232 dmpi->stride[1], mpi->stride[1], |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
233 &vf->priv->buf[1], mode); |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
234 do_plane(dmpi->planes[2], mpi->planes[2], |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
235 dmpi->chroma_width, dmpi->chroma_height, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
236 dmpi->stride[2], mpi->stride[2], |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
237 &vf->priv->buf[2], mode); |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
238 } |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
239 |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17094
diff
changeset
|
240 return vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE); |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
241 } |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
242 |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
243 static void uninit(struct vf_instance *vf) |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
244 { |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
245 free(vf->priv->buf[0]); |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
246 free(vf->priv->buf[1]); |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
247 free(vf->priv->buf[2]); |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
248 free(vf->priv); |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
249 } |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
250 |
30638
a7b908875c14
Rename open() vf initialization function to vf_open().
diego
parents:
30421
diff
changeset
|
251 static int vf_open(vf_instance_t *vf, char *args) |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
252 { |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
253 vf->put_image = put_image; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
254 vf->uninit = uninit; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
255 vf->default_reqs = VFCAP_ACCEPT_STRIDE; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
256 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
257 if(!(vf->priv = calloc(1, sizeof(struct vf_priv_s)))) |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
258 { |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
259 uninit(vf); |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
260 return 0; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
261 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25221
diff
changeset
|
262 |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
263 vf->priv->mode=AUTO_ANALYZE; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
264 vf->priv->verbose=0; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
25221
diff
changeset
|
265 |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
266 while(args && *args) |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
267 { |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
268 switch(*args) |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
269 { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
270 case 't': vf->priv->mode=TOP_FIRST; break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
271 case 'a': vf->priv->mode=AUTO; break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
272 case 'b': vf->priv->mode=BOTTOM_FIRST; break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
273 case 'u': vf->priv->mode=ANALYZE; break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
274 case 'T': vf->priv->mode=TOP_FIRST_ANALYZE; break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
275 case 'A': vf->priv->mode=AUTO_ANALYZE; break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
276 case 'B': vf->priv->mode=BOTTOM_FIRST_ANALYZE; break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
277 case 'U': vf->priv->mode=FULL_ANALYZE; break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
278 case 'p': vf->priv->mode=PROGRESSIVE; break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
279 case 'v': vf->priv->verbose=1; break; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
280 case ':': break; |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
281 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
282 default: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
283 uninit(vf); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
284 return 0; /* bad args */ |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30642
diff
changeset
|
285 } |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
286 |
13188 | 287 if( (args=strchr(args, ':')) ) args++; |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
288 } |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
289 |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
290 return 1; |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
291 } |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
292 |
25221 | 293 const vf_info_t vf_info_phase = |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
294 { |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
295 "phase shift fields", |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
296 "phase", |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
297 "Ville Saari", |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
298 "", |
30638
a7b908875c14
Rename open() vf initialization function to vf_open().
diego
parents:
30421
diff
changeset
|
299 vf_open, |
12081
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
300 NULL |
e34700c872ac
vf_phase filter by Ville Saari (114263 at foo dot bar dot org)
rfelker
parents:
diff
changeset
|
301 }; |