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
05fab553
Commit
05fab553
authored
Mar 18, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_gradfun: use the name 's' for the pointer to the private context
This is shorter and consistent across filters.
parent
f6b6d6ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
vf_gradfun.c
libavfilter/vf_gradfun.c
+21
-21
No files found.
libavfilter/vf_gradfun.c
View file @
05fab553
...
@@ -122,26 +122,26 @@ static void filter(GradFunContext *ctx, uint8_t *dst, uint8_t *src, int width, i
...
@@ -122,26 +122,26 @@ static void filter(GradFunContext *ctx, uint8_t *dst, uint8_t *src, int width, i
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
{
{
GradFunContext
*
gf
=
ctx
->
priv
;
GradFunContext
*
s
=
ctx
->
priv
;
gf
->
thresh
=
(
1
<<
15
)
/
gf
->
strength
;
s
->
thresh
=
(
1
<<
15
)
/
s
->
strength
;
gf
->
radius
&=
~
1
;
s
->
radius
&=
~
1
;
gf
->
blur_line
=
ff_gradfun_blur_line_c
;
s
->
blur_line
=
ff_gradfun_blur_line_c
;
gf
->
filter_line
=
ff_gradfun_filter_line_c
;
s
->
filter_line
=
ff_gradfun_filter_line_c
;
if
(
ARCH_X86
)
if
(
ARCH_X86
)
ff_gradfun_init_x86
(
gf
);
ff_gradfun_init_x86
(
s
);
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"threshold:%.2f radius:%d
\n
"
,
gf
->
strength
,
gf
->
radius
);
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"threshold:%.2f radius:%d
\n
"
,
s
->
strength
,
s
->
radius
);
return
0
;
return
0
;
}
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
{
GradFunContext
*
gf
=
ctx
->
priv
;
GradFunContext
*
s
=
ctx
->
priv
;
av_freep
(
&
gf
->
buf
);
av_freep
(
&
s
->
buf
);
}
}
static
int
query_formats
(
AVFilterContext
*
ctx
)
static
int
query_formats
(
AVFilterContext
*
ctx
)
...
@@ -161,25 +161,25 @@ static int query_formats(AVFilterContext *ctx)
...
@@ -161,25 +161,25 @@ static int query_formats(AVFilterContext *ctx)
static
int
config_input
(
AVFilterLink
*
inlink
)
static
int
config_input
(
AVFilterLink
*
inlink
)
{
{
GradFunContext
*
gf
=
inlink
->
dst
->
priv
;
GradFunContext
*
s
=
inlink
->
dst
->
priv
;
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
inlink
->
format
);
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
inlink
->
format
);
int
hsub
=
desc
->
log2_chroma_w
;
int
hsub
=
desc
->
log2_chroma_w
;
int
vsub
=
desc
->
log2_chroma_h
;
int
vsub
=
desc
->
log2_chroma_h
;
gf
->
buf
=
av_mallocz
((
FFALIGN
(
inlink
->
w
,
16
)
*
(
gf
->
radius
+
1
)
/
2
+
32
)
*
sizeof
(
uint16_t
));
s
->
buf
=
av_mallocz
((
FFALIGN
(
inlink
->
w
,
16
)
*
(
s
->
radius
+
1
)
/
2
+
32
)
*
sizeof
(
uint16_t
));
if
(
!
gf
->
buf
)
if
(
!
s
->
buf
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
gf
->
chroma_w
=
-
((
-
inlink
->
w
)
>>
hsub
);
s
->
chroma_w
=
-
((
-
inlink
->
w
)
>>
hsub
);
gf
->
chroma_h
=
-
((
-
inlink
->
h
)
>>
vsub
);
s
->
chroma_h
=
-
((
-
inlink
->
h
)
>>
vsub
);
gf
->
chroma_r
=
av_clip
(((((
gf
->
radius
>>
hsub
)
+
(
gf
->
radius
>>
vsub
))
/
2
)
+
1
)
&
~
1
,
4
,
32
);
s
->
chroma_r
=
av_clip
(((((
s
->
radius
>>
hsub
)
+
(
s
->
radius
>>
vsub
))
/
2
)
+
1
)
&
~
1
,
4
,
32
);
return
0
;
return
0
;
}
}
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFrame
*
in
)
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFrame
*
in
)
{
{
GradFunContext
*
gf
=
inlink
->
dst
->
priv
;
GradFunContext
*
s
=
inlink
->
dst
->
priv
;
AVFilterLink
*
outlink
=
inlink
->
dst
->
outputs
[
0
];
AVFilterLink
*
outlink
=
inlink
->
dst
->
outputs
[
0
];
AVFrame
*
out
;
AVFrame
*
out
;
int
p
,
direct
;
int
p
,
direct
;
...
@@ -203,15 +203,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
...
@@ -203,15 +203,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
for
(
p
=
0
;
p
<
4
&&
in
->
data
[
p
];
p
++
)
{
for
(
p
=
0
;
p
<
4
&&
in
->
data
[
p
];
p
++
)
{
int
w
=
inlink
->
w
;
int
w
=
inlink
->
w
;
int
h
=
inlink
->
h
;
int
h
=
inlink
->
h
;
int
r
=
gf
->
radius
;
int
r
=
s
->
radius
;
if
(
p
)
{
if
(
p
)
{
w
=
gf
->
chroma_w
;
w
=
s
->
chroma_w
;
h
=
gf
->
chroma_h
;
h
=
s
->
chroma_h
;
r
=
gf
->
chroma_r
;
r
=
s
->
chroma_r
;
}
}
if
(
FFMIN
(
w
,
h
)
>
2
*
r
)
if
(
FFMIN
(
w
,
h
)
>
2
*
r
)
filter
(
gf
,
out
->
data
[
p
],
in
->
data
[
p
],
w
,
h
,
out
->
linesize
[
p
],
in
->
linesize
[
p
],
r
);
filter
(
s
,
out
->
data
[
p
],
in
->
data
[
p
],
w
,
h
,
out
->
linesize
[
p
],
in
->
linesize
[
p
],
r
);
else
if
(
out
->
data
[
p
]
!=
in
->
data
[
p
])
else
if
(
out
->
data
[
p
]
!=
in
->
data
[
p
])
av_image_copy_plane
(
out
->
data
[
p
],
out
->
linesize
[
p
],
in
->
data
[
p
],
in
->
linesize
[
p
],
w
,
h
);
av_image_copy_plane
(
out
->
data
[
p
],
out
->
linesize
[
p
],
in
->
data
[
p
],
in
->
linesize
[
p
],
w
,
h
);
}
}
...
...
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