Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
c7e8f610
Commit
c7e8f610
authored
Nov 16, 2014
by
Clément Bœsch
Committed by
Clément Bœsch
Nov 26, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/signalstats: remove pointless sub filter init system
parent
b424e67a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
42 deletions
+15
-42
vf_signalstats.c
libavfilter/vf_signalstats.c
+15
-42
No files found.
libavfilter/vf_signalstats.c
View file @
c7e8f610
...
...
@@ -43,7 +43,6 @@ typedef struct {
enum
FilterMode
outfilter
;
int
filters
;
AVFrame
*
frame_prev
;
char
*
vrep_line
;
uint8_t
rgba_color
[
4
];
int
yuv_color
[
3
];
}
SignalstatsContext
;
...
...
@@ -88,7 +87,6 @@ static av_cold void uninit(AVFilterContext *ctx)
{
SignalstatsContext
*
s
=
ctx
->
priv
;
av_frame_free
(
&
s
->
frame_prev
);
av_freep
(
&
s
->
vrep_line
);
}
static
int
query_formats
(
AVFilterContext
*
ctx
)
...
...
@@ -124,12 +122,6 @@ static int config_props(AVFilterLink *outlink)
s
->
fs
=
inlink
->
w
*
inlink
->
h
;
s
->
cfs
=
s
->
chromaw
*
s
->
chromah
;
if
(
s
->
filters
&
1
<<
FILTER_VREP
)
{
s
->
vrep_line
=
av_malloc
(
inlink
->
h
*
sizeof
(
*
s
->
vrep_line
));
if
(
!
s
->
vrep_line
)
return
AVERROR
(
ENOMEM
);
}
return
0
;
}
...
...
@@ -209,49 +201,34 @@ filter_tout_outlier(p[(y-j) * lw + x + i], \
#define VREP_START 4
static
void
filter_init_vrep
(
SignalstatsContext
*
s
,
const
AVFrame
*
p
,
int
w
,
int
h
)
{
int
i
,
y
;
int
lw
=
p
->
linesize
[
0
];
for
(
y
=
VREP_START
;
y
<
h
;
y
++
)
{
int
totdiff
=
0
;
int
y2lw
=
(
y
-
VREP_START
)
*
lw
;
int
ylw
=
y
*
lw
;
for
(
i
=
0
;
i
<
w
;
i
++
)
totdiff
+=
abs
(
p
->
data
[
0
][
y2lw
+
i
]
-
p
->
data
[
0
][
ylw
+
i
]);
/* this value should be definable */
s
->
vrep_line
[
y
]
=
totdiff
<
w
;
}
}
static
int
filter_vrep
(
SignalstatsContext
*
s
,
const
AVFrame
*
in
,
AVFrame
*
out
,
int
y
,
int
w
,
int
h
)
{
int
x
,
score
=
0
;
const
uint8_t
*
p
=
in
->
data
[
0
];
const
int
lw
=
in
->
linesize
[
0
];
int
x
,
score
,
totdiff
=
0
;
const
int
y2lw
=
(
y
-
VREP_START
)
*
lw
;
const
int
ylw
=
y
*
lw
;
if
(
y
<
VREP_START
)
return
0
;
for
(
x
=
0
;
x
<
w
;
x
++
)
{
if
(
s
->
vrep_line
[
y
])
{
score
++
;
if
(
out
)
burn_frame
(
s
,
out
,
x
,
y
);
}
}
for
(
x
=
0
;
x
<
w
;
x
++
)
totdiff
+=
abs
(
p
[
y2lw
+
x
]
-
p
[
ylw
+
x
]);
score
=
(
totdiff
<
w
)
*
w
;
if
(
score
&&
out
)
for
(
x
=
0
;
x
<
w
;
x
++
)
burn_frame
(
s
,
out
,
x
,
y
);
return
score
;
}
static
const
struct
{
const
char
*
name
;
void
(
*
init
)(
SignalstatsContext
*
s
,
const
AVFrame
*
p
,
int
w
,
int
h
);
int
(
*
process
)(
SignalstatsContext
*
s
,
const
AVFrame
*
in
,
AVFrame
*
out
,
int
y
,
int
w
,
int
h
);
}
filters_def
[]
=
{
{
"TOUT"
,
NULL
,
filter_tout
},
{
"VREP"
,
filter_
init_vrep
,
filter_
vrep
},
{
"BRNG"
,
NULL
,
filter_brng
},
{
"TOUT"
,
filter_tout
},
{
"VREP"
,
filter_vrep
},
{
"BRNG"
,
filter_brng
},
{
NULL
}
};
...
...
@@ -299,10 +276,6 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
av_frame_make_writable
(
out
);
}
for
(
fil
=
0
;
fil
<
FILT_NUMB
;
fil
++
)
if
((
s
->
filters
&
1
<<
fil
)
&&
filters_def
[
fil
].
init
)
filters_def
[
fil
].
init
(
s
,
in
,
link
->
w
,
link
->
h
);
// Calculate luma histogram and difference with previous frame or field.
for
(
j
=
0
;
j
<
link
->
h
;
j
++
)
{
for
(
i
=
0
;
i
<
link
->
w
;
i
++
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment