Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
c7e8f610
Commit
c7e8f610
authored
10 years ago
by
Clément Bœsch
Committed by
Clément Bœsch
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
avfilter/signalstats: remove pointless sub filter init system
parent
b424e67a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavfilter/vf_signalstats.c
+15
-42
15 additions, 42 deletions
libavfilter/vf_signalstats.c
with
15 additions
and
42 deletions
libavfilter/vf_signalstats.c
+
15
−
42
View file @
c7e8f610
...
@@ -43,7 +43,6 @@ typedef struct {
...
@@ -43,7 +43,6 @@ typedef struct {
enum
FilterMode
outfilter
;
enum
FilterMode
outfilter
;
int
filters
;
int
filters
;
AVFrame
*
frame_prev
;
AVFrame
*
frame_prev
;
char
*
vrep_line
;
uint8_t
rgba_color
[
4
];
uint8_t
rgba_color
[
4
];
int
yuv_color
[
3
];
int
yuv_color
[
3
];
}
SignalstatsContext
;
}
SignalstatsContext
;
...
@@ -88,7 +87,6 @@ static av_cold void uninit(AVFilterContext *ctx)
...
@@ -88,7 +87,6 @@ static av_cold void uninit(AVFilterContext *ctx)
{
{
SignalstatsContext
*
s
=
ctx
->
priv
;
SignalstatsContext
*
s
=
ctx
->
priv
;
av_frame_free
(
&
s
->
frame_prev
);
av_frame_free
(
&
s
->
frame_prev
);
av_freep
(
&
s
->
vrep_line
);
}
}
static
int
query_formats
(
AVFilterContext
*
ctx
)
static
int
query_formats
(
AVFilterContext
*
ctx
)
...
@@ -124,12 +122,6 @@ static int config_props(AVFilterLink *outlink)
...
@@ -124,12 +122,6 @@ static int config_props(AVFilterLink *outlink)
s
->
fs
=
inlink
->
w
*
inlink
->
h
;
s
->
fs
=
inlink
->
w
*
inlink
->
h
;
s
->
cfs
=
s
->
chromaw
*
s
->
chromah
;
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
;
return
0
;
}
}
...
@@ -209,49 +201,34 @@ filter_tout_outlier(p[(y-j) * lw + x + i], \
...
@@ -209,49 +201,34 @@ filter_tout_outlier(p[(y-j) * lw + x + i], \
#define VREP_START 4
#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
)
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
)
if
(
y
<
VREP_START
)
return
0
;
return
0
;
for
(
x
=
0
;
x
<
w
;
x
++
)
{
for
(
x
=
0
;
x
<
w
;
x
++
)
if
(
s
->
vrep_line
[
y
])
{
totdiff
+=
abs
(
p
[
y2lw
+
x
]
-
p
[
ylw
+
x
]);
score
++
;
if
(
out
)
score
=
(
totdiff
<
w
)
*
w
;
burn_frame
(
s
,
out
,
x
,
y
);
if
(
score
&&
out
)
}
for
(
x
=
0
;
x
<
w
;
x
++
)
}
burn_frame
(
s
,
out
,
x
,
y
);
return
score
;
return
score
;
}
}
static
const
struct
{
static
const
struct
{
const
char
*
name
;
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
);
int
(
*
process
)(
SignalstatsContext
*
s
,
const
AVFrame
*
in
,
AVFrame
*
out
,
int
y
,
int
w
,
int
h
);
}
filters_def
[]
=
{
}
filters_def
[]
=
{
{
"TOUT"
,
NULL
,
filter_tout
},
{
"TOUT"
,
filter_tout
},
{
"VREP"
,
filter_init_vrep
,
filter_vrep
},
{
"VREP"
,
filter_vrep
},
{
"BRNG"
,
NULL
,
filter_brng
},
{
"BRNG"
,
filter_brng
},
{
NULL
}
{
NULL
}
};
};
...
@@ -299,10 +276,6 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
...
@@ -299,10 +276,6 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
av_frame_make_writable
(
out
);
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.
// Calculate luma histogram and difference with previous frame or field.
for
(
j
=
0
;
j
<
link
->
h
;
j
++
)
{
for
(
j
=
0
;
j
<
link
->
h
;
j
++
)
{
for
(
i
=
0
;
i
<
link
->
w
;
i
++
)
{
for
(
i
=
0
;
i
<
link
->
w
;
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment