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
ef4c71e8
Commit
ef4c71e8
authored
Feb 15, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/unsharp: add check on matrix x/y size values oddity
parent
b8bb661d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
7 deletions
+21
-7
filters.texi
doc/filters.texi
+3
-3
version.h
libavfilter/version.h
+1
-1
vf_unsharp.c
libavfilter/vf_unsharp.c
+17
-3
No files found.
doc/filters.texi
View file @
ef4c71e8
...
...
@@ -4970,13 +4970,13 @@ A description of the accepted options follows.
@table @option
@item luma_msize_x, lx
@item chroma_msize_x, cx
Set the luma/chroma matrix horizontal size. It
can be an
integer
Set the luma/chroma matrix horizontal size. It
must be an odd
integer
between 3 and 63, default value is 5.
@item luma_msize_y, ly
@item chroma_msize_y, cy
Set the luma/chroma matrix vertical size. It
can be an integer between
3 and 63, default value is 5.
Set the luma/chroma matrix vertical size. It
must be an odd integer
between
3 and 63, default value is 5.
@item luma_amount, la
@item chroma_amount, ca
...
...
libavfilter/version.h
View file @
ef4c71e8
...
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 38
#define LIBAVFILTER_VERSION_MICRO 10
0
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
libavfilter/vf_unsharp.c
View file @
ef4c71e8
...
...
@@ -195,11 +195,18 @@ static int query_formats(AVFilterContext *ctx)
return
0
;
}
static
void
init_filter_param
(
AVFilterContext
*
ctx
,
FilterParam
*
fp
,
const
char
*
effect_type
,
int
width
)
static
int
init_filter_param
(
AVFilterContext
*
ctx
,
FilterParam
*
fp
,
const
char
*
effect_type
,
int
width
)
{
int
z
;
const
char
*
effect
;
if
(
!
(
fp
->
msize_x
&
fp
->
msize_y
&
1
))
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid even size for %s matrix size %dx%d
\n
"
,
effect_type
,
fp
->
msize_x
,
fp
->
msize_y
);
return
AVERROR
(
EINVAL
);
}
effect
=
fp
->
amount
==
0
?
"none"
:
fp
->
amount
<
0
?
"blur"
:
"sharpen"
;
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"effect:%s type:%s msize_x:%d msize_y:%d amount:%0.2f
\n
"
,
...
...
@@ -207,18 +214,25 @@ static void init_filter_param(AVFilterContext *ctx, FilterParam *fp, const char
for
(
z
=
0
;
z
<
2
*
fp
->
steps_y
;
z
++
)
fp
->
sc
[
z
]
=
av_malloc
(
sizeof
(
*
(
fp
->
sc
[
z
]))
*
(
width
+
2
*
fp
->
steps_x
));
return
0
;
}
static
int
config_props
(
AVFilterLink
*
link
)
{
UnsharpContext
*
unsharp
=
link
->
dst
->
priv
;
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
link
->
format
);
int
ret
;
unsharp
->
hsub
=
desc
->
log2_chroma_w
;
unsharp
->
vsub
=
desc
->
log2_chroma_h
;
init_filter_param
(
link
->
dst
,
&
unsharp
->
luma
,
"luma"
,
link
->
w
);
init_filter_param
(
link
->
dst
,
&
unsharp
->
chroma
,
"chroma"
,
SHIFTUP
(
link
->
w
,
unsharp
->
hsub
));
ret
=
init_filter_param
(
link
->
dst
,
&
unsharp
->
luma
,
"luma"
,
link
->
w
);
if
(
ret
<
0
)
return
ret
;
ret
=
init_filter_param
(
link
->
dst
,
&
unsharp
->
chroma
,
"chroma"
,
SHIFTUP
(
link
->
w
,
unsharp
->
hsub
));
if
(
ret
<
0
)
return
ret
;
return
0
;
}
...
...
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