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
28743f18
Commit
28743f18
authored
Feb 12, 2020
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_median: implement percentile option
parent
d9751a11
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
filters.texi
doc/filters.texi
+5
-0
median.h
libavfilter/median.h
+1
-0
vf_median.c
libavfilter/vf_median.c
+2
-1
No files found.
doc/filters.texi
View file @
28743f18
...
@@ -13289,6 +13289,11 @@ Set which planes to process. Default is @code{15}, which is all available planes
...
@@ -13289,6 +13289,11 @@ Set which planes to process. Default is @code{15}, which is all available planes
Set vertical radius size. Default value is @code{0}.
Set vertical radius size. Default value is @code{0}.
Allowed range is integer from 0 to 127.
Allowed range is integer from 0 to 127.
If it is 0, value will be picked from horizontal @code{radius} option.
If it is 0, value will be picked from horizontal @code{radius} option.
@item percentile
Set median percentile. Default value is @code{0.5}.
Default value of @code{0.5} will pick always median values, while @code{0} will pick
minimum values, and @code{1} maximum values.
@end table
@end table
@subsection Commands
@subsection Commands
...
...
libavfilter/median.h
View file @
28743f18
...
@@ -31,6 +31,7 @@ typedef struct MedianContext {
...
@@ -31,6 +31,7 @@ typedef struct MedianContext {
int
planes
;
int
planes
;
int
radius
;
int
radius
;
int
radiusV
;
int
radiusV
;
float
percentile
;
int
planewidth
[
4
];
int
planewidth
[
4
];
int
planeheight
[
4
];
int
planeheight
[
4
];
...
...
libavfilter/vf_median.c
View file @
28743f18
...
@@ -60,6 +60,7 @@ static const AVOption median_options[] = {
...
@@ -60,6 +60,7 @@ static const AVOption median_options[] = {
{
"radius"
,
"set median radius"
,
OFFSET
(
radius
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
1
,
127
,
FLAGS
},
{
"radius"
,
"set median radius"
,
OFFSET
(
radius
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
1
,
127
,
FLAGS
},
{
"planes"
,
"set planes to filter"
,
OFFSET
(
planes
),
AV_OPT_TYPE_INT
,
{.
i64
=
0xF
},
0
,
0xF
,
FLAGS
},
{
"planes"
,
"set planes to filter"
,
OFFSET
(
planes
),
AV_OPT_TYPE_INT
,
{.
i64
=
0xF
},
0
,
0xF
,
FLAGS
},
{
"radiusV"
,
"set median vertical radius"
,
OFFSET
(
radiusV
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
127
,
FLAGS
},
{
"radiusV"
,
"set median vertical radius"
,
OFFSET
(
radiusV
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
127
,
FLAGS
},
{
"percentile"
,
"set median percentile"
,
OFFSET
(
percentile
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
.
5
},
0
.,
1
.,
FLAGS
},
{
NULL
}
{
NULL
}
};
};
...
@@ -127,7 +128,7 @@ static void check_params(MedianContext *s, AVFilterLink *inlink)
...
@@ -127,7 +128,7 @@ static void check_params(MedianContext *s, AVFilterLink *inlink)
}
}
}
}
s
->
t
=
2
*
s
->
radius
*
s
->
radiusV
+
2
*
s
->
radius
;
s
->
t
=
(
2
*
s
->
radius
*
s
->
radiusV
+
s
->
radiusV
+
s
->
radius
)
*
2
.
f
*
s
->
percentile
;
}
}
static
int
config_input
(
AVFilterLink
*
inlink
)
static
int
config_input
(
AVFilterLink
*
inlink
)
...
...
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