-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFrameDiff - READ ME.txt
235 lines (129 loc) · 6.53 KB
/
FrameDiff - READ ME.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
FrameDiff v1.6 - HELP FILE (11/21/2007)
GENERAL INFO:
** Currently FrameDiff only supports YV12 and YUY2 colorspaces!
FrameDiff exposes tdecimate's metric calculation routines to allow for some
interesting operations and visualizations. There is also a version of FrameDiff
that can be used in conditional filtering called "CFrameDiff" that allows using
tdecimate's metric calculation abilities in Avisynth's conditional environment.
CFrameDiff returns either the calculated metric or the position of the block
to the script.
Syntax=>
FrameDiff(int mode, bool prevf, int nt, int blockx, int blocky, bool chroma,
float thresh, int display, bool debug, bool norm, bool denoise,
bool ssd, int opt)
CFrameDiff(int mode, bool prevf, int nt, int blockx, int blocky, bool chroma,
bool debug, bool norm, bool denoise, bool ssd, bool rpos, int opt)
example =>
conditionalfilter(last,source1,source2,"CFrameDiff",">","2.0")
PARAMETERS:
mode -
Sets whether the highest metric value or the lowest metric value for the
frame is returned.
0 - lowest
1 - highest
Default: 1 (int)
prevf -
Sets whether the difference to the previous frame or the difference to the
next frame is calculated.
true - previous
false - next
Default: true (bool)
nt -
The noise threshold used when calculating the metrics. This is the same as
the nt parameter in TDecimate.
Default: 0 (int)
blockx/blocky -
Defines the size of the blocks used during metric calculations. blockx = x-axis
size, blocky = y-axis size. Must be powers of 2 that are greater than or equal
to 4 and less than or equal to 2048. These are the same as the blockx/blocky
settings in TDecimate.
Default: blockx = 32 (int)
blocky = 32 (int)
chroma -
Sets whether or not chroma is considered in the metric calculations.
Default: false (bool)
display -
Controls what, if anything, is drawn on the frames. Possible settings:
0 - nothing
1 - debug info + a box is drawn around the block that the metric
came from (the lowest metric'd block for mode = 0 and the
highest metric'd block for mode = 1)
2 - debug info + if mode = 0 then all blocks with a metric that
is <= to the "thresh" parameter will be filled in white,
else if mode = 1 then all blocks with a metric that is >=
"thresh" will be filled in white. (A black single pixel
mark is added to the middle of each filled block)
3 - the frame is set to 0 except for the block that the metric came
from (the lowest metric'd block for mode = 0 and the highest
metric'd block for mode = 1), which is set to 255
4 - same as 2, except no debug info is written, no single pixel
mark is added, and the rest of the frame (the non marked blocks)
is set to 0.
Default: 0 (int)
thresh -
Used by display=2 to determine what blocks to fill. Is based on the normalized
(0.0 to 100.0) scale used by tdecimate.
Default: 2.0 (float)
debug -
Output metric information via OutputDebugString().
Default: false (bool)
norm -
Sets whether to return the normalized metrics (0.0 to 100.0 scale) or the
unnormalized metrics when using CFrameDiff in conditional filtering. Also
effects which metrics are displayed by the "display" option for FrameDiff.
true - return normalized metrics
false - return unnormalized metrics
Default: true (bool)
denoise -
Sets whether or not to denoise frames prior to doing the difference calculations.
This can greatly improve metrics for noisy sources (i.e. stabilize duplicate
frame metrics and make it easier to tell the difference between duplicates and
non-duplicates). It also works very well for sources with lots of dotcrawl
because the denoising effectively cancels all dot-crawl. Using denoising
will slow things down somewhat, but it is MMX optimized and pretty fast.
true - use denoising
false - don't
Default: false (bool)
ssd -
Controls whether the metrics are calculated as SAD (sum of absolute differences)
or SSD (sum of squared differences).
true - use ssd
false - use sad
Default: false (bool)
rpos -
Controls whether CFrameDiff returns the metric or the position of the block. The
position is returned as a single integer coded as:
return value = y*width+x
Where x and y are coordinates of the top left pixel of the block. If set to true
then the position is returned. Otherwise, the metric is returned.
Default: false (bool)
opt -
Controls which optimizations are used. Possible settings:
0 - use c routines
1 - use mmx routines
2 - use isse routines
3 - use sse2 routines
4 - auto detect
Default: 4 (int)
CHANGE LIST:
v1.6 - (11/21/2007)
- fixed CFrameDiff returning invalid positions when rpos=true and there
was no motion
v1.5 - (09/28/2007)
+ added display modes 3/4 to framediff
+ added ability to return block position to cframediff
- fixed bug in cframediff which caused mode=0 to return the highest
value instead of the lowest when norm was set to true
v1.4 - (03/23/2006)
- replace frame copy with makewritable
v1.3 - (01/24/2006)
+ ported new mmx/isse/sse2 optimizations from TDecimate
+ added opt parameter
- fixed ssd missing in CFrameDiff parameter string
v1.2 - (11/01/2005)
+ added ssd parameter
v1.1 - (9/28/2005)
+ added denoise parameter
TO DO LIST:
- nothing
contact: forum.doom9.org nick = tritical or email: kes25c@mizzou.edu